/* ============================================================
   DNSLab - Webmaster Tools Portal
   style.css — Design System & Theme
   ============================================================ */

/* --- CSS Reset --- */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%}
body{min-height:100vh;line-height:1.6;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}
img,picture,video,canvas,svg{display:block;max-width:100%}
input,button,textarea,select{font:inherit;color:inherit}
a{color:inherit;text-decoration:none}
ul{list-style:none}
table{border-collapse:collapse;border-spacing:0}

/* --- Design Tokens --- */
:root{
  --color-bg:#f8fafc;
  --color-bg-secondary:#f1f5f9;
  --color-surface:#fff;
  --color-surface-hover:#f8fafc;
  --color-surface-elevated:#fff;
  --color-border:#e2e8f0;
  --color-border-light:#f1f5f9;
  --color-text:#0f172a;
  --color-text-secondary:#64748b;
  --color-text-tertiary:#94a3b8;
  --color-accent:#0ea5e9;
  --color-accent-hover:#0284c7;
  --color-accent-subtle:#e0f2fe;
  --color-success:#10b981;
  --color-success-subtle:#d1fae5;
  --color-warning:#f59e0b;
  --color-warning-subtle:#fef3c7;
  --color-error:#ef4444;
  --color-error-subtle:#fee2e2;
  --font-sans:system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
  --font-mono:'JetBrains Mono','Fira Code','Cascadia Code',Consolas,monospace;
  --container:1200px;
  --container-narrow:800px;
  --radius-sm:6px;
  --radius:10px;
  --radius-lg:16px;
  --radius-xl:20px;
  --shadow-sm:0 1px 2px rgba(0,0,0,.04);
  --shadow:0 1px 3px rgba(0,0,0,.06),0 1px 2px rgba(0,0,0,.04);
  --shadow-md:0 4px 6px -1px rgba(0,0,0,.07),0 2px 4px -2px rgba(0,0,0,.05);
  --shadow-lg:0 10px 15px -3px rgba(0,0,0,.08),0 4px 6px -4px rgba(0,0,0,.04);
  --shadow-xl:0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.04);
  --transition:200ms ease;
  --nav-height:64px;
  --noise:url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.015'/%3E%3C/svg%3E")
}

/* --- Dark Theme --- */
[data-theme="dark"]{
  --color-bg:#0b1120;
  --color-bg-secondary:#0f172a;
  --color-surface:#1a2332;
  --color-surface-hover:#1e293b;
  --color-surface-elevated:#1e293b;
  --color-border:#1e293b;
  --color-border-light:#1a2332;
  --color-text:#f1f5f9;
  --color-text-secondary:#94a3b8;
  --color-text-tertiary:#64748b;
  --color-accent:#38bdf8;
  --color-accent-hover:#7dd3fc;
  --color-accent-subtle:rgba(56,189,248,.1);
  --color-success:#34d399;
  --color-success-subtle:rgba(52,211,153,.1);
  --color-warning:#fbbf24;
  --color-warning-subtle:rgba(251,191,36,.1);
  --color-error:#f87171;
  --color-error-subtle:rgba(248,113,113,.1);
  --shadow-sm:0 1px 2px rgba(0,0,0,.2);
  --shadow:0 1px 3px rgba(0,0,0,.3);
  --shadow-md:0 4px 6px rgba(0,0,0,.3);
  --shadow-lg:0 10px 15px rgba(0,0,0,.4);
  --shadow-xl:0 20px 25px rgba(0,0,0,.5)
}

/* --- Base --- */
body{font-family:var(--font-sans);background:var(--color-bg);color:var(--color-text);transition:background var(--transition),color var(--transition)}
body::before{content:'';position:fixed;inset:0;background-image:var(--noise);pointer-events:none;z-index:9999}

::selection{background:var(--color-accent);color:#fff}

/* --- Typography --- */
h1,h2,h3,h4{line-height:1.2;font-weight:700}
h1{font-size:clamp(1.75rem,4vw,2.75rem)}
h2{font-size:clamp(1.35rem,3vw,1.85rem)}
h3{font-size:1.15rem}
h4{font-size:1rem}
p{margin-bottom:.75rem;color:var(--color-text-secondary)}

/* --- Container --- */
.container{width:100%;max-width:var(--container);margin:0 auto;padding:0 1.25rem}
.container-narrow{max-width:var(--container-narrow)}

/* --- Header / Nav --- */
.header{position:sticky;top:0;z-index:100;background:rgba(255,255,255,.8);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);border-bottom:1px solid var(--color-border)}
[data-theme="dark"] .header{background:rgba(11,17,32,.85)}
.header-inner{display:flex;align-items:center;height:var(--nav-height);gap:1rem}
.logo{display:flex;align-items:center;gap:.5rem;font-weight:800;font-size:1.25rem;color:var(--color-accent);flex-shrink:0}
.logo-icon{width:32px;height:32px;background:var(--color-accent);border-radius:var(--radius-sm);display:flex;align-items:center;justify-content:center;color:#fff;font-weight:900;font-size:1rem}
.nav{display:flex;align-items:center;gap:.25rem;flex:1}
.nav a{padding:.5rem .75rem;border-radius:var(--radius-sm);font-size:.875rem;font-weight:500;color:var(--color-text-secondary);transition:all var(--transition)}
.nav a:hover,.nav a.active{color:var(--color-text);background:var(--color-surface-hover)}
.nav-actions{display:flex;align-items:center;gap:.5rem;margin-left:auto}
.theme-btn{width:38px;height:38px;border-radius:var(--radius-sm);border:1px solid var(--color-border);background:var(--color-surface);cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:1.1rem;transition:all var(--transition);flex-shrink:0}
.theme-btn:hover{border-color:var(--color-accent);color:var(--color-accent)}
.lang-btn{height:38px;padding:0 12px;border-radius:var(--radius-sm);border:1px solid var(--color-border);background:var(--color-surface);cursor:pointer;font-size:.75rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;transition:all var(--transition);flex-shrink:0;color:var(--color-text-secondary)}
.lang-btn:hover{border-color:var(--color-accent);color:var(--color-accent)}
.menu-btn{display:none;width:38px;height:38px;border-radius:var(--radius-sm);border:1px solid var(--color-border);background:var(--color-surface);cursor:pointer;align-items:center;justify-content:center;font-size:1.25rem;transition:all var(--transition)}

/* --- Hero --- */
.hero{text-align:center;padding:4rem 1.25rem 3rem;position:relative;overflow:hidden}
.hero::before{content:'';position:absolute;inset:0;background:radial-gradient(ellipse at 50% 0,var(--color-accent-subtle),transparent 70%);pointer-events:none}
.hero-content{position:relative;max-width:700px;margin:0 auto}
.hero h1{margin-bottom:.75rem;background:linear-gradient(135deg,var(--color-text),var(--color-accent));-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text;text-wrap:balance}
.hero p{font-size:1.1rem;margin-bottom:0}

/* --- Section --- */
.section{padding:3rem 0}
.section-header{text-align:center;margin-bottom:2.5rem}
.section-header h2{margin-bottom:.5rem}
.section-header p{max-width:560px;margin:0 auto}

/* --- Tool Grid --- */
.tool-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:1rem}

/* --- Card --- */
.card{background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-lg);padding:1.5rem;transition:all var(--transition);cursor:pointer}
.card:hover{border-color:var(--color-accent);transform:translateY(-2px);box-shadow:var(--shadow-md)}
.card-icon{width:44px;height:44px;border-radius:var(--radius);background:var(--color-accent-subtle);display:flex;align-items:center;justify-content:center;margin-bottom:1rem;font-size:1.25rem;color:var(--color-accent)}
.card h3{font-size:.95rem;margin-bottom:.35rem}
.card p{font-size:.825rem;color:var(--color-text-tertiary);margin:0;line-height:1.4}

/* --- Tool Page --- */
.tool-page{padding:2rem 0}
.tool-back{display:inline-flex;align-items:center;gap:.375rem;font-size:.875rem;color:var(--color-text-secondary);margin-bottom:1.5rem;transition:color var(--transition);cursor:pointer;border:none;background:none}
.tool-back:hover{color:var(--color-accent)}
.tool-header{margin-bottom:2rem}
.tool-header h1{font-size:1.5rem;margin-bottom:.375rem}
.tool-header p{font-size:.9rem;margin:0}

/* --- Tool Form --- */
.tool-form{background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-lg);padding:1.5rem;margin-bottom:1.5rem}
.tool-form .form-row{display:flex;gap:.75rem;flex-wrap:wrap;align-items:end}
.tool-form .form-group{flex:1;min-width:200px}
.tool-form .label-container{display:flex;align-items:center;margin-bottom:.375rem}
.tool-form label{font-size:.8rem;font-weight:600;color:var(--color-text-secondary)}
.help-icon{display:inline-flex;align-items:center;justify-content:center;width:15px;height:15px;border-radius:50%;background:var(--color-border);color:var(--color-text-secondary);font-size:10px;font-weight:bold;margin-left:.4rem;cursor:help;transition:all var(--transition)}
.help-icon:hover{background:var(--color-accent);color:#fff}
.tool-form input,.tool-form select{padding:.75rem 1rem;border:2px solid var(--color-border);border-radius:var(--radius-sm);background:var(--color-bg);font-size:.9rem;outline:none;transition:all var(--transition);width:100%}
.tool-form input:focus,.tool-form select:focus{border-color:var(--color-accent);box-shadow:0 0 0 3px var(--color-accent-subtle)}
.tool-form .btn{padding:.75rem 1.5rem;background:var(--color-accent);color:#fff;border:none;border-radius:var(--radius-sm);font-weight:600;cursor:pointer;transition:all var(--transition);white-space:nowrap;font-size:.9rem}
.tool-form .btn:hover{background:var(--color-accent-hover);transform:translateY(-1px)}
.tool-form .btn:disabled{opacity:.5;cursor:not-allowed;transform:none}

/* --- Results --- */
.tool-results{animation:fadeIn .3s ease}
.tool-results .result-card{background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-lg);padding:1.5rem;margin-bottom:1rem}
.tool-results .result-card h3{font-size:.95rem;margin-bottom:1rem;padding-bottom:.5rem;border-bottom:1px solid var(--color-border)}
.result-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:1rem}
.result-item{padding:.75rem;background:var(--color-bg-secondary);border-radius:var(--radius-sm)}
.result-item .label{font-size:.7rem;text-transform:uppercase;letter-spacing:.04em;color:var(--color-text-tertiary);font-weight:600}
.result-item .value{font-size:.9rem;font-weight:500;margin-top:.125rem;word-break:break-all}

.result-table{width:100%;font-size:.85rem}
.result-table th{text-align:left;padding:.625rem .75rem;font-weight:600;color:var(--color-text-secondary);font-size:.75rem;text-transform:uppercase;letter-spacing:.04em;border-bottom:2px solid var(--color-border)}
.result-table td{padding:.625rem .75rem;border-bottom:1px solid var(--color-border-light);word-break:break-all}
.result-table tr:hover td{background:var(--color-surface-hover)}
.result-table .mono{font-family:var(--font-mono);font-size:.8rem}

/* --- Status Badges --- */
.badge{display:inline-flex;align-items:center;gap:.3rem;padding:.2rem .6rem;border-radius:20px;font-size:.7rem;font-weight:600}
.badge-success{background:var(--color-success-subtle);color:var(--color-success)}
.badge-warning{background:var(--color-warning-subtle);color:var(--color-warning)}
.badge-error{background:var(--color-error-subtle);color:var(--color-error)}
.badge-info{background:var(--color-accent-subtle);color:var(--color-accent)}

/* --- Loading --- */
.loading{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:3rem;gap:1rem}
.spinner{width:40px;height:40px;border:3px solid var(--color-border);border-top-color:var(--color-accent);border-radius:50%;animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.loading p{font-size:.85rem;color:var(--color-text-tertiary);margin:0}

/* --- Error --- */
.error-box{padding:1rem 1.25rem;background:var(--color-error-subtle);border:1px solid var(--color-error);border-radius:var(--radius-sm);color:var(--color-error);font-size:.85rem;margin-bottom:1rem}
.error-box strong{display:block;margin-bottom:.25rem}

/* --- Empty State --- */
.empty-state{text-align:center;padding:3rem 1rem;color:var(--color-text-tertiary)}
.empty-state .icon{font-size:3rem;margin-bottom:1rem;opacity:.5}
.empty-state p{font-size:.9rem;margin:0}

/* --- Status Bar (DNS propagation) --- */
.status-bar{height:8px;border-radius:4px;background:var(--color-bg-secondary);overflow:hidden;margin-top:.375rem}
.status-bar-fill{height:100%;border-radius:4px;transition:width .5s ease;width:0}
.status-bar-fill.match{background:var(--color-success)}
.status-bar-fill.partial{background:var(--color-warning)}
.status-bar-fill.mismatch{background:var(--color-error)}

/* --- FAQ --- */
.faq-list{max-width:700px;margin:0 auto}
.faq-item{border:1px solid var(--color-border);border-radius:var(--radius);margin-bottom:.5rem;overflow:hidden}
.faq-question{width:100%;padding:1rem 1.25rem;background:var(--color-surface);border:none;cursor:pointer;text-align:left;font-weight:600;font-size:.9rem;display:flex;justify-content:space-between;align-items:center;transition:background var(--transition)}
.faq-question:hover{background:var(--color-surface-hover)}
.faq-question .arrow{transition:transform var(--transition);font-size:.75rem;color:var(--color-text-tertiary)}
.faq-item.open .faq-question .arrow{transform:rotate(180deg)}
.faq-answer{padding:0 1.25rem;max-height:0;overflow:hidden;transition:all .3s ease;font-size:.85rem;color:var(--color-text-secondary);line-height:1.7}
.faq-item.open .faq-answer{padding:0 1.25rem 1.25rem;max-height:500px}

/* --- Footer --- */
.footer{margin-top:4rem;border-top:1px solid var(--color-border);background:var(--color-bg-secondary);padding:3rem 0 1.5rem}
.footer-grid{display:grid;grid-template-columns:2fr 1fr 1fr;gap:2rem}
.footer-brand .logo{margin-bottom:.75rem}
.footer-brand p{font-size:.8rem;margin:0}
.footer h4{font-size:.85rem;margin-bottom:1rem}
.footer ul li{margin-bottom:.5rem}
.footer ul a{font-size:.8rem;color:var(--color-text-secondary);transition:color var(--transition)}
.footer ul a:hover{color:var(--color-accent)}
.footer-bottom{margin-top:2rem;padding-top:1.5rem;border-top:1px solid var(--color-border);display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:.5rem;font-size:.75rem;color:var(--color-text-tertiary)}
.footer-bottom a{color:var(--color-text-secondary)}
.footer-bottom a:hover{color:var(--color-accent)}

/* --- AdSense Slots --- */
.ad-slot{text-align:center;padding:1rem;background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-sm);font-size:.75rem;color:var(--color-text-tertiary);min-height:90px;display:flex;align-items:center;justify-content:center}
.ad-slot-leaderboard{min-height:90px}
.ad-slot-sidebar{min-height:250px}

/* --- Toast --- */
.toast{position:fixed;bottom:1.5rem;right:1.5rem;padding:.75rem 1.25rem;background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius);box-shadow:var(--shadow-lg);z-index:999;animation:slideUp .3s ease;font-size:.85rem;max-width:360px}
.toast-success{border-color:var(--color-success)}
.toast-error{border-color:var(--color-error)}

/* --- Breadcrumbs --- */
.breadcrumbs{display:flex;align-items:center;gap:.375rem;font-size:.75rem;color:var(--color-text-tertiary);margin-bottom:1.5rem;flex-wrap:wrap}
.breadcrumbs a{color:var(--color-text-secondary);transition:color var(--transition)}
.breadcrumbs a:hover{color:var(--color-accent)}
.breadcrumbs .sep{color:var(--color-text-tertiary);font-size:.6rem}

/* --- Responsive --- */
@media(max-width:900px){
  .footer-grid{grid-template-columns:1fr 1fr}
}
@media(max-width:768px){
  .nav{display:none;position:absolute;top:var(--nav-height);left:0;right:0;background:var(--color-surface);border-bottom:1px solid var(--color-border);flex-direction:column;padding:.5rem;box-shadow:var(--shadow-lg)}
  .nav.open{display:flex}
  .menu-btn{display:flex}
  .hero{padding:2.5rem 1rem 2rem}
  .tool-grid{grid-template-columns:repeat(auto-fill,minmax(240px,1fr))}
  .tool-form .form-row{flex-direction:column}
  .tool-form .form-group{min-width:0}
  .result-grid{grid-template-columns:1fr}
  .footer-grid{grid-template-columns:1fr;gap:1.5rem}
  .footer-bottom{flex-direction:column;text-align:center}
}
@media(max-width:480px){
  .tool-grid{grid-template-columns:1fr}
  .container{padding:0 1rem}
  .hero h1{font-size:1.35rem}
}

/* --- Animations --- */
@keyframes fadeIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
@keyframes slideUp{from{opacity:0;transform:translateY(16px)}to{opacity:1;transform:translateY(0)}}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.5}}
.fade-in{animation:fadeIn .3s ease both}
.stagger>*{animation:fadeIn .3s ease both}
.stagger>*:nth-child(1){animation-delay:0ms}
.stagger>*:nth-child(2){animation-delay:60ms}
.stagger>*:nth-child(3){animation-delay:120ms}
.stagger>*:nth-child(4){animation-delay:180ms}
.stagger>*:nth-child(5){animation-delay:240ms}
.stagger>*:nth-child(6){animation-delay:300ms}
.stagger>*:nth-child(7){animation-delay:360ms}
.stagger>*:nth-child(8){animation-delay:420ms}

/* --- Utility --- */
.text-center{text-align:center}
.mono{font-family:var(--font-mono)}
.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.mb-1{margin-bottom:.5rem}
.mb-2{margin-bottom:1rem}
.mt-2{margin-top:1rem}
.mt-3{margin-top:1.5rem}

/* --- Scrollbar --- */
::-webkit-scrollbar{width:6px;height:6px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:var(--color-border);border-radius:3px}
::-webkit-scrollbar-thumb:hover{background:var(--color-text-tertiary)}

/* --- OG Preview Card --- */
.og-card{border:1px solid var(--color-border);border-radius:var(--radius);overflow:hidden;max-width:480px}
.og-card img{width:100%;height:200px;object-fit:cover}
.og-card-body{padding:1rem}
.og-card-body .og-domain{font-size:.7rem;text-transform:uppercase;color:var(--color-text-tertiary);margin-bottom:.25rem}
.og-card-body .og-title{font-weight:600;font-size:.9rem;margin-bottom:.25rem;line-height:1.3}
.og-card-body .og-desc{font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}

/* --- Speed Score --- */
.speed-score{display:flex;align-items:center;gap:1.5rem;padding:1.5rem;background:var(--color-bg-secondary);border-radius:var(--radius)}
.speed-score-ring{position:relative;width:80px;height:80px;flex-shrink:0}
.speed-score-ring svg{transform:rotate(-90deg)}
.speed-score-ring .bg{fill:none;stroke:var(--color-border);stroke-width:8}
.speed-score-ring .fill{fill:none;stroke-width:8;stroke-linecap:round;transition:stroke-dashoffset 1s ease}
.speed-score-ring .score-text{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-weight:800;font-size:1.5rem}
.score-good{stroke:var(--color-success)}
.score-average{stroke:var(--color-warning)}
.score-poor{stroke:var(--color-error)}

/* --- Skip Link --- */
.skip-link{position:absolute;top:-100%;left:1rem;z-index:1000;padding:.75rem 1.5rem;background:var(--color-accent);color:#fff;border-radius:var(--radius-sm);font-weight:600;font-size:.875rem;transition:top .2s}
.skip-link:focus{top:1rem}

/* --- DNS Propagation Resolvers --- */
.propagation-status{margin-top:.5rem}
.propagation-bar{height:8px;border-radius:4px;background:var(--color-bg-secondary);overflow:hidden;margin-bottom:.75rem}
.propagation-fill{height:100%;border-radius:4px;transition:width .8s ease;background:var(--color-warning)}
.propagation-fill.propagated{background:var(--color-success)}
.propagation-text{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap;font-size:.85rem;margin-bottom:1rem}
.resolver-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:.75rem}
.resolver-card{border:1px solid var(--color-border);border-radius:var(--radius);padding:1rem;background:var(--color-bg-secondary);transition:all var(--transition)}
.resolver-card.match{border-left:3px solid var(--color-success)}
.resolver-card.mismatch{border-left:3px solid var(--color-error)}
.resolver-card.unknown{border-left:3px solid var(--color-text-tertiary)}
.resolver-header{display:flex;align-items:center;gap:.625rem;margin-bottom:.5rem}
.resolver-flag{font-size:1.5rem;line-height:1}
.resolver-info{flex:1;min-width:0}
.resolver-info strong{display:block;font-size:.85rem}
.resolver-ip{font-size:.7rem;color:var(--color-text-tertiary)}
.resolver-status{font-size:1.1rem;font-weight:700;flex-shrink:0}
.resolver-card.match .resolver-status{color:var(--color-success)}
.resolver-card.mismatch .resolver-status{color:var(--color-error)}
.resolver-answer{font-family:var(--font-mono);font-size:.8rem;color:var(--color-text-secondary);word-break:break-all;line-height:1.5}


/* --- Map Styles --- */
.leaflet-container {
  z-index: 1;
}
.custom-map-marker {
  background: transparent !important;
  border: none !important;
}

