/* Theme System - CLI Knowledge Base */

/* ==================== DEFAULT THEME ==================== */
[data-theme="default"] {
  --bg-primary: #000000;
  --bg-secondary: #111111;
  --bg-tertiary: #222222;
  --text-primary: #ffffff;
  --text-secondary: #cccccc;
  --text-muted: #808080;
  --accent-primary: #ffffff;
  --accent-secondary: #4ecdc4;
  --accent-warning: #ffa726;
  --accent-error: #ff6b6b;
  --accent-success: #51cf66;
}

/* ==================== RETRO TERMINAL ==================== */
[data-theme="retro"] {
  --bg-primary: #001100;
  --bg-secondary: #002200;
  --bg-tertiary: #003300;
  --text-primary: #33ff33;
  --text-secondary: #22dd22;
  --text-muted: #116611;
  --accent-primary: #33ff33;
  --accent-secondary: #00ff00;
  --accent-warning: #ffff00;
  --accent-error: #ff3333;
  --accent-success: #00ff00;
}

/* ==================== CYBERPUNK ==================== */
[data-theme="cyberpunk"] {
  --bg-primary: #0a0e27;
  --bg-secondary: #16213e;
  --bg-tertiary: #1a1a2e;
  --text-primary: #00fff9;
  --text-secondary: #e94560;
  --text-muted: #7f5af0;
  --accent-primary: #ff00ff;
  --accent-secondary: #00fff9;
  --accent-warning: #fffc00;
  --accent-error: #e94560;
  --accent-success: #00ff41;
}

/* ==================== DRACULA ==================== */
[data-theme="dracula"] {
  --bg-primary: #282a36;
  --bg-secondary: #21222c;
  --bg-tertiary: #191a21;
  --text-primary: #f8f8f2;
  --text-secondary: #6272a4;
  --text-muted: #44475a;
  --accent-primary: #bd93f9;
  --accent-secondary: #8be9fd;
  --accent-warning: #ffb86c;
  --accent-error: #ff5555;
  --accent-success: #50fa7b;
}

/* ==================== NORD ==================== */
[data-theme="nord"] {
  --bg-primary: #2e3440;
  --bg-secondary: #3b4252;
  --bg-tertiary: #434c5e;
  --text-primary: #eceff4;
  --text-secondary: #d8dee9;
  --text-muted: #4c566a;
  --accent-primary: #88c0d0;
  --accent-secondary: #81a1c1;
  --accent-warning: #ebcb8b;
  --accent-error: #bf616a;
  --accent-success: #a3be8c;
}

/* ==================== GRUVBOX ==================== */
[data-theme="gruvbox"] {
  --bg-primary: #282828;
  --bg-secondary: #3c3836;
  --bg-tertiary: #504945;
  --text-primary: #ebdbb2;
  --text-secondary: #d5c4a1;
  --text-muted: #7c6f64;
  --accent-primary: #fabd2f;
  --accent-secondary: #83a598;
  --accent-warning: #fe8019;
  --accent-error: #fb4934;
  --accent-success: #b8bb26;
}

/* ==================== SOLARIZED DARK ==================== */
[data-theme="solarized-dark"] {
  --bg-primary: #002b36;
  --bg-secondary: #073642;
  --bg-tertiary: #586e75;
  --text-primary: #839496;
  --text-secondary: #93a1a1;
  --text-muted: #657b83;
  --accent-primary: #268bd2;
  --accent-secondary: #2aa198;
  --accent-warning: #cb4b16;
  --accent-error: #dc322f;
  --accent-success: #859900;
}

/* ==================== SOLARIZED LIGHT ==================== */
[data-theme="solarized-light"] {
  --bg-primary: #fdf6e3;
  --bg-secondary: #eee8d5;
  --bg-tertiary: #93a1a1;
  --text-primary: #657b83;
  --text-secondary: #586e75;
  --text-muted: #93a1a1;
  --accent-primary: #268bd2;
  --accent-secondary: #2aa198;
  --accent-warning: #cb4b16;
  --accent-error: #dc322f;
  --accent-success: #859900;
}

/* ==================== MATRIX ==================== */
[data-theme="matrix"] {
  --bg-primary: #000000;
  --bg-secondary: #001100;
  --bg-tertiary: #003300;
  --text-primary: #00ff41;
  --text-secondary: #008f11;
  --text-muted: #003b00;
  --accent-primary: #00ff41;
  --accent-secondary: #39ff14;
  --accent-warning: #00ff00;
  --accent-error: #ff0000;
  --accent-success: #00ff41;
}

/* ==================== MONOKAI ==================== */
[data-theme="monokai"] {
  --bg-primary: #272822;
  --bg-secondary: #3e3d32;
  --bg-tertiary: #49483e;
  --text-primary: #f8f8f2;
  --text-secondary: #cfcfc2;
  --text-muted: #75715e;
  --accent-primary: #f92672;
  --accent-secondary: #66d9ef;
  --accent-warning: #e6db74;
  --accent-error: #f92672;
  --accent-success: #a6e22e;
}

/* ==================== TOKYO NIGHT ==================== */
[data-theme="tokyo-night"] {
  --bg-primary: #1a1b26;
  --bg-secondary: #24283b;
  --bg-tertiary: #414868;
  --text-primary: #c0caf5;
  --text-secondary: #a9b1d6;
  --text-muted: #565f89;
  --accent-primary: #7aa2f7;
  --accent-secondary: #7dcfff;
  --accent-warning: #e0af68;
  --accent-error: #f7768e;
  --accent-success: #9ece6a;
}

/* ==================== CRT EFFECTS ==================== */
.crt-effect {
  position: relative;
}

.crt-effect::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%,
    rgba(0, 0, 0, 0.25) 50%
  );
  background-size: 100% 4px;
  z-index: 9999;
  pointer-events: none;
  animation: scanlines 8s linear infinite;
}

@keyframes scanlines {
  0% { background-position: 0 0; }
  100% { background-position: 0 100%; }
}

.crt-effect::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(18, 16, 16, 0.1);
  opacity: 0;
  z-index: 9998;
  pointer-events: none;
  animation: flicker 0.15s infinite;
}

@keyframes flicker {
  0% { opacity: 0.27861; }
  5% { opacity: 0.34769; }
  10% { opacity: 0.23604; }
  15% { opacity: 0.90626; }
  20% { opacity: 0.18128; }
  25% { opacity: 0.83891; }
  30% { opacity: 0.65583; }
  35% { opacity: 0.67807; }
  40% { opacity: 0.26559; }
  45% { opacity: 0.84693; }
  50% { opacity: 0.96019; }
  55% { opacity: 0.08594; }
  60% { opacity: 0.20313; }
  65% { opacity: 0.71988; }
  70% { opacity: 0.53455; }
  75% { opacity: 0.37288; }
  80% { opacity: 0.71428; }
  85% { opacity: 0.70419; }
  90% { opacity: 0.7003; }
  95% { opacity: 0.36108; }
  100% { opacity: 0.24387; }
}

/* ==================== GLOW EFFECTS ==================== */
.glow-text {
  text-shadow: 0 0 10px var(--accent-primary),
               0 0 20px var(--accent-primary),
               0 0 30px var(--accent-primary);
}

/* ==================== TRANSPARENCY ==================== */
body.transparent {
  background: rgba(0, 0, 0, 0.85) !important;
  backdrop-filter: blur(10px);
}

body.transparent .cli-window {
  background: rgba(0, 0, 0, 0.5) !important;
}

/* ==================== ERROR/SUCCESS COLORS ==================== */
.error-line {
  color: var(--accent-error);
  font-weight: bold;
}

.success-line {
  color: var(--accent-success);
  font-weight: bold;
}

.warning-line {
  color: var(--accent-warning);
  font-weight: bold;
}

.info-line {
  color: var(--accent-secondary);
}
