/* ─── Design Tokens ──────────────────────────────────────────────────────── */
:root {
  --bg:          #07080f;
  --bg-2:        #0d0f1e;
  --bg-card:     #111428;
  --border:      #1c2040;
  --border-2:    #2a305e;
  --accent:      #818cf8;
  --accent-2:    #a78bfa;
  --accent-glow: rgba(129,140,248,0.18);
  --text:        #e2e8f0;
  --text-2:      #94a3b8;
  --text-3:      #475569;
  --success:     #22c55e;
  --warning:     #f59e0b;
  --danger:      #ef4444;
  --radius:      10px;
  --radius-lg:   16px;
  --shadow:      0 4px 24px rgba(0,0,0,0.6);
  --shadow-lg:   0 8px 40px rgba(0,0,0,0.8);
  --font:        'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:   'JetBrains Mono', 'Fira Code', monospace;
  --sidebar-w:   264px;
  --transition:  0.2s ease;
}

/* ─── Reset & Base ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: var(--font); }
input, select, textarea { font-family: var(--font); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ─── Layout ─────────────────────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  transition: transform var(--transition);
}
#main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  padding: 2rem;
  max-width: 900px;
}

/* ─── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 1.5rem 1.25rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
  text-decoration: none;
  color: var(--text);
}
.sidebar-logo svg { flex-shrink: 0; }
.sidebar-logo-text { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.02em; }
.sidebar-logo-text span { color: var(--accent); }

.nav-section-label {
  font-size: 0.65rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-3);
  padding: 0.75rem 1.25rem 0.25rem;
}
nav ul { list-style: none; padding: 0 0.5rem 1rem; }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius);
  color: var(--text-2);
  font-size: 0.875rem; font-weight: 500;
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
}
.nav-link:hover { background: rgba(255,255,255,0.04); color: var(--text); text-decoration: none; }
.nav-link.active { background: var(--accent-glow); color: var(--accent); }
.nav-link .nav-icon { width: 18px; text-align: center; font-size: 1rem; flex-shrink: 0; }

.sidebar-footer {
  margin-top: auto; padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem; color: var(--text-3);
}
.sidebar-footer a { color: var(--text-3); }
.sidebar-footer a:hover { color: var(--accent); }
.sidebar-copyright {
  margin-top: 0.6rem; padding-top: 0.6rem;
  border-top: 1px solid var(--border);
  font-size: 0.7rem; color: var(--text-3);
}

/* ─── Mobile header ───────────────────────────────────────────────────────── */
#mobile-header {
  display: none; position: fixed;
  top: 0; left: 0; right: 0; height: 56px;
  background: var(--bg-2); border-bottom: 1px solid var(--border);
  z-index: 200; align-items: center; padding: 0 1rem; gap: 12px;
}
#menu-toggle { background: none; border: none; color: var(--text); font-size: 1.4rem; padding: 4px; }
.mobile-logo { font-weight: 700; font-size: 1rem; }
.mobile-logo span { color: var(--accent); }

/* ─── Page header ─────────────────────────────────────────────────────────── */
.panel-header {
  display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.75rem;
}
.panel-icon {
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--accent-glow);
  border: 1px solid rgba(129,140,248,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; flex-shrink: 0;
}
.panel-header h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 0.2rem; }
.panel-desc { color: var(--text-2); font-size: 0.875rem; line-height: 1.5; }

/* ─── Home ────────────────────────────────────────────────────────────────── */
.home-hero { margin-bottom: 2.5rem; }
.home-hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; margin-bottom: 0.75rem;
}
.home-hero h1 .accent { color: var(--accent); }
.home-hero p { color: var(--text-2); font-size: 1rem; line-height: 1.6; max-width: 580px; }
.badge-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }
.badge {
  font-size: 0.72rem; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  background: rgba(129,140,248,0.12); color: var(--accent);
  border: 1px solid rgba(129,140,248,0.25); letter-spacing: 0.04em;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.tool-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.25rem;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  text-decoration: none; color: inherit; display: block;
}
.tool-card:hover {
  border-color: var(--accent); transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(129,140,248,0.12); text-decoration: none;
}
.card-icon { font-size: 1.75rem; margin-bottom: 0.75rem; }
.card-title { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.3rem; }
.card-desc { font-size: 0.75rem; color: var(--text-2); line-height: 1.5; }

/* ─── Drop Zone ───────────────────────────────────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--border-2); border-radius: var(--radius-lg);
  padding: 2.5rem; text-align: center; cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  background: var(--bg-card); margin-bottom: 1.5rem;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--accent); background: var(--accent-glow);
}
.drop-zone-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.drop-zone p { color: var(--text-2); font-size: 0.9rem; margin-bottom: 0.5rem; }
.drop-zone small { color: var(--text-3); font-size: 0.78rem; }
.drop-zone input[type="file"] { display: none; }

/* ─── Options / Controls ──────────────────────────────────────────────────── */
.options-panel {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.25rem; margin-bottom: 1.25rem;
}
.options-panel h2 { font-size: 0.9rem; font-weight: 600; margin-bottom: 1rem; color: var(--text); }
.option-row { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.option-label { font-size: 0.85rem; color: var(--text-2); min-width: 130px; flex-shrink: 0; }
.option-value { font-size: 0.85rem; color: var(--accent); font-weight: 600; }

select, input[type="range"] {
  background: var(--bg-2); border: 1px solid var(--border-2);
  color: var(--text); border-radius: var(--radius); padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
}
select:focus, input[type="range"]:focus { border-color: var(--accent); outline: none; }
input[type="range"] { padding: 0; width: 160px; accent-color: var(--accent); }

.preset-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.preset-btn {
  background: var(--bg-2); border: 1px solid var(--border-2);
  color: var(--text-2); padding: 0.35rem 0.75rem;
  border-radius: var(--radius); font-size: 0.8rem; font-weight: 500;
  transition: all var(--transition);
}
.preset-btn:hover { border-color: var(--accent); color: var(--accent); }
.preset-btn.active { background: var(--accent-glow); border-color: var(--accent); color: var(--accent); }

/* ─── Action Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0.65rem 1.4rem; border-radius: var(--radius); font-size: 0.9rem;
  font-weight: 600; border: none; transition: all var(--transition); text-decoration: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); color: #fff; text-decoration: none; }
.btn-secondary { background: var(--bg-card); border: 1px solid var(--border-2); color: var(--text); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #16a34a; text-decoration: none; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; margin-bottom: 1.5rem; }

/* ─── Progress ────────────────────────────────────────────────────────────── */
.progress-wrap { display: none; margin-bottom: 1.25rem; }
.progress-wrap.visible { display: block; }
.progress-bar-bg {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 999px; height: 10px; overflow: hidden; margin-bottom: 0.4rem;
}
.progress-bar-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.3s ease; width: 0%;
}
.progress-label { font-size: 0.8rem; color: var(--text-2); }

/* ─── File info / Result ──────────────────────────────────────────────────── */
.file-info {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1rem 1.25rem;
  margin-bottom: 1.25rem; display: none;
}
.file-info.visible { display: block; }
.file-info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.75rem; }
.file-stat { display: flex; flex-direction: column; gap: 2px; }
.file-stat-label { font-size: 0.72rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; }
.file-stat-value { font-size: 0.9rem; font-weight: 600; }
.file-stat-value.green { color: var(--success); }
.file-stat-value.yellow { color: var(--warning); }
.file-stat-value.red { color: var(--danger); }

.result-panel {
  background: rgba(34,197,94,0.08); border: 1px solid rgba(34,197,94,0.25);
  border-radius: var(--radius-lg); padding: 1.25rem; margin-bottom: 1.5rem; display: none;
}
.result-panel.visible { display: block; }
.result-panel h3 { color: var(--success); font-size: 1rem; margin-bottom: 0.75rem; }

/* ─── SEO Content Sections ────────────────────────────────────────────────── */
.seo-section {
  margin-top: 2rem; padding: 1.25rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.seo-section + .seo-section { margin-top: 1rem; }
.seo-section h2 { font-size: 1.05rem; margin-bottom: 0.75rem; letter-spacing: -0.01em; }
.seo-section h3 { font-size: 0.95rem; margin-bottom: 0.5rem; margin-top: 1rem; color: var(--text); }
.seo-section p { color: var(--text-2); font-size: 0.9rem; line-height: 1.65; margin-bottom: 0.75rem; }
.seo-section p:last-child { margin-bottom: 0; }
.seo-list { margin: 0 0 0.9rem 1.1rem; }
.seo-list li { color: var(--text-2); margin-bottom: 0.5rem; line-height: 1.5; }
.seo-list strong { color: var(--text); }

/* ─── FAQ ─────────────────────────────────────────────────────────────────── */
.faq-list details {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.7rem 0.8rem; margin-bottom: 0.55rem;
}
.faq-list summary { cursor: pointer; color: var(--text); font-size: 0.88rem; font-weight: 600; }
.faq-list p { margin: 0.55rem 0 0; color: var(--text-2); font-size: 0.84rem; line-height: 1.6; }

/* ─── Comparison Table ────────────────────────────────────────────────────── */
.compare-table-wrap { overflow-x: auto; margin: 1rem 0; }
.compare-table {
  width: 100%; border-collapse: collapse; font-size: 0.85rem;
}
.compare-table th {
  background: var(--bg-2); color: var(--text); font-weight: 600;
  padding: 0.6rem 0.85rem; text-align: left; border-bottom: 2px solid var(--border-2);
}
.compare-table th:first-child { border-radius: 8px 0 0 0; }
.compare-table th:last-child { border-radius: 0 8px 0 0; }
.compare-table th.ours { color: var(--accent); }
.compare-table td { padding: 0.55rem 0.85rem; border-bottom: 1px solid var(--border); color: var(--text-2); }
.compare-table tr:last-child td { border-bottom: none; }
.compare-table tr:hover td { background: rgba(255,255,255,0.02); }
.compare-table .check { color: var(--success); font-weight: 700; }
.compare-table .cross { color: var(--danger); }
.compare-table .partial { color: var(--warning); }
.compare-table .ours-col { color: var(--accent); font-weight: 500; }

/* ─── Platform presets ────────────────────────────────────────────────────── */
.platform-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.75rem;
  margin: 1rem 0;
}
.platform-card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.85rem; text-align: center;
  cursor: pointer; transition: all var(--transition);
}
.platform-card:hover { border-color: var(--accent); background: var(--accent-glow); }
.platform-card.active { border-color: var(--accent); background: var(--accent-glow); }
.platform-icon { font-size: 1.6rem; margin-bottom: 0.4rem; }
.platform-name { font-size: 0.8rem; font-weight: 600; margin-bottom: 0.2rem; }
.platform-limit { font-size: 0.72rem; color: var(--text-3); }

/* ─── Cross-site banner ───────────────────────────────────────────────────── */
.cross-site-banner {
  display: flex; align-items: center; gap: 1rem;
  background: linear-gradient(135deg, rgba(20,184,166,0.08), rgba(129,140,248,0.08));
  border: 1px solid rgba(129,140,248,0.2); border-radius: var(--radius-lg);
  padding: 1rem 1.25rem; margin-top: 2rem; text-decoration: none; color: inherit;
  transition: all var(--transition);
}
.cross-site-banner:hover { border-color: var(--accent); text-decoration: none; }
.cross-site-icon { font-size: 1.75rem; flex-shrink: 0; }
.cross-site-text p { font-size: 0.85rem; color: var(--text-2); line-height: 1.5; }
.cross-site-text strong { color: var(--text); }

/* ─── Breadcrumb ──────────────────────────────────────────────────────────── */
.breadcrumb {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.78rem; color: var(--text-3); margin-bottom: 1.25rem;
}
.breadcrumb a { color: var(--text-3); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { color: var(--text-3); }

/* ─── Video preview ───────────────────────────────────────────────────────── */
.video-preview-wrap {
  background: #000; border-radius: var(--radius-lg); overflow: hidden;
  margin-bottom: 1.25rem; display: none; max-width: 100%;
}
.video-preview-wrap.visible { display: block; }
.video-preview-wrap video { width: 100%; max-height: 360px; display: block; }

/* ─── Trim range ──────────────────────────────────────────────────────────── */
.trim-timeline {
  position: relative; height: 48px; background: var(--bg-2);
  border: 1px solid var(--border); border-radius: var(--radius);
  margin: 0.75rem 0; overflow: hidden; cursor: pointer;
}
.trim-timeline-fill {
  position: absolute; top: 0; bottom: 0;
  background: rgba(129,140,248,0.2); border-left: 3px solid var(--accent);
  border-right: 3px solid var(--accent);
}

/* ─── Notification ────────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.75rem 1.25rem;
  font-size: 0.85rem; box-shadow: var(--shadow-lg); z-index: 999;
  animation: slideIn 0.25s ease; display: none;
}
.toast.visible { display: block; }
.toast.success { border-color: rgba(34,197,94,0.4); }
.toast.error { border-color: rgba(239,68,68,0.4); }
@keyframes slideIn { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ─── Loading state ───────────────────────────────────────────────────────── */
.loading-state {
  display: none; text-align: center; padding: 2rem; color: var(--text-2); font-size: 0.9rem;
}
.loading-state.visible { display: block; }
.spinner {
  width: 32px; height: 32px; border: 3px solid var(--border-2);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.8s linear infinite; margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Alternatives page specific ─────────────────────────────────────────── */
.alt-hero {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 2rem;
}
.alt-hero h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 0.5rem; }
.alt-hero p { color: var(--text-2); font-size: 0.92rem; line-height: 1.6; }
.quick-verdict {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.5rem 0;
}
.verdict-card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem;
}
.verdict-card h3 { font-size: 0.85rem; font-weight: 600; margin-bottom: 0.5rem; }
.verdict-card p { font-size: 0.82rem; color: var(--text-2); line-height: 1.5; }
.verdict-card.ours { border-color: rgba(129,140,248,0.35); }
.verdict-card.ours h3 { color: var(--accent); }

/* ─── CTA buttons ─────────────────────────────────────────────────────────── */
.cta-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.75rem;
  margin: 1.25rem 0;
}
.cta-btn {
  display: block; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.75rem 1rem; text-align: center;
  color: var(--text-2); font-size: 0.85rem; font-weight: 500;
  transition: all var(--transition); text-decoration: none;
}
.cta-btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.cta-btn.primary { background: var(--accent-glow); border-color: rgba(129,140,248,0.4); color: var(--accent); }

/* ─── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  #sidebar { transform: translateX(-100%); }
  #sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  #mobile-header { display: flex; }
  #main { margin-left: 0; padding: 1rem; padding-top: 72px; }
  .tools-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .quick-verdict { grid-template-columns: 1fr; }
  .platform-grid { grid-template-columns: repeat(3, 1fr); }
  .cta-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .compare-table { font-size: 0.78rem; }
  .compare-table th, .compare-table td { padding: 0.5rem 0.6rem; }
  .option-row { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
}
