/* =============================================
   AUDITA — index.css
   Styles for the main analysis page only
   ============================================= */

/* --- Landing Logo (animated, landing page only) --- */
.landing-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  opacity: 0;
  animation: fadeUp 0.4s 0.05s forwards;
}

.ll-hex {
  font-size: 22px;
  color: var(--accent);
  animation: hexPulse 3s ease-in-out infinite;
  filter: drop-shadow(0 0 6px var(--accent));
}

.ll-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 8px;
  text-transform: uppercase;
  text-shadow: 0 0 20px rgba(0,255,136,0.4);
}

.ll-cursor {
  font-family: 'JetBrains Mono', monospace;
  font-size: 26px;
  color: var(--accent);
  animation: blink 1s step-end infinite;
  margin-left: -4px;
  opacity: 0;
}
.ll-cursor.visible { opacity: 1; }

@keyframes hexPulse {
  0%, 100% { filter: drop-shadow(0 0 4px var(--accent)); transform: scale(1); }
  50%       { filter: drop-shadow(0 0 12px var(--accent)); transform: scale(1.08); }
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* --- Landing --- */
.landing {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  background: var(--bg);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.landing.hidden { opacity: 0; transform: translateY(-30px); pointer-events: none; }

.logo {
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 20px;
  opacity: 0;
  animation: fadeUp 0.5s 0.1s forwards;
}

.landing h1 {
  font-size: clamp(40px, 7vw, 80px);
  font-weight: 800;
  line-height: 1.0;
  text-align: center;
  margin-bottom: 16px;
  opacity: 0;
  animation: fadeUp 0.5s 0.2s forwards;
}
.landing h1 span { color: var(--accent); }

.landing p {
  color: var(--muted);
  font-size: 16px;
  margin-bottom: 48px;
  text-align: center;
  opacity: 0;
  animation: fadeUp 0.5s 0.3s forwards;
}

.input-row {
  display: flex;
  width: min(640px, 90vw);
  opacity: 0;
  animation: fadeUp 0.5s 0.4s forwards;
}

.input-row input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-right: none;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  padding: 16px 20px;
  outline: none;
  transition: border-color 0.2s;
  border-radius: 6px 0 0 6px;
}
.input-row input:focus { border-color: var(--accent); }
.input-row input::placeholder { color: var(--muted); }

.analyze-btn {
  background: var(--accent);
  color: #000;
  border: none;
  padding: 16px 28px;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  border-radius: 0 6px 6px 0;
}
.analyze-btn:hover { background: #00e87a; }
.analyze-btn:active { transform: scale(0.98); }
.analyze-btn:disabled { background: var(--muted); cursor: not-allowed; }

.error-msg {
  margin-top: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--bad);
  opacity: 0;
  transition: opacity 0.3s;
}
.error-msg.visible { opacity: 1; }

/* --- Loading --- */
.loading {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 200;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
.loading.active { display: flex; }

.loader-steps { display: flex; flex-direction: column; gap: 8px; width: 320px; }

.loader-step {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transition: opacity 0.3s, color 0.3s;
}
.loader-step.active { opacity: 1; }
.loader-step.done { opacity: 1; color: var(--accent); }
.loader-step .step-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

/* --- Report Shell --- */
.report { position: relative; z-index: 1; opacity: 0; display: none; transition: opacity 0.6s ease; }
.report.visible { opacity: 1; }

/* --- Report Header --- */
.report-header {
  border-bottom: 1px solid var(--border);
  padding: 16px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  background: rgba(10,10,15,0.95);
  backdrop-filter: blur(12px);
  z-index: 50;
  flex-wrap: wrap;
}

.report-logo { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--accent); letter-spacing: 3px; text-transform: uppercase; }
.repo-label { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--muted); background: var(--surface); border: 1px solid var(--border); padding: 6px 14px; border-radius: 4px; }
.repo-label span { color: var(--text); }
.header-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.hdr-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 7px 14px;
  font-family: 'Syne', sans-serif;
  font-size: 11px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  white-space: nowrap;
}
.hdr-btn:hover { border-color: var(--accent); color: var(--accent); }

/* --- Tabs --- */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 40px;
  background: var(--bg);
  position: sticky;
  top: 57px;
  z-index: 40;
}

.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  padding: 14px 20px;
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* --- Hero Score Section --- */
.hero { padding: 60px 40px 40px; display: grid; grid-template-columns: auto 1fr; gap: 60px; align-items: center; max-width: 1100px; margin: 0 auto; }

.score-ring { position: relative; width: 200px; height: 200px; flex-shrink: 0; }
.score-ring svg { transform: rotate(-90deg); width: 200px; height: 200px; }
.score-ring .bg-ring { fill: none; stroke: var(--surface2); stroke-width: 12; }
.score-ring .fill-ring { fill: none; stroke-width: 12; stroke-linecap: round; stroke-dasharray: 534; stroke-dashoffset: 534; transition: stroke-dashoffset 1.5s cubic-bezier(0.4,0,0.2,1), stroke 0.5s ease; }

.score-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.score-number { font-size: 52px; font-weight: 800; line-height: 1; }
.score-label { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--muted); letter-spacing: 2px; text-transform: uppercase; margin-top: 4px; }

.hero-info h2 { font-size: 32px; font-weight: 800; margin-bottom: 8px; }
.repo-desc { color: var(--muted); font-size: 15px; margin-bottom: 24px; line-height: 1.6; }
.hero-stats { display: flex; gap: 32px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-value { font-size: 22px; font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.stat-key { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }

.grade-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 16px; border-radius: 4px; font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 600; margin-bottom: 20px; }
.grade-dot { width: 6px; height: 6px; border-radius: 50%; animation: pulse 2s infinite; }

/* --- Categories --- */
.categories { padding: 0 40px 40px; max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }

.category-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 24px; transition: border-color 0.2s, transform 0.2s; opacity: 0; transform: translateY(20px); }
.category-card.animate { animation: cardIn 0.4s forwards; }
.category-card:hover { border-color: var(--accent); transform: translateY(-2px); }

.cat-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.cat-title { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: 1px; }
.cat-score { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--muted); }
.cat-score span { color: var(--text); font-weight: 600; }

.cat-bar-bg { height: 4px; background: var(--surface2); border-radius: 2px; margin-bottom: 20px; overflow: hidden; }
.cat-bar-fill { height: 100%; border-radius: 2px; width: 0; transition: width 1.2s cubic-bezier(0.4,0,0.2,1); }

.checks { display: flex; flex-direction: column; gap: 10px; }
.check-item { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; }

.check-icon { width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; flex-shrink: 0; margin-top: 1px; }
.check-icon.pass { background: rgba(0,255,136,0.15); color: var(--good); border: 1px solid rgba(0,255,136,0.3); }
.check-icon.fail { background: rgba(255,68,102,0.15); color: var(--bad); border: 1px solid rgba(255,68,102,0.3); }
.check-icon.warn { background: rgba(255,204,0,0.15); color: var(--warn); border: 1px solid rgba(255,204,0,0.3); }

.check-text { color: var(--text); line-height: 1.4; }
.check-text .check-sub { color: var(--muted); font-size: 11px; margin-top: 2px; font-family: 'JetBrains Mono', monospace; }

/* --- Suggestions --- */
.suggestions { padding: 0 40px 60px; max-width: 1100px; margin: 0 auto; }
.section-title { font-size: 11px; text-transform: uppercase; letter-spacing: 3px; color: var(--muted); margin-bottom: 16px; font-family: 'JetBrains Mono', monospace; }
.suggestion-list { display: flex; flex-direction: column; gap: 10px; }

.suggestion { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent3); padding: 14px 18px; border-radius: 0 6px 6px 0; font-size: 13px; line-height: 1.6; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.suggestion .priority { font-family: 'JetBrains Mono', monospace; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--accent3); background: rgba(255,107,53,0.1); padding: 2px 8px; border-radius: 3px; white-space: nowrap; }
.suggestion .s-text { flex: 1; }
.suggestion .learn-link { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--accent2); text-decoration: none; border: 1px solid rgba(0,136,255,0.3); padding: 2px 10px; border-radius: 3px; white-space: nowrap; transition: all 0.2s; }
.suggestion .learn-link:hover { background: rgba(0,136,255,0.1); }

.no-suggestions { font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--accent); padding: 16px; border: 1px solid rgba(0,255,136,0.2); border-radius: 6px; background: rgba(0,255,136,0.05); }

/* --- Analytics Tab --- */
.analytics { padding: 40px; max-width: 1100px; margin: 0 auto; }
.analytics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }

.analytics-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 24px; margin-bottom: 20px; }
.analytics-card h3 { font-size: 11px; text-transform: uppercase; letter-spacing: 3px; color: var(--muted); margin-bottom: 20px; font-family: 'JetBrains Mono', monospace; }

.lang-item { margin-bottom: 14px; }
.lang-header { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 13px; }
.lang-pct { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--muted); }
.lang-bar-bg { height: 6px; background: var(--surface2); border-radius: 3px; overflow: hidden; }
.lang-bar-fill { height: 100%; border-radius: 3px; width: 0; transition: width 1s ease; }

.contributor { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.contributor:last-child { border-bottom: none; }
.contrib-avatar { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--border); }
.contrib-name { font-weight: 600; font-size: 14px; }
.contrib-commits { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--muted); }
.contrib-badge { margin-left: auto; font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--accent); background: rgba(0,255,136,0.1); padding: 2px 8px; border-radius: 3px; }

.folder-tree { font-family: 'JetBrains Mono', monospace; font-size: 12px; line-height: 2; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 16px; }
.folder-item { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.folder-item.file { color: var(--text); }

.readme-content {
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text);
  max-height: 500px;
  overflow-y: auto;
  padding-right: 8px;
}
.readme-content::-webkit-scrollbar { width: 4px; }
.readme-content::-webkit-scrollbar-track { background: var(--surface2); }
.readme-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* --- PDF Overlay --- */
.pdf-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 500; align-items: center; justify-content: center; }
.pdf-overlay.active { display: flex; }
.pdf-box { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 32px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.pdf-box p { color: var(--muted); font-size: 14px; }
.pdf-spinner { width: 40px; height: 40px; border: 3px solid var(--surface2); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }

/* --- Loading Quotes --- */
.loader-quote {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  width: 320px;
  min-height: 16px;
  opacity: 0;
  transition: opacity 0.6s ease;
  letter-spacing: 0.5px;
}
.loader-quote.visible { opacity: 1; }

/* --- Shared link holding screen --- */
.shared-hold {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  opacity: 1;
  transition: opacity 0.5s ease;
}
.shared-hold.gone { opacity: 0; pointer-events: none; }
.shared-hold-logo {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 4px;
}
.shared-hold-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* --- Responsive --- */
@media (max-width: 700px) {
  .hero { grid-template-columns: 1fr; gap: 30px; padding: 40px 20px 20px; }
  .categories, .suggestions, .analytics { padding-left: 20px; padding-right: 20px; }
  .report-header { padding: 12px 20px; }
  .hero-stats { gap: 20px; }
  .analytics-grid { grid-template-columns: 1fr; }
  .tabs { padding: 0 20px; }
}