/* Theme Variables */

/* Dark Theme (Default) */
:root[data-theme="dark"] {
  /* Background colors */
  --bg-primary: #0f0f1e;
  --bg-secondary: rgba(17, 17, 35, 0.7);
  --bg-tertiary: rgba(2, 6, 23, 0.4);
  --bg-panel: rgba(14, 21, 40, 0.7);
  --bg-card: rgba(30, 30, 50, 0.5);
  --bg-card-hover: rgba(30, 30, 50, 0.7);
  --bg-info-box: rgba(30, 30, 50, 0.6);
  --bg-control-panel: rgba(15, 23, 42, 0.75);
  --bg-control-panel: rgba(15, 23, 42, 0.75);
  --bg-lab-container: white;
  --bg-accent-subtle: rgba(99, 102, 241, 0.2);

  /* Text colors */
  --text-primary: #f8fafc;
  --text-secondary: rgba(248, 250, 252, 0.92);
  --text-tertiary: rgba(226, 232, 240, 0.85);
  --text-muted: rgba(203, 213, 225, 0.9);
  --text-hint: rgba(148, 163, 184, 0.9);
  --text-label: rgba(224, 231, 255, 0.8);

  /* Border colors */
  --border-primary: rgba(148, 163, 184, 0.12);
  --border-secondary: rgba(99, 102, 241, 0.25);
  --border-tertiary: rgba(99, 102, 241, 0.35);
  --border-accent: rgba(99, 102, 241, 0.4);

  /* Accent colors */
  --accent-primary: #6366f1;
  --accent-secondary: #ec4899;
  --accent-tertiary: #8b5cf6;
  --accent-positive: #34d399;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #ec4899 50%, #8b5cf6 100%);
  --gradient-subtle: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(236, 72, 153, 0.1) 100%);
  --gradient-panel: radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.25), rgba(15, 23, 42, 0.8));

  /* Shadows */
  --shadow-sm: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 15px 35px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 45px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 80px rgba(99, 102, 241, 0.15);

  /* Background effects */
  --bg-gradient-1: radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.15) 0%, transparent 50%);
  --bg-gradient-2: radial-gradient(circle at 80% 70%, rgba(236, 72, 153, 0.15) 0%, transparent 50%);
  --bg-gradient-3: radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
}

/* Light Theme */
:root[data-theme="light"] {
  /* Background colors */
  --bg-primary: #f8fafc;
  --bg-secondary: rgba(255, 255, 255, 0.95);
  --bg-tertiary: rgba(241, 245, 249, 0.8);
  --bg-panel: rgba(255, 255, 255, 0.9);
  --bg-card: rgba(255, 255, 255, 0.8);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --bg-info-box: rgba(249, 250, 251, 0.9);
  --bg-control-panel: rgba(249, 250, 251, 0.95);
  --bg-control-panel: rgba(249, 250, 251, 0.95);
  --bg-lab-container: white;
  --bg-accent-subtle: rgba(99, 102, 241, 0.1);

  /* Text colors */
  --text-primary: #0f172a;
  --text-secondary: #1e293b;
  --text-tertiary: #334155;
  --text-muted: #475569;
  --text-hint: #64748b;
  --text-label: #475569;

  /* Border colors */
  --border-primary: rgba(226, 232, 240, 0.8);
  --border-secondary: rgba(99, 102, 241, 0.3);
  --border-tertiary: rgba(99, 102, 241, 0.4);
  --border-accent: rgba(99, 102, 241, 0.5);

  /* Accent colors - same as dark */
  --accent-primary: #6366f1;
  --accent-secondary: #ec4899;
  --accent-tertiary: #8b5cf6;
  --accent-positive: #10b981;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #ec4899 50%, #8b5cf6 100%);
  --gradient-subtle: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(236, 72, 153, 0.08) 100%);
  --gradient-panel: radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.1), rgba(241, 245, 249, 0.95));

  /* Shadows */
  --shadow-sm: 0 8px 32px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 15px 35px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 20px 45px rgba(0, 0, 0, 0.15);
  --shadow-glow: 0 0 80px rgba(99, 102, 241, 0.08);

  /* Background effects */
  --bg-gradient-1: radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.06) 0%, transparent 50%);
  --bg-gradient-2: radial-gradient(circle at 80% 70%, rgba(236, 72, 153, 0.06) 0%, transparent 50%);
  --bg-gradient-3: radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.04) 0%, transparent 70%);
}

/* Theme Toggle Switch */
.theme-switch-wrapper {
  display: flex;
  align-items: center;
}

.theme-switch {
  display: inline-block;
  height: 26px;
  /* Slightly smaller than standard 34px for navbar */
  position: relative;
  width: 50px;
}

.theme-switch input {
  display: none;
}

.slider {
  background-color: var(--bg-tertiary);
  /* Darker background for the track */
  bottom: 0;
  cursor: pointer;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
  transition: .4s;
  border: 1px solid var(--border-secondary);
}

.slider:before {
  background-color: var(--text-primary);
  bottom: 3px;
  content: "";
  height: 18px;
  left: 4px;
  position: absolute;
  transition: .4s;
  width: 18px;
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

input:checked+.slider {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
}

input:checked+.slider:before {
  transform: translateX(22px);
  background-color: #fff;
  /* White knob when active */
}

/* Optional: Add icons inside the slider */
.slider:after {
  content: '☀️';
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  font-size: 12px;
  line-height: 1;
  opacity: 0.6;
}

input:checked+.slider:after {
  content: '🌙';
  left: 6px;
  right: auto;
  color: #fff;
  opacity: 1;
}

/* Smooth transitions for theme changes */
body,
.hero-section,
.site-header,
.nav-link,
.feature-card,
.journey-panel,
.path-card,
.metric-card,
.preview-card,
.info-box,
.site-footer,
.course-card,
.course-visual,
.panel,
.container,
.visual-card,
.theme-toggle {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* Disable transitions during initial load */
.preload * {
  transition: none !important;
}

/* Skeleton Loader Styles */
.skeleton-card {
  border: 1px solid var(--border-primary);
  background: var(--bg-card);
  pointer-events: none;
  min-height: 350px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  gap: 1rem;
}

.skeleton-visual {
  height: 140px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  animation: pulse 1.5s infinite ease-in-out;
  margin-bottom: 0.5rem;
}

.skeleton-text {
  background: var(--bg-tertiary);
  border-radius: 4px;
  animation: pulse 1.5s infinite ease-in-out;
}

.skeleton-text.title {
  height: 1.8rem;
  width: 70%;
}

.skeleton-text.line {
  height: 1rem;
  width: 100%;
}

.skeleton-text.line.short {
  width: 60%;
}

@keyframes pulse {
  0% {
    opacity: 0.4;
  }

  50% {
    opacity: 0.2;
  }

  100% {
    opacity: 0.4;
  }
}