/* ============================================================
   SEO Autopilot — Kinetic Observatory Design System
   Neutral cool gray (#191b1f), cyan accents (#96f8ff / #00F2FE),
   glassmorphism, no hard borders.
   ============================================================ */

/* ----- Root variables (dark = default) ----- */
:root {
  --bg-deep: #191b1f;
  --bg-surface: rgba(28, 30, 35, 0.88);
  --cyan-light: #96f8ff;
  --cyan: #00f2fe;
  --cyan-dim: rgba(0, 242, 254, 0.12);
  --cyan-glow: rgba(0, 242, 254, 0.20);
  --error: #ff4d6a;
  --warning: #ffb347;
  --success: #4ade80;
  --text-primary: #e4e5e9;
  --text-muted: #82858f;
  --sidebar-expanded: 256px;
  --sidebar-collapsed: 64px;

  /* Theme-aware tokens */
  --t-background: #191b1f;
  --t-surface: #1e2025;
  --t-surface-container: #24262c;
  --t-surface-container-high: #2a2c33;
  --t-surface-container-low: #1f2127;
  --t-surface-container-lowest: #151619;
  --t-surface-container-highest: #303239;
  --t-surface-dim: #191b1f;
  --t-surface-bright: #363840;
  --t-surface-variant: #2c2e35;
  --t-on-surface: #e4e5e9;
  --t-on-surface-variant: #9b9da6;
  --t-on-background: #e4e5e9;
  --t-outline: #787a83;
  --t-outline-variant: #484a52;
  --t-primary: #96f8ff;
  --t-primary-dim: #00e2ed;
  --t-primary-container: #00f1fd;
  --t-on-primary: #005f64;
  --t-on-primary-container: #00565a;
  --t-tertiary: #ac89ff;
  --t-tertiary-dim: #874cff;
  --t-tertiary-container: #7000ff;
  --t-secondary: #c4ddf7;
  --t-secondary-dim: #b6cfe8;
  --t-secondary-container: #31495e;
  --t-secondary-fixed: #68f7fe;
  --t-error: #ff716c;
  --t-error-dim: #d7383b;
  --t-error-container: #9f0519;
  --t-on-error: #490006;
  --t-on-error-container: #ffa8a3;
  --t-topbar-bg: rgba(25, 27, 31, 0.88);
  --t-card-bg: rgba(28, 30, 35, 0.88);
  --t-card-border: rgba(255, 255, 255, 0.08);
  --t-card-shadow: none;
  --t-scrollbar-thumb: rgba(255, 255, 255, 0.14);
  --t-scrollbar-thumb-hover: rgba(255, 255, 255, 0.24);
}

/* ----- Light theme overrides ----- */
[data-theme="light"] {
  --bg-deep: #f7f9fb;
  --bg-surface: #ffffff;
  --cyan-light: #0052d1;
  --cyan: #0052d1;
  --cyan-dim: rgba(0, 82, 209, 0.1);
  --cyan-glow: rgba(0, 82, 209, 0.15);
  --error: #ba1a1a;
  --warning: #e65100;
  --success: #00696d;
  --text-primary: #191c1e;
  --text-muted: #717786;

  --t-background: #f7f9fb;
  --t-surface: #f7f9fb;
  --t-surface-container: #eceef0;
  --t-surface-container-high: #e6e8ea;
  --t-surface-container-low: #f2f4f6;
  --t-surface-container-lowest: #ffffff;
  --t-surface-container-highest: #e0e3e5;
  --t-surface-dim: #d8dadc;
  --t-surface-bright: #f7f9fb;
  --t-surface-variant: #e0e3e5;
  --t-on-surface: #191c1e;
  --t-on-surface-variant: #414755;
  --t-on-background: #191c1e;
  --t-outline: #717786;
  --t-outline-variant: #c1c6d7;
  --t-primary: #0052d1;
  --t-primary-dim: #003fa4;
  --t-primary-container: #156aff;
  --t-on-primary: #ffffff;
  --t-on-primary-container: #fefcff;
  --t-tertiary: #4648d4;
  --t-tertiary-dim: #2f2ebe;
  --t-tertiary-container: #6063ee;
  --t-secondary: #00696d;
  --t-secondary-dim: #004f52;
  --t-secondary-container: #68f7fe;
  --t-secondary-fixed: #68f7fe;
  --t-error: #ba1a1a;
  --t-error-dim: #93000a;
  --t-error-container: #ffdad6;
  --t-on-error: #ffffff;
  --t-on-error-container: #93000a;
  --t-topbar-bg: rgba(255, 255, 255, 0.80);
  --t-card-bg: #ffffff;
  --t-card-border: transparent;
  --t-card-shadow: 0 1px 4px rgba(25, 28, 30, 0.05);
  --t-scrollbar-thumb: #c1c6d7;
  --t-scrollbar-thumb-hover: #a0a7b8;
}

/* ----- Glass panel ----- */
.glass-panel {
  background: var(--t-card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--t-card-border);
  border-radius: 12px;
  box-shadow: var(--t-card-shadow);
}
[data-theme="light"] .glass-panel {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* ----- Glow border ----- */
.glow-border {
  border: 1px solid var(--cyan-dim);
  box-shadow: 0 0 8px rgba(0, 242, 254, 0.06),
              inset 0 0 8px rgba(0, 242, 254, 0.02);
}
[data-theme="light"] .glow-border {
  border: 1px solid var(--t-outline-variant);
  box-shadow: 0 1px 4px rgba(25, 28, 30, 0.05);
}

/* ----- Glow text ----- */
.glow-text {
  color: var(--cyan-light);
  text-shadow: 0 0 6px rgba(0, 242, 254, 0.3),
               0 0 14px rgba(0, 242, 254, 0.12);
}
[data-theme="light"] .glow-text {
  color: var(--t-on-surface);
  text-shadow: none;
}

/* ----- Progress glow bars ----- */
.progress-glow-primary {
  background: linear-gradient(90deg, var(--cyan), var(--cyan-light));
  box-shadow: 0 0 6px var(--cyan-glow);
}

.progress-glow-secondary {
  background: linear-gradient(90deg, #a78bfa, #c4b5fd);
  box-shadow: 0 0 6px rgba(167, 139, 250, 0.20);
}

.progress-glow-tertiary {
  background: linear-gradient(90deg, var(--warning), #fcd34d);
  box-shadow: 0 0 6px rgba(255, 179, 71, 0.20);
}

.progress-glow-error {
  background: linear-gradient(90deg, var(--error), #f87171);
  box-shadow: 0 0 6px rgba(255, 77, 106, 0.20);
}

[data-theme="light"] .progress-glow-primary {
  background: linear-gradient(90deg, #0052d1, #156aff);
  box-shadow: none;
}
[data-theme="light"] .progress-glow-secondary {
  background: linear-gradient(90deg, #4648d4, #6063ee);
  box-shadow: none;
}
[data-theme="light"] .progress-glow-tertiary {
  background: linear-gradient(90deg, #e65100, #f57c00);
  box-shadow: none;
}
[data-theme="light"] .progress-glow-error {
  background: linear-gradient(90deg, #ba1a1a, #d32f2f);
  box-shadow: none;
}

/* ----- Buttons ----- */
.btn-cta {
  background: linear-gradient(135deg, #96f8ff, #00f1fd);
  color: #191b1f;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1.25rem;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.18);
  transition: box-shadow 0.2s, transform 0.15s;
}
.btn-cta:hover {
  box-shadow: 0 0 18px rgba(0, 242, 254, 0.30);
  transform: translateY(-1px);
}
[data-theme="light"] .btn-cta {
  background: linear-gradient(135deg, #0052d1, #156aff);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 82, 209, 0.25);
}
[data-theme="light"] .btn-cta:hover {
  box-shadow: 0 4px 16px rgba(0, 82, 209, 0.35);
}

.btn-ghost {
  background: transparent;
  color: var(--cyan);
  border: 1px solid var(--cyan-dim);
  border-radius: 8px;
  padding: 0.5rem 1.25rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.btn-ghost:hover {
  background: rgba(0, 242, 254, 0.06);
  border-color: var(--cyan);
}
[data-theme="light"] .btn-ghost {
  color: var(--t-primary);
  border-color: rgba(0, 82, 209, 0.2);
}
[data-theme="light"] .btn-ghost:hover {
  background: rgba(0, 82, 209, 0.06);
  border-color: var(--t-primary);
}

/* ----- Navigation ----- */
.nav-active {
  color: var(--cyan);
  background: var(--bg-surface);
  border-right: 3px solid var(--cyan);
}
[data-theme="light"] .nav-active {
  color: var(--t-primary);
  background: rgba(0, 82, 209, 0.06);
  border-right-color: var(--t-primary);
}

/* ----- Sidebar widths ----- */
.sidebar-expanded {
  width: var(--sidebar-expanded);
  transition: width 0.25s ease;
}
.sidebar-collapsed {
  width: var(--sidebar-collapsed);
  transition: width 0.25s ease;
}
.sidebar-collapsed .nav-label {
  display: none;
}

/* ----- Cmd+K modal ----- */
.cmdk-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 900;
  display: none;
}
[data-theme="light"] .cmdk-overlay {
  background: rgba(25, 28, 30, 0.3);
}
.cmdk-overlay.active {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 20vh;
}
.cmdk-panel {
  width: 540px;
  max-height: 420px;
  background: rgba(28, 30, 35, 0.96);
  border: 1px solid var(--cyan-dim);
  border-radius: 12px;
  box-shadow: 0 0 30px rgba(0, 242, 254, 0.08);
  overflow: hidden;
}
[data-theme="light"] .cmdk-panel {
  background: #ffffff;
  border: 1px solid var(--t-outline-variant);
  box-shadow: 0 12px 40px rgba(25, 28, 30, 0.12);
}

/* ----- Input focus glow ----- */
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 242, 254, 0.15);
}
[data-theme="light"] input:focus,
[data-theme="light"] textarea:focus,
[data-theme="light"] select:focus {
  border-color: var(--t-primary);
  box-shadow: 0 0 0 3px rgba(0, 82, 209, 0.12);
}

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

/* ----- Tabs ----- */
.tab-btn {
  padding: 0.5rem 1rem;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.tab-btn.active,
.tab-btn:hover {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
}
[data-theme="light"] .tab-btn.active,
[data-theme="light"] .tab-btn:hover {
  color: var(--t-primary);
  border-bottom-color: var(--t-primary);
}
.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}

/* ----- Nav group accordion ----- */
.nav-group-items {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.nav-group-items.expanded {
  max-height: 500px;
}

/* ----- Progress active pulse ----- */
@keyframes pulse-glow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
.progress-active {
  animation: pulse-glow 2s ease-in-out infinite;
}
