/**
 * Sports Alert V2 Theme System
 * Light/Dark mode CSS variables and toggle button styles
 */

/* ============================================
   CSS Variables - Light Theme (Premium Slate)
   ============================================ */
:root {
  /* Backgrounds - Cool slate tones for depth */
  --bg-primary: #f1f5f9;
  --bg-secondary: #e2e8f0;
  --bg-footer: #e2e8f0;
  --bg-card: rgba(226, 232, 240, 0.5);
  --bg-card-hover: rgba(226, 232, 240, 0.7);

  /* Header */
  --header-bg: rgba(241, 245, 249, 0.9);
  --header-border: rgba(0, 0, 0, 0.08);

  /* Text */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #64748b;
  --text-inverse: #ffffff;

  /* Borders */
  --border-color: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(0, 0, 0, 0.12);
  --border-light: rgba(0, 0, 0, 0.05);

  /* Accent Colors (consistent across themes) */
  --accent-indigo: #6366f1;
  --accent-purple: #8b5cf6;
  --accent-pink: #f472b6;
  --accent-gradient: linear-gradient(135deg, #818cf8 0%, #c084fc 50%, #f472b6 100%);

  /* Status Colors */
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;

  /* Shadows - More prominent for depth */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.12);

  /* Background Effects (light theme - subtle) */
  --orb-opacity: 0.2;
  --grid-opacity: 0.04;

  /* Input Fields */
  --input-bg: #ffffff;
  --input-border: rgba(0, 0, 0, 0.12);
  --input-focus-border: var(--accent-indigo);

  /* Feature icons */
  --feature-icon-bg: rgba(99, 102, 241, 0.12);
  --feature-icon-border: rgba(99, 102, 241, 0.25);

  /* Background effects - Light theme */
  --grid-line: rgba(0, 0, 0, 0.05);
  --orb-color-1: rgba(99, 102, 241, 0.1);
  --orb-color-2: rgba(139, 92, 246, 0.08);
  --glow-color: rgba(99, 102, 241, 0.15);

  /* Muted colors for light theme */
  --text-muted: #64748b;
  --text-faint: #94a3b8;
  --border-subtle: rgba(0, 0, 0, 0.06);
  --bg-subtle: rgba(0, 0, 0, 0.04);
  --bg-hover-subtle: rgba(0, 0, 0, 0.06);
}

/* ============================================
   CSS Variables - Dark Theme
   ============================================ */
[data-theme="dark"] {
  /* Backgrounds */
  --bg-primary: #050510;
  --bg-secondary: #0a0a14;
  --bg-footer: #0a0a12;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.05);

  /* Header */
  --header-bg: rgba(0, 0, 0, 0.4);
  --header-border: rgba(255, 255, 255, 0.05);

  /* Text */
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.6);
  --text-tertiary: rgba(255, 255, 255, 0.4);
  --text-inverse: #1a1a1a;

  /* Borders */
  --border-color: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.1);
  --border-light: rgba(255, 255, 255, 0.03);

  /* Shadows (darker for dark theme) */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);

  /* Background Effects (dark theme - more visible) */
  --orb-opacity: 0.3;
  --grid-opacity: 0.03;

  /* Input Fields */
  --input-bg: rgba(255, 255, 255, 0.05);
  --input-border: rgba(255, 255, 255, 0.1);
  --input-focus-border: var(--accent-indigo);

  /* Feature icons */
  --feature-icon-bg: rgba(99, 102, 241, 0.1);
  --feature-icon-border: rgba(99, 102, 241, 0.3);

  /* Background effects - Dark theme */
  --grid-line: rgba(255, 255, 255, 0.02);
  --orb-color-1: rgba(99, 102, 241, 0.08);
  --orb-color-2: rgba(168, 85, 247, 0.08);
  --glow-color: rgba(120, 119, 198, 0.15);

  /* Muted colors for dark theme */
  --text-muted: rgba(255, 255, 255, 0.5);
  --text-faint: rgba(255, 255, 255, 0.35);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --bg-subtle: rgba(255, 255, 255, 0.03);
  --bg-hover-subtle: rgba(255, 255, 255, 0.05);
}

/* ============================================
   Theme Toggle Button Styles
   ============================================ */
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: scale(1.05);
}

.theme-toggle:active {
  transform: scale(0.95);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
}

.theme-toggle:hover svg {
  transform: rotate(15deg);
}

/* ============================================
   Smooth Theme Transition
   ============================================ */
html {
  transition: background-color 0.3s ease, color 0.3s ease;
}

html.theme-transitioning,
html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
  transition: background-color 0.3s ease,
              border-color 0.3s ease,
              color 0.3s ease,
              box-shadow 0.3s ease !important;
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
  .theme-toggle {
    width: 36px;
    height: 36px;
  }

  .theme-toggle svg {
    width: 18px;
    height: 18px;
  }
}
