/* ============================================================
   SiteAudit AI — style.css — Light theme
   ============================================================ */

:root {
  --bg:        #f5f3ef;
  --bg2:       #ffffff;
  --bg3:       #f0ede8;
  --border:    rgba(0,0,0,0.07);
  --border-m:  rgba(0,0,0,0.13);
  --text:      #1a1917;
  --text-2:    #6b6862;
  --text-3:    #a8a49f;
  --accent:    #2d6a2d;
  --accent-d:  #1f4d1f;
  --accent-bg: #e8f5e8;
  --good:      #1e7e3e;
  --warn:      #b85c00;
  --bad:       #c0392b;
  --info:      #1a5fa8;
  --radius:    10px;
  --radius-lg: 16px;
  --font-display: 'Fraunces', Georgia, serif;
  --font-mono:    'DM Mono', 'Courier New', monospace;
  --font-body:    system-ui, -apple-system, sans-serif;
  --max-w: 860px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* ─── HERO ─── */
.hero {
  position: relative;
  padding: 48px 0 56px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 500px 350px at 70% -10%, rgba(45,106,45,0.06) 0%, transparent 70%),
    radial-gradient(ellipse 400px 300px at 0% 120%, rgba(26,95,168,0.04) 0%, transparent 60%);
  pointer-events: none;
}

.logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 13px; color: var(--text-2);
  margin-bottom: 40px; letter-spacing: 0.04em;
}
.logo em { color: var(--accent); font-style: normal; }

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(38px, 7vw, 68px);
  font-weight: 300; line-height: 1.08;
  letter-spacing: -0.02em; color: var(--text);
  margin-bottom: 16px;
}
.hero-title em { font-style: italic; color: var(--accent); }

.hero-sub {
  font-size: 13px; color: var(--text-2);
  line-height: 1.9; margin-bottom: 32px;
  font-family: var(--font-mono);
}

/* ─── SEARCH CARD ─── */
.search-card {
  background: var(--bg2);
  border: 1px solid var(--border-m);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.search-inner { display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch; }

.url-input {
  flex: 1; min-width: 200px;
  background: var(--bg3);
  border: 1px solid var(--border-m);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-mono); font-size: 14px;
  padding: 12px 16px; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.url-input::placeholder { color: var(--text-3); }
.url-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(45,106,45,0.1); }

.run-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 24px;
  background: var(--accent); color: #fff;
  font-weight: 600; font-size: 14px;
  border: none; border-radius: var(--radius);
  cursor: pointer; white-space: nowrap;
  transition: background 0.2s, transform 0.1s;
}
.run-btn:hover { background: var(--accent-d); }
.run-btn:active { transform: scale(0.98); }
.run-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-spinner {
  width: 15px; height: 15px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  display: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-msg {
  margin-top: 12px; font-size: 13px;
  color: var(--bad); font-family: var(--font-mono);
  display: none; line-height: 1.5;
}

/* ─── LOADING ─── */
.loading-section { display: none; padding: 80px 0; text-align: center; }
.loading-inner { display: inline-flex; flex-direction: column; align-items: center; gap: 24px; }

.ai-pulse { position: relative; width: 72px; height: 72px; display: flex; align-items: center; justify-content: center; }

.pulse-ring {
  position: absolute; inset: 0;
  border: 1.5px solid var(--accent);
  border-radius: 50%; opacity: 0;
  animation: pulse 2s ease-out infinite;
}
.r2 { animation-delay: 0.7s; }

@keyframes pulse {
  0%   { transform: scale(0.5); opacity: 0.5; }
  100% { transform: scale(1.8); opacity: 0; }
}

.pulse-core {
  font-family: var(--font-mono); font-size: 16px; font-weight: 500;
  color: var(--accent); letter-spacing: 0.05em;
  background: var(--bg2); border: 1px solid var(--border-m);
  border-radius: 50%; width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 1;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.loading-msg {
  font-family: var(--font-mono); font-size: 13px;
  color: var(--text-2); min-height: 20px;
}

.loading-steps {
  display: flex; flex-direction: column; gap: 6px;
  text-align: left; min-width: 260px;
}

.loading-step {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--text-3); padding: 6px 10px;
  border-radius: var(--radius);
  transition: color 0.3s, background 0.3s;
}
.loading-step.active { color: var(--text); background: var(--bg2); box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.loading-step.done   { color: var(--good); }

.step-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-3); flex-shrink: 0;
  transition: background 0.3s;
}
.loading-step.active .step-dot { background: var(--accent); animation: blink 1s infinite; }
.loading-step.done   .step-dot { background: var(--good); animation: none; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }

/* ─── RESULTS ─── */
.results-section {
  display: none; padding: 48px 0 80px;
  animation: fadeUp 0.4s ease;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.result-meta {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--text-3); margin-bottom: 24px; flex-wrap: wrap;
}
.result-meta .sep { color: var(--border-m); }

/* ─── SUMMARY BAR ─── */
.summary-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px; margin-bottom: 36px;
}

.summary-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px; text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.summary-card:hover { border-color: var(--border-m); box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

.summary-score {
  font-family: var(--font-mono);
  font-size: 32px; font-weight: 500;
  line-height: 1; margin-bottom: 6px;
}
.summary-label {
  font-size: 11px; color: var(--text-2);
  font-family: var(--font-mono);
  letter-spacing: 0.06em; text-transform: uppercase;
}
.summary-badge {
  display: inline-block; margin-top: 6px;
  font-size: 10px; font-family: var(--font-mono);
  padding: 2px 8px; border-radius: 20px;
}
.badge-good { background: rgba(30,126,62,0.1);  color: var(--good); }
.badge-warn { background: rgba(184,92,0,0.1);   color: var(--warn); }
.badge-bad  { background: rgba(192,57,43,0.1);  color: var(--bad); }

/* ─── TABS ─── */
.tabs-bar {
  display: flex; border-bottom: 1px solid var(--border);
  margin-bottom: 32px; overflow-x: auto; scrollbar-width: none; gap: 0;
}
.tabs-bar::-webkit-scrollbar { display: none; }

.tab-btn {
  padding: 10px 16px; font-size: 12px;
  font-family: var(--font-mono); color: var(--text-3);
  background: transparent; border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer; white-space: nowrap;
  margin-bottom: -1px; letter-spacing: 0.03em;
  transition: color 0.15s, border-color 0.15s;
}
.tab-btn:hover { color: var(--text-2); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ─── TAB PANELS ─── */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─── AI CONTENT ─── */
.ai-content { display: flex; flex-direction: column; gap: 12px; }

.ai-section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  animation: fadeUp 0.3s ease;
}

.ai-section-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg3);
}

.ai-section-icon {
  width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
}

.icon-good    { background: rgba(30,126,62,0.12);  color: var(--good); }
.icon-warn    { background: rgba(184,92,0,0.12);   color: var(--warn); }
.icon-bad     { background: rgba(192,57,43,0.12);  color: var(--bad);  }
.icon-info    { background: rgba(26,95,168,0.12);  color: var(--info); }
.icon-neutral { background: rgba(0,0,0,0.05);      color: var(--text-2); }

.ai-section-title {
  font-size: 14px; font-weight: 500; color: var(--text); flex: 1;
}

.ai-section-status {
  font-family: var(--font-mono); font-size: 10px;
  padding: 3px 9px; border-radius: 20px;
}
.status-good { background: rgba(30,126,62,0.1);  color: var(--good); }
.status-warn { background: rgba(184,92,0,0.1);   color: var(--warn); }
.status-bad  { background: rgba(192,57,43,0.1);  color: var(--bad);  }
.status-info { background: rgba(26,95,168,0.1);  color: var(--info); }

.ai-section-body { padding: 16px 18px; }

.ai-section-body p {
  font-size: 14px; color: var(--text-2);
  line-height: 1.7; margin-bottom: 10px;
}
.ai-section-body p:last-child { margin-bottom: 0; }

.ai-section-body ul {
  list-style: none; display: flex;
  flex-direction: column; gap: 6px; margin-top: 4px;
}
.ai-section-body li {
  font-size: 13px; color: var(--text-2);
  line-height: 1.5; padding-left: 16px; position: relative;
}
.ai-section-body li::before {
  content: '→'; position: absolute; left: 0;
  color: var(--text-3); font-size: 11px; top: 2px;
}

.ai-section-body strong { color: var(--text); font-weight: 500; }
.ai-section-body code {
  font-family: var(--font-mono); font-size: 12px;
  background: var(--bg3); border: 1px solid var(--border);
  padding: 1px 6px; border-radius: 4px; color: var(--accent);
}

/* ─── ACTION ITEMS ─── */
.action-list { display: flex; flex-direction: column; gap: 8px; }
.action-item {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.action-priority {
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  padding: 3px 8px; border-radius: 20px; white-space: nowrap;
  flex-shrink: 0; margin-top: 1px;
  letter-spacing: 0.05em; text-transform: uppercase;
}
.priority-high   { background: rgba(192,57,43,0.1);  color: var(--bad); }
.priority-medium { background: rgba(184,92,0,0.1);   color: var(--warn); }
.priority-low    { background: rgba(30,126,62,0.1);  color: var(--good); }

.action-text { font-size: 13px; color: var(--text-2); line-height: 1.5; }
.action-text strong { color: var(--text); font-weight: 500; display: block; margin-bottom: 2px; }

/* ─── FOOTER ─── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  font-family: var(--font-mono); font-size: 12px; color: var(--text-3);
  background: var(--bg2);
}
.site-footer .container {
  display: flex; justify-content: space-between;
  align-items: center; gap: 12px; flex-wrap: wrap;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 600px) {
  .search-inner { flex-direction: column; }
  .run-btn { justify-content: center; }
  .summary-bar { grid-template-columns: repeat(2, 1fr); }
}
