/* ============================================================
   TokenScout — Main Stylesheet
   Dark theme: near-black bg, teal/cyan accent, silver highlights
   ============================================================ */

/* ---- Reset & Variables ------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #0a0a0b;
  --surface:      #141416;
  --surface-2:    #1c1c1f;
  --surface-3:    #242428;
  --border:       #2a2a2f;
  --accent:       #00C2B8;
  --accent-dark:  #00a09a;
  --accent-glow:  rgba(0,194,184,.15);
  --silver:       #b0b4be;
  --silver-dark:  #787d88;
  --text:         #e8e9ec;
  --text-muted:   #8a8d97;
  --green:        #22c55e;
  --orange:       #f59e0b;
  --red:          #ef4444;
  --gray:         #6b7280;
  --radius:       12px;
  --radius-sm:    8px;
  --shadow:       0 4px 24px rgba(0,0,0,.5);
  --font:         'Inter', system-ui, -apple-system, sans-serif;
  --transition:   .2s ease;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

/* ---- Skip link -------------------------------------------- */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #000;
  padding: .5rem 1rem; border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-weight: 600; z-index: 9999;
}
.skip-link:focus { left: 0; }

/* ---- Typography ------------------------------------------- */
h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 700; line-height: 1.1; }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 600; }
h3 { font-size: 1.125rem; font-weight: 600; }
p  { color: var(--text-muted); }

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-dark); }

.accent { color: var(--accent); }

/* ---- Layout helpers --------------------------------------- */
.container { max-width: 1140px; margin: 0 auto; padding: 0 1.5rem; }
.section    { padding: 4rem 0; }

/* ---- Header ----------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,10,11,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; gap: 1.5rem;
  height: 68px;
}
.logo-link {
  display: flex; align-items: center; gap: .6rem;
  text-decoration: none; flex-shrink: 0;
}
.site-logo { width: 36px; height: 36px; object-fit: contain; border-radius: 50%; }
.site-name  { font-size: 1.25rem; font-weight: 700; color: var(--text); white-space: nowrap; }

.main-nav { display: flex; gap: 1.5rem; margin-left: auto; }
.main-nav a { color: var(--text-muted); font-size: .9rem; font-weight: 500; }
.main-nav a:hover { color: var(--text); }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: .25rem;
  margin-left: auto;
}
.nav-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--silver); border-radius: 2px; transition: var(--transition);
}

/* ---- Footer ----------------------------------------------- */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.footer-inner {
  display: flex; flex-direction: column; align-items: center;
  gap: 1rem; padding: 2.5rem 1.5rem; text-align: center;
}
.footer-brand { display: flex; align-items: center; gap: .5rem; }
.footer-nav   { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; }
.footer-nav a { color: var(--text-muted); font-size: .875rem; }
.footer-disclaimer { font-size: .8rem; max-width: 680px; color: var(--text-muted); }
.footer-copy  { font-size: .8rem; color: var(--silver-dark); }

/* ---- Buttons ---------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem; padding: .75rem 1.75rem;
  border-radius: 50px; font-weight: 600; font-size: .95rem;
  cursor: pointer; transition: all var(--transition); border: none;
  text-decoration: none; white-space: nowrap;
}
.btn-primary {
  background: var(--accent); color: #000;
  box-shadow: 0 0 20px var(--accent-glow);
}
.btn-primary:hover { background: var(--accent-dark); color: #000; box-shadow: 0 0 32px var(--accent-glow); transform: translateY(-1px); }
.btn-outline {
  background: transparent; color: var(--accent);
  border: 1.5px solid var(--accent);
}
.btn-outline:hover { background: var(--accent-glow); }
.btn-ghost { background: var(--surface-2); color: var(--text); }
.btn-ghost:hover { background: var(--surface-3); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ---- Forms ------------------------------------------------ */
.form-group { display: flex; flex-direction: column; gap: .5rem; }
.form-label { font-size: .875rem; font-weight: 500; color: var(--text-muted); }
.form-control {
  background: var(--surface-2); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: var(--font); font-size: 1rem;
  padding: .75rem 1rem; transition: border-color var(--transition);
  width: 100%;
}
.form-control:focus { outline: none; border-color: var(--accent); }
.form-control::placeholder { color: var(--silver-dark); }
select.form-control { appearance: none; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238a8d97' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; padding-right: 2.5rem; }

/* ---- Cards ------------------------------------------------ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.card-glass {
  background: rgba(20,20,22,.8);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.06);
}

/* ---- Homepage Hero ---------------------------------------- */
.hero {
  min-height: 85vh; display: flex; align-items: center;
  padding: 5rem 0 4rem;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(0,194,184,.08) 0%, transparent 70%);
}
.hero-content { text-align: center; max-width: 780px; margin: 0 auto; }
.hero-logo { width: 96px; height: 96px; object-fit: contain; margin-bottom: 1.5rem; filter: drop-shadow(0 0 24px rgba(0,194,184,.35)); }
.hero h1 { margin-bottom: 1rem; }
.hero p  { font-size: 1.125rem; max-width: 520px; margin: 0 auto 2.5rem; }

.scan-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  max-width: 680px; margin: 0 auto;
  box-shadow: var(--shadow);
}
.scan-row { display: flex; gap: .75rem; flex-wrap: wrap; }
.scan-row .form-control { flex: 1; min-width: 200px; }
.scan-row .btn { flex-shrink: 0; }
.chain-row { display: flex; gap: .75rem; align-items: center; margin-top: .75rem; }
.chain-row label { font-size: .85rem; color: var(--text-muted); white-space: nowrap; }
.chain-row select { flex: 1; }

/* ---- Loading Screen --------------------------------------- */
.loading-overlay {
  display: none; position: fixed; inset: 0; z-index: 500;
  background: rgba(10,10,11,.95);
  flex-direction: column; align-items: center; justify-content: center; gap: 1.5rem;
}
.loading-overlay.active { display: flex; }
.loading-logo { width: 72px; height: 72px; animation: pulse 1.5s ease-in-out infinite; }
.loading-spinner {
  width: 48px; height: 48px; border: 3px solid var(--surface-3);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 1s linear infinite;
}
.loading-msg { font-size: 1rem; color: var(--silver); text-align: center; min-height: 1.5em; }
.loading-steps { list-style: none; display: flex; flex-direction: column; gap: .4rem; }
.loading-steps li { font-size: .85rem; color: var(--text-muted); display: flex; align-items: center; gap: .5rem; }
.loading-steps li.done  { color: var(--green); }
.loading-steps li.active { color: var(--accent); }
.step-icon { width: 14px; height: 14px; flex-shrink: 0; }

@keyframes spin  { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }

/* ---- Features section ------------------------------------- */
.features { padding: 5rem 0; }
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-top: 3rem;
}
.feature-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  transition: border-color var(--transition);
}
.feature-card:hover { border-color: var(--accent); }
.feature-icon { font-size: 1.75rem; margin-bottom: .75rem; }
.feature-card h3 { margin-bottom: .5rem; }

/* ---- Report Page ------------------------------------------ */
.report-layout {
  display: grid; grid-template-columns: 1fr 300px; gap: 2rem;
  padding: 3rem 0;
  align-items: start;
}
.report-main { display: flex; flex-direction: column; gap: 1.5rem; }

/* Score card */
.score-card {
  background: linear-gradient(135deg, var(--surface) 0%, rgba(0,194,184,.06) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  display: flex; align-items: center; gap: 2rem; flex-wrap: wrap;
  position: relative; overflow: hidden;
}
.score-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.score-number {
  font-size: 4rem; font-weight: 700; line-height: 1;
  color: var(--accent); flex-shrink: 0;
}
.score-number span { font-size: 1.5rem; color: var(--text-muted); font-weight: 400; }
.score-info h2 { margin-bottom: .25rem; }
.score-info p  { margin: 0; }

/* Rating badge */
.rating-badge {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .35rem .9rem; border-radius: 50px; font-size: .8rem; font-weight: 600;
}
.rating-excellent  { background: rgba(34,197,94,.15);  color: var(--green);  border: 1px solid rgba(34,197,94,.3); }
.rating-low        { background: rgba(34,197,94,.1);   color: #4ade80;       border: 1px solid rgba(34,197,94,.2); }
.rating-moderate   { background: rgba(245,158,11,.12); color: var(--orange); border: 1px solid rgba(245,158,11,.3); }
.rating-high       { background: rgba(239,68,68,.12);  color: var(--red);    border: 1px solid rgba(239,68,68,.25); }
.rating-very-high  { background: rgba(239,68,68,.18);  color: #f87171;       border: 1px solid rgba(239,68,68,.35); }
.rating-avoid      { background: rgba(239,68,68,.25);  color: #fca5a5;       border: 1px solid rgba(239,68,68,.5); }
.rating-unknown    { background: rgba(107,114,128,.15); color: var(--gray);  border: 1px solid rgba(107,114,128,.3); }

/* Indicator cards */
.indicators-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
.indicator-card {
  background: var(--surface-2); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 1.25rem;
  display: flex; flex-direction: column; gap: .5rem;
  transition: border-color var(--transition);
}
.indicator-card.pass    { border-color: rgba(34,197,94,.35); }
.indicator-card.fail    { border-color: rgba(239,68,68,.35); }
.indicator-card.unknown { border-color: var(--border); }

.indicator-status {
  display: flex; align-items: center; gap: .4rem;
  font-size: .85rem; font-weight: 600;
}
.indicator-status.pass    { color: var(--green); }
.indicator-status.fail    { color: var(--red); }
.indicator-status.unknown { color: var(--gray); }
.indicator-label { font-size: .8rem; font-weight: 600; color: var(--text); }
.indicator-detail { font-size: .75rem; color: var(--text-muted); }

/* Summary section */
.summary-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
}
.summary-card p { color: var(--text); margin: 0; line-height: 1.7; }

/* Risk table */
.risk-table { width: 100%; border-collapse: collapse; }
.risk-table th, .risk-table td {
  padding: .85rem 1rem; text-align: left;
  border-bottom: 1px solid var(--border); font-size: .9rem;
}
.risk-table th { color: var(--text-muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.risk-table tr:last-child td { border-bottom: none; }
.risk-table td:last-child { text-align: right; }

/* Technical info (details/summary) */
details.tech-info summary {
  cursor: pointer; padding: 1rem 1.5rem;
  color: var(--accent); font-weight: 600; font-size: .9rem;
  list-style: none; display: flex; align-items: center; gap: .5rem;
}
details.tech-info summary::before { content: '▶'; font-size: .7rem; transition: transform var(--transition); }
details[open].tech-info summary::before { transform: rotate(90deg); }
.tech-table { width: 100%; border-collapse: collapse; }
.tech-table tr { border-top: 1px solid var(--border); }
.tech-table tr:first-child { border-top: none; }
.tech-table td { padding: .65rem 1.5rem; font-size: .85rem; }
.tech-table td:first-child { color: var(--text-muted); width: 45%; }
.tech-table td:last-child  { color: var(--text); word-break: break-all; }

/* Sidebar */
.report-sidebar { display: flex; flex-direction: column; gap: 1.25rem; }

/* Share button */
.share-btn {
  display: flex; align-items: center; gap: .5rem;
  width: 100%;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .75rem 1rem;
  color: var(--text); font-size: .875rem; font-weight: 500;
  cursor: pointer; transition: all var(--transition);
}
.share-btn:hover { border-color: var(--accent); color: var(--accent); }
.share-btn.copied { color: var(--green); border-color: var(--green); }

/* Disclaimer */
.disclaimer {
  background: rgba(245,158,11,.07);
  border: 1px solid rgba(245,158,11,.2);
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-size: .8rem;
  color: var(--orange);
  line-height: 1.5;
}

/* Section headers */
.section-header { margin-bottom: 1.25rem; }
.section-header h2 { font-size: 1.125rem; color: var(--text); }
.section-divider { border: none; border-top: 1px solid var(--border); margin: 0; }

/* ---- Static pages ----------------------------------------- */
.page-hero { padding: 4rem 0 3rem; text-align: center; }
.page-hero h1 { margin-bottom: .75rem; }
.page-content { max-width: 760px; margin: 0 auto; padding: 0 1.5rem 5rem; }
.page-content h2 { margin: 2.5rem 0 1rem; font-size: 1.25rem; }
.page-content p  { color: var(--text); margin-bottom: 1rem; }
.page-content ul { padding-left: 1.5rem; margin-bottom: 1rem; }
.page-content li { color: var(--text); margin-bottom: .4rem; }

/* ---- Ad slots --------------------------------------------- */
.ad-slot { display: flex; justify-content: center; align-items: center; padding: .75rem 0; }
.ad-placeholder {
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1px dashed var(--border);
  border-radius: var(--radius-sm); color: var(--silver-dark); font-size: .8rem;
}
/* Desktop sizes */
.ad-728x90  { width: 728px; height: 90px; }
.ad-320x50  { width: 320px; height: 50px; display: none; }
.ad-300x250 { width: 300px; height: 250px; }
/* Sidebar ad hidden on mobile */
.ad-sidebar-rect { display: flex; }

/* Error states */
.error-box {
  background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.25);
  border-radius: var(--radius); padding: 2rem; text-align: center;
  margin: 3rem auto; max-width: 520px;
}
.error-box h2 { color: var(--red); margin-bottom: .5rem; }

/* ---- Responsive ------------------------------------------- */
@media (max-width: 900px) {
  .report-layout { grid-template-columns: 1fr; }
  .report-sidebar { order: -1; }
  .ad-sidebar-rect { display: none; }
}

@media (max-width: 640px) {
  .main-nav { display: none; }
  .nav-toggle { display: flex; }
  .main-nav.open {
    display: flex; flex-direction: column;
    position: absolute; top: 68px; left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem; gap: .75rem; z-index: 99;
  }
  .scan-row { flex-direction: column; }
  .scan-row .btn { width: 100%; }
  .indicators-grid { grid-template-columns: 1fr 1fr; }
  .ad-728x90  { display: none; }
  .ad-320x50  { display: flex; }
  .score-card { flex-direction: column; gap: 1rem; }
}

@media (max-width: 420px) {
  .indicators-grid { grid-template-columns: 1fr; }
}
