/**
 * Centralized Theme System for Stegawave
 * 
 * ALL COLOR CUSTOMIZATION IN ONE PLACE
 * Edit the CSS custom properties below to change the entire site's color scheme
 */

/* ============================================================================
   DARK THEME (DEFAULT)
   ============================================================================ */
:root,
[data-theme="dark"] {
  /* Background Colors */
  --bg-primary: #000000;
  --bg-secondary: #0a0a0a;
  --bg-tertiary: #1a1a1a;
  --bg-elevated: #020202;
  --bg-hover: #0f0f0f;
  --bg-input: transparent;
  --bg-overlay: rgba(0, 0, 0, 0.9);
  
  /* Text Colors */
  --text-primary: #ffffff;
  --text-secondary: #d0d0d0;
  --text-tertiary: #9e9e9e;
  --text-muted: #808080;
  --text-inverse: #000000;
  
  /* Accent Colors */
  --accent-primary: #39ff14;      /* Electric green - main accent */
  --accent-secondary: #0ddb0d;    /* Slightly darker green */
  --accent-tertiary: #33CC33;     /* Muted green for forms */
  --accent-hover: #2bff00;        /* Brighter green on hover */
  --accent-glow: rgba(57, 255, 20, 0.3);
  
  /* Accent RGBA for pipeline */
  --accent-primary-rgba-025: rgba(57, 255, 20, 0.25);
  --accent-primary-rgba-022: rgba(57, 255, 20, 0.22);
  --accent-primary-rgba-1: rgba(57, 255, 20, 1);
  --accent-primary-rgba-008: rgba(57, 255, 20, 0.08);
  
  /* Border Colors */
  --border-primary: #303030;
  --border-secondary: #2d2d2d;
  --border-tertiary: #4a4a4a;
  --border-subtle: #2a2a2a;
  --border-focus: var(--accent-primary);
  
  /* Status Colors */
  --status-success: #33CC33;
  --status-error: #ff0000;
  --status-error-alt: #e20909;
  --status-warning: #ffa500;
  --status-info: #39ff14;
  
  /* Shadows & Effects */
  --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 20px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px var(--accent-glow);
  
  /* Code Syntax Highlighting (Prism dark theme colors) */
  --code-bg: #1e1e1e;
  --code-text: #d4d4d4;
  --code-comment: #6a9955;
  --code-keyword: #569cd6;
  --code-string: #ce9178;
  --code-function: #dcdcaa;
}

/* ============================================================================
   LIGHT THEME
   ============================================================================ */
[data-theme="light"] {
  /* Background Colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f8f8;
  --bg-tertiary: #f0f0f0;
  --bg-elevated: #fafafa;
  --bg-hover: #e8e8e8;
  --bg-input: #ffffff;
  --bg-overlay: rgba(255, 255, 255, 0.95);
  
  /* Text Colors */
  --text-primary: #0a0a0a;
  --text-secondary: #2a2a2a;
  --text-tertiary: #4a4a4a;
  --text-muted: #666666;
  --text-inverse: #ffffff;
  
  /* Accent Colors */
  --accent-primary: #00aa00;      /* Darker green for visibility on light bg */
  --accent-secondary: #008800;
  --accent-tertiary: #007700;
  --accent-hover: #00cc00;
  --accent-glow: rgba(0, 170, 0, 0.15);
  
  /* Accent RGBA for pipeline */
  --accent-primary-rgba-025: rgba(0, 170, 0, 0.25);
  --accent-primary-rgba-022: rgba(0, 170, 0, 0.22);
  --accent-primary-rgba-1: rgba(0, 170, 0, 1);
  --accent-primary-rgba-008: rgba(0, 170, 0, 0.08);
  
  /* Border Colors */
  --border-primary: #d0d0d0;
  --border-secondary: #e0e0e0;
  --border-tertiary: #b0b0b0;
  --border-subtle: #e8e8e8;
  --border-focus: var(--accent-primary);
  
  /* Status Colors */
  --status-success: #00aa00;
  --status-error: #cc0000;
  --status-error-alt: #dd0000;
  --status-warning: #e68a00;
  --status-info: #0066cc;
  
  /* Shadows & Effects */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.15);
  --shadow-glow: 0 0 20px var(--accent-glow);
  
  /* Code Syntax Highlighting - Dark code blocks in light mode for contrast */
  --code-bg: #1e1e1e;
  --code-text: #d4d4d4;
  --code-comment: #6a9955;
  --code-keyword: #569cd6;
  --code-string: #ce9178;
  --code-function: #dcdcaa;
}

/* ============================================================================
   THEME TOGGLE BUTTON STYLES
   ============================================================================ */
.theme-toggle-btn {
  background: transparent;
  border: 1px solid #39ff14;
  color: #39ff14;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.theme-toggle-btn:hover {
  background: rgba(57, 255, 20, 0.1);
  border-color: #39ff14;
  color: #39ff14;
  transform: scale(1.05);
}

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

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

/* ============================================================================
   SMOOTH THEME TRANSITIONS
   ============================================================================ */
* {
  transition: background-color 0.2s ease, 
              border-color 0.2s ease, 
              color 0.2s ease,
              box-shadow 0.2s ease;
}

/* Disable transitions on elements that shouldn't animate */
*:is(input, textarea, select, [data-no-transition]) {
  transition: none;
}

/* ============================================================================
   UTILITY CLASSES FOR THEME-AWARE COMPONENTS
   ============================================================================ */

/* Apply to body or main containers */
.themed-bg {
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

.themed-bg-secondary {
  background-color: var(--bg-secondary);
}

.themed-bg-tertiary {
  background-color: var(--bg-tertiary);
}

/* Text utilities */
.themed-text-primary {
  color: var(--text-primary);
}

.themed-text-secondary {
  color: var(--text-secondary);
}

.themed-text-muted {
  color: var(--text-muted);
}

/* Force elements to stay white when the light theme is active */
.light-mode-white {
  color: var(--text-secondary);
}

[data-theme="light"] .light-mode-white {
  color: #ffffff;
}

/* Border utilities */
.themed-border {
  border-color: var(--border-primary);
}

.themed-border-secondary {
  border-color: var(--border-secondary);
}

/* Accent utilities */
.themed-accent {
  color: var(--accent-primary);
}

.themed-accent-bg {
  background-color: var(--accent-primary);
  color: var(--text-inverse);
}

/* Input/Form utilities */
.themed-input {
  background-color: var(--bg-input);
  border-color: var(--border-tertiary);
  color: var(--text-primary);
}

.themed-input:focus {
  border-color: var(--border-focus);
  outline: none;
}

/* Code block utilities */
.themed-code {
  background-color: var(--code-bg);
  color: var(--code-text);
}
