/* ===== THEME SYSTEM ===== */

/* Light Theme (Default) */
[data-theme="light"] {
  --primary-color: #667eea;
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-color: #f093fb;
  --accent-color: #4facfe;
  
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #e2e8f0;
  --bg-glass: rgba(255, 255, 255, 0.25);
  --bg-modal: rgba(0, 0, 0, 0.5);
  
  --text-primary: #1a202c;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --text-white: #ffffff;
  
  --border-light: #e2e8f0;
  --border-medium: #cbd5e0;
  --border-dark: #a0aec0;
  
  --shadow-neumorphism: 20px 20px 60px #bebebe, -20px -20px 60px #ffffff;
}

/* Dark Theme */
[data-theme="dark"] {
  --primary-color: #818cf8;
  --primary-gradient: linear-gradient(135deg, #818cf8 0%, #c084fc 100%);
  --secondary-color: #f472b6;
  --accent-color: #60a5fa;
  
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --bg-glass: rgba(15, 23, 42, 0.8);
  --bg-modal: rgba(0, 0, 0, 0.8);
  
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-white: #ffffff;
  
  --border-light: #334155;
  --border-medium: #475569;
  --border-dark: #64748b;
  
  --shadow-neumorphism: 20px 20px 60px #0a0f1a, -20px -20px 60px #141f2a;
}

/* Ocean Theme */
[data-theme="ocean"] {
  --primary-color: #0ea5e9;
  --primary-gradient: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
  --secondary-color: #22d3ee;
  --accent-color: #67e8f9;
  
  --bg-primary: #f0f9ff;
  --bg-secondary: #e0f2fe;
  --bg-tertiary: #bae6fd;
  --bg-glass: rgba(240, 249, 255, 0.8);
  --bg-modal: rgba(14, 165, 233, 0.2);
  
  --text-primary: #0c4a6e;
  --text-secondary: #0369a1;
  --text-muted: #0284c7;
  --text-white: #ffffff;
  
  --border-light: #bae6fd;
  --border-medium: #7dd3fc;
  --border-dark: #38bdf8;
  
  --shadow-neumorphism: 20px 20px 60px #d1e7f5, -20px -20px 60px #ffffff;
}

/* Sunset Theme */
[data-theme="sunset"] {
  --primary-color: #f97316;
  --primary-gradient: linear-gradient(135deg, #f97316 0%, #dc2626 100%);
  --secondary-color: #fbbf24;
  --accent-color: #fb923c;
  
  --bg-primary: #fff7ed;
  --bg-secondary: #ffedd5;
  --bg-tertiary: #fed7aa;
  --bg-glass: rgba(255, 247, 237, 0.8);
  --bg-modal: rgba(249, 115, 22, 0.2);
  
  --text-primary: #9a3412;
  --text-secondary: #c2410c;
  --text-muted: #ea580c;
  --text-white: #ffffff;
  
  --border-light: #fed7aa;
  --border-medium: #fdba74;
  --border-dark: #fb923c;
  
  --shadow-neumorphism: 20px 20px 60px #e6d4c1, -20px -20px 60px #ffffff;
}

/* Forest Theme */
[data-theme="forest"] {
  --primary-color: #059669;
  --primary-gradient: linear-gradient(135deg, #059669 0%, #047857 100%);
  --secondary-color: #10b981;
  --accent-color: #34d399;
  
  --bg-primary: #f0fdf4;
  --bg-secondary: #dcfce7;
  --bg-tertiary: #bbf7d0;
  --bg-glass: rgba(240, 253, 244, 0.8);
  --bg-modal: rgba(5, 150, 105, 0.2);
  
  --text-primary: #14532d;
  --text-secondary: #166534;
  --text-muted: #15803d;
  --text-white: #ffffff;
  
  --border-light: #bbf7d0;
  --border-medium: #86efac;
  --border-dark: #4ade80;
  
  --shadow-neumorphism: 20px 20px 60px #d4e6d9, -20px -20px 60px #ffffff;
}

/* Purple Theme */
[data-theme="purple"] {
  --primary-color: #9333ea;
  --primary-gradient: linear-gradient(135deg, #9333ea 0%, #7c3aed 100%);
  --secondary-color: #a855f7;
  --accent-color: #c084fc;
  
  --bg-primary: #faf5ff;
  --bg-secondary: #f3e8ff;
  --bg-tertiary: #e9d5ff;
  --bg-glass: rgba(250, 245, 255, 0.8);
  --bg-modal: rgba(147, 51, 234, 0.2);
  
  --text-primary: #581c87;
  --text-secondary: #6b21a8;
  --text-muted: #7c2d92;
  --text-white: #ffffff;
  
  --border-light: #e9d5ff;
  --border-medium: #d8b4fe;
  --border-dark: #c084fc;
  
  --shadow-neumorphism: 20px 20px 60px #e1d4e6, -20px -20px 60px #ffffff;
}

/* Rose Theme */
[data-theme="rose"] {
  --primary-color: #e11d48;
  --primary-gradient: linear-gradient(135deg, #e11d48 0%, #be185d 100%);
  --secondary-color: #f43f5e;
  --accent-color: #fb7185;
  
  --bg-primary: #fff1f2;
  --bg-secondary: #ffe4e6;
  --bg-tertiary: #fecdd3;
  --bg-glass: rgba(255, 241, 242, 0.8);
  --bg-modal: rgba(225, 29, 72, 0.2);
  
  --text-primary: #881337;
  --text-secondary: #9f1239;
  --text-muted: #be123c;
  --text-white: #ffffff;
  
  --border-light: #fecdd3;
  --border-medium: #fda4af;
  --border-dark: #fb7185;
  
  --shadow-neumorphism: 20px 20px 60px #e6d1d4, -20px -20px 60px #ffffff;
}

/* Neon Theme */
[data-theme="neon"] {
  --primary-color: #00ff88;
  --primary-gradient: linear-gradient(135deg, #00ff88 0%, #00ccff 100%);
  --secondary-color: #ff0080;
  --accent-color: #ffff00;
  
  --bg-primary: #000011;
  --bg-secondary: #001122;
  --bg-tertiary: #002233;
  --bg-glass: rgba(0, 0, 17, 0.8);
  --bg-modal: rgba(0, 255, 136, 0.1);
  
  --text-primary: #00ff88;
  --text-secondary: #00ccff;
  --text-muted: #0099cc;
  --text-white: #ffffff;
  
  --border-light: #002233;
  --border-medium: #003344;
  --border-dark: #004455;
  
  --shadow-neumorphism: 20px 20px 60px #000008, -20px -20px 60px #00001a;
  
  /* Neon glow effects */
  --neon-glow: 0 0 5px currentColor, 0 0 10px currentColor, 0 0 15px currentColor;
}

[data-theme="neon"] .platform-btn.active,
[data-theme="neon"] .send-btn,
[data-theme="neon"] .start-btn {
  box-shadow: var(--neon-glow);
  text-shadow: var(--neon-glow);
}

[data-theme="neon"] .platform-icon {
  box-shadow: var(--neon-glow);
}

[data-theme="neon"] .message.sent .message-bubble {
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

/* Cyberpunk Theme */
[data-theme="cyberpunk"] {
  --primary-color: #ff2a6d;
  --primary-gradient: linear-gradient(135deg, #ff2a6d 0%, #05d9e8 100%);
  --secondary-color: #01012b;
  --accent-color: #05d9e8;
  
  --bg-primary: #01012b;
  --bg-secondary: #05091e;
  --bg-tertiary: #0a0e27;
  --bg-glass: rgba(1, 1, 43, 0.8);
  --bg-modal: rgba(255, 42, 109, 0.1);
  
  --text-primary: #05d9e8;
  --text-secondary: #ff2a6d;
  --text-muted: #a0a0a0;
  --text-white: #ffffff;
  
  --border-light: #0a0e27;
  --border-medium: #1a1e37;
  --border-dark: #2a2e47;
  
  --shadow-neumorphism: 20px 20px 60px #000015, -20px -20px 60px #020241;
  
  /* Cyberpunk glow effects */
  --cyber-glow-pink: 0 0 10px #ff2a6d, 0 0 20px #ff2a6d, 0 0 30px #ff2a6d;
  --cyber-glow-cyan: 0 0 10px #05d9e8, 0 0 20px #05d9e8, 0 0 30px #05d9e8;
}

[data-theme="cyberpunk"] .platform-btn.active {
  box-shadow: var(--cyber-glow-pink);
  text-shadow: 0 0 10px currentColor;
}

[data-theme="cyberpunk"] .send-btn {
  box-shadow: var(--cyber-glow-cyan);
}

[data-theme="cyberpunk"] .platform-icon {
  box-shadow: var(--cyber-glow-pink);
}

[data-theme="cyberpunk"] .message.sent .message-bubble {
  box-shadow: 0 0 15px rgba(255, 42, 109, 0.5);
}

[data-theme="cyberpunk"] .message.received .message-bubble {
  box-shadow: 0 0 15px rgba(5, 217, 232, 0.3);
}

/* Auto Theme (System Preference) */
@media (prefers-color-scheme: dark) {
  [data-theme="auto"] {
    --primary-color: #818cf8;
    --primary-gradient: linear-gradient(135deg, #818cf8 0%, #c084fc 100%);
    --secondary-color: #f472b6;
    --accent-color: #60a5fa;
    
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-glass: rgba(15, 23, 42, 0.8);
    --bg-modal: rgba(0, 0, 0, 0.8);
    
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-white: #ffffff;
    
    --border-light: #334155;
    --border-medium: #475569;
    --border-dark: #64748b;
    
    --shadow-neumorphism: 20px 20px 60px #0a0f1a, -20px -20px 60px #141f2a;
  }
}

@media (prefers-color-scheme: light) {
  [data-theme="auto"] {
    --primary-color: #667eea;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-color: #f093fb;
    --accent-color: #4facfe;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #e2e8f0;
    --bg-glass: rgba(255, 255, 255, 0.25);
    --bg-modal: rgba(0, 0, 0, 0.5);
    
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --text-white: #ffffff;
    
    --border-light: #e2e8f0;
    --border-medium: #cbd5e0;
    --border-dark: #a0aec0;
    
    --shadow-neumorphism: 20px 20px 60px #bebebe, -20px -20px 60px #ffffff;
  }
}

/* Theme Transition Effects */
* {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Theme-specific animations */
[data-theme="neon"] * {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, text-shadow 0.3s ease;
}

[data-theme="cyberpunk"] * {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, text-shadow 0.3s ease;
}

/* Theme selector styles */
.theme-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--spacing-sm);
  margin-top: var(--spacing-md);
}

.theme-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--spacing-md);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--bg-secondary);
}

.theme-option:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.theme-option.active {
  border-color: var(--primary-color);
  background: var(--primary-color);
  color: var(--text-white);
}

.theme-preview {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-sm);
  position: relative;
  overflow: hidden;
}

.theme-preview::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
}

.theme-preview::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
}

/* Theme preview colors */
.theme-option[data-theme="light"] .theme-preview::before { background: #667eea; }
.theme-option[data-theme="light"] .theme-preview::after { background: #f8fafc; }

.theme-option[data-theme="dark"] .theme-preview::before { background: #818cf8; }
.theme-option[data-theme="dark"] .theme-preview::after { background: #1e293b; }

.theme-option[data-theme="ocean"] .theme-preview::before { background: #0ea5e9; }
.theme-option[data-theme="ocean"] .theme-preview::after { background: #e0f2fe; }

.theme-option[data-theme="sunset"] .theme-preview::before { background: #f97316; }
.theme-option[data-theme="sunset"] .theme-preview::after { background: #ffedd5; }

.theme-option[data-theme="forest"] .theme-preview::before { background: #059669; }
.theme-option[data-theme="forest"] .theme-preview::after { background: #dcfce7; }

.theme-option[data-theme="purple"] .theme-preview::before { background: #9333ea; }
.theme-option[data-theme="purple"] .theme-preview::after { background: #f3e8ff; }

.theme-option[data-theme="rose"] .theme-preview::before { background: #e11d48; }
.theme-option[data-theme="rose"] .theme-preview::after { background: #ffe4e6; }

.theme-option[data-theme="neon"] .theme-preview::before { background: #00ff88; }
.theme-option[data-theme="neon"] .theme-preview::after { background: #000011; }

.theme-option[data-theme="cyberpunk"] .theme-preview::before { background: #ff2a6d; }
.theme-option[data-theme="cyberpunk"] .theme-preview::after { background: #01012b; }

.theme-option[data-theme="auto"] .theme-preview::before { background: linear-gradient(45deg, #667eea, #818cf8); }
.theme-option[data-theme="auto"] .theme-preview::after { background: linear-gradient(45deg, #f8fafc, #1e293b); }

.theme-name {
  font-size: 0.75rem;
  font-weight: 500;
  text-align: center;
}

