/* ============================================
   RADIO CONTROL PANEL - THEME SYSTEM
   15 Beautiful Color Themes
   ============================================ */

/* ============================================
   THEME 1: MIDNIGHT PURPLE (Default)
   ============================================ */
[data-theme="midnight-purple"],
:root {
    --theme-primary: #6366f1;
    --theme-primary-light: #818cf8;
    --theme-primary-dark: #4f46e5;
    --theme-accent: #8b5cf6;
    --theme-bg-primary: #0f0f23;
    --theme-bg-secondary: #1a1a2e;
    --theme-bg-tertiary: #16213e;
    --theme-text-primary: #f8fafc;
    --theme-text-secondary: #94a3b8;
    --theme-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* ============================================
   THEME 2: OCEAN BLUE
   ============================================ */
[data-theme="ocean-blue"] {
    --theme-primary: #0ea5e9;
    --theme-primary-light: #38bdf8;
    --theme-primary-dark: #0284c7;
    --theme-accent: #06b6d4;
    --theme-bg-primary: #0c1929;
    --theme-bg-secondary: #0f2942;
    --theme-bg-tertiary: #123456;
    --theme-text-primary: #f0f9ff;
    --theme-text-secondary: #7dd3fc;
    --theme-gradient: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
}

/* ============================================
   THEME 3: EMERALD GREEN
   ============================================ */
[data-theme="emerald-green"] {
    --theme-primary: #10b981;
    --theme-primary-light: #34d399;
    --theme-primary-dark: #059669;
    --theme-accent: #14b8a6;
    --theme-bg-primary: #0a1f1a;
    --theme-bg-secondary: #0f2922;
    --theme-bg-tertiary: #134e3a;
    --theme-text-primary: #ecfdf5;
    --theme-text-secondary: #6ee7b7;
    --theme-gradient: linear-gradient(135deg, #10b981 0%, #14b8a6 100%);
}

/* ============================================
   THEME 4: SUNSET ORANGE
   ============================================ */
[data-theme="sunset-orange"] {
    --theme-primary: #f97316;
    --theme-primary-light: #fb923c;
    --theme-primary-dark: #ea580c;
    --theme-accent: #f59e0b;
    --theme-bg-primary: #1c1008;
    --theme-bg-secondary: #2a1a0f;
    --theme-bg-tertiary: #3d2615;
    --theme-text-primary: #fff7ed;
    --theme-text-secondary: #fdba74;
    --theme-gradient: linear-gradient(135deg, #f97316 0%, #f59e0b 100%);
}

/* ============================================
   THEME 5: ROSE PINK
   ============================================ */
[data-theme="rose-pink"] {
    --theme-primary: #f43f5e;
    --theme-primary-light: #fb7185;
    --theme-primary-dark: #e11d48;
    --theme-accent: #ec4899;
    --theme-bg-primary: #1a0a10;
    --theme-bg-secondary: #2a1520;
    --theme-bg-tertiary: #3d1f2e;
    --theme-text-primary: #fff1f2;
    --theme-text-secondary: #fda4af;
    --theme-gradient: linear-gradient(135deg, #f43f5e 0%, #ec4899 100%);
}

/* ============================================
   THEME 6: GOLDEN AMBER
   ============================================ */
[data-theme="golden-amber"] {
    --theme-primary: #f59e0b;
    --theme-primary-light: #fbbf24;
    --theme-primary-dark: #d97706;
    --theme-accent: #eab308;
    --theme-bg-primary: #1a1505;
    --theme-bg-secondary: #292010;
    --theme-bg-tertiary: #3d3015;
    --theme-text-primary: #fefce8;
    --theme-text-secondary: #fde047;
    --theme-gradient: linear-gradient(135deg, #f59e0b 0%, #eab308 100%);
}

/* ============================================
   THEME 7: CRIMSON RED
   ============================================ */
[data-theme="crimson-red"] {
    --theme-primary: #dc2626;
    --theme-primary-light: #ef4444;
    --theme-primary-dark: #b91c1c;
    --theme-accent: #e11d48;
    --theme-bg-primary: #1a0808;
    --theme-bg-secondary: #2a1212;
    --theme-bg-tertiary: #3d1818;
    --theme-text-primary: #fef2f2;
    --theme-text-secondary: #fca5a5;
    --theme-gradient: linear-gradient(135deg, #dc2626 0%, #e11d48 100%);
}

/* ============================================
   THEME 8: FOREST TEAL
   ============================================ */
[data-theme="forest-teal"] {
    --theme-primary: #14b8a6;
    --theme-primary-light: #2dd4bf;
    --theme-primary-dark: #0d9488;
    --theme-accent: #06b6d4;
    --theme-bg-primary: #0a1a18;
    --theme-bg-secondary: #0f2725;
    --theme-bg-tertiary: #134e4a;
    --theme-text-primary: #f0fdfa;
    --theme-text-secondary: #5eead4;
    --theme-gradient: linear-gradient(135deg, #14b8a6 0%, #06b6d4 100%);
}

/* ============================================
   THEME 9: ELECTRIC CYAN
   ============================================ */
[data-theme="electric-cyan"] {
    --theme-primary: #06b6d4;
    --theme-primary-light: #22d3ee;
    --theme-primary-dark: #0891b2;
    --theme-accent: #0ea5e9;
    --theme-bg-primary: #051518;
    --theme-bg-secondary: #0a2529;
    --theme-bg-tertiary: #0f3540;
    --theme-text-primary: #ecfeff;
    --theme-text-secondary: #67e8f9;
    --theme-gradient: linear-gradient(135deg, #06b6d4 0%, #0ea5e9 100%);
}

/* ============================================
   THEME 10: LAVENDER DREAM
   ============================================ */
[data-theme="lavender-dream"] {
    --theme-primary: #a855f7;
    --theme-primary-light: #c084fc;
    --theme-primary-dark: #9333ea;
    --theme-accent: #d946ef;
    --theme-bg-primary: #150a1f;
    --theme-bg-secondary: #22142e;
    --theme-bg-tertiary: #3b1f5d;
    --theme-text-primary: #faf5ff;
    --theme-text-secondary: #d8b4fe;
    --theme-gradient: linear-gradient(135deg, #a855f7 0%, #d946ef 100%);
}

/* ============================================
   THEME 11: NEON GREEN
   ============================================ */
[data-theme="neon-green"] {
    --theme-primary: #22c55e;
    --theme-primary-light: #4ade80;
    --theme-primary-dark: #16a34a;
    --theme-accent: #84cc16;
    --theme-bg-primary: #0a150a;
    --theme-bg-secondary: #102010;
    --theme-bg-tertiary: #1a3a1a;
    --theme-text-primary: #f0fdf4;
    --theme-text-secondary: #86efac;
    --theme-gradient: linear-gradient(135deg, #22c55e 0%, #84cc16 100%);
}

/* ============================================
   THEME 12: SLATE GRAY
   ============================================ */
[data-theme="slate-gray"] {
    --theme-primary: #64748b;
    --theme-primary-light: #94a3b8;
    --theme-primary-dark: #475569;
    --theme-accent: #71717a;
    --theme-bg-primary: #0f172a;
    --theme-bg-secondary: #1e293b;
    --theme-bg-tertiary: #334155;
    --theme-text-primary: #f8fafc;
    --theme-text-secondary: #cbd5e1;
    --theme-gradient: linear-gradient(135deg, #475569 0%, #64748b 100%);
}

/* ============================================
   THEME 13: ROYAL BLUE
   ============================================ */
[data-theme="royal-blue"] {
    --theme-primary: #2563eb;
    --theme-primary-light: #3b82f6;
    --theme-primary-dark: #1d4ed8;
    --theme-accent: #6366f1;
    --theme-bg-primary: #0a1020;
    --theme-bg-secondary: #0f1a35;
    --theme-bg-tertiary: #1e3a5f;
    --theme-text-primary: #eff6ff;
    --theme-text-secondary: #93c5fd;
    --theme-gradient: linear-gradient(135deg, #2563eb 0%, #6366f1 100%);
}

/* ============================================
   THEME 14: WARM CORAL
   ============================================ */
[data-theme="warm-coral"] {
    --theme-primary: #fb7185;
    --theme-primary-light: #fda4af;
    --theme-primary-dark: #f43f5e;
    --theme-accent: #f97316;
    --theme-bg-primary: #1c100f;
    --theme-bg-secondary: #2c1a18;
    --theme-bg-tertiary: #452725;
    --theme-text-primary: #fff1f2;
    --theme-text-secondary: #fecdd3;
    --theme-gradient: linear-gradient(135deg, #fb7185 0%, #f97316 100%);
}

/* ============================================
   THEME 15: DARK ABYSS (Pure Dark)
   ============================================ */
[data-theme="dark-abyss"] {
    --theme-primary: #a3a3a3;
    --theme-primary-light: #d4d4d4;
    --theme-primary-dark: #737373;
    --theme-accent: #525252;
    --theme-bg-primary: #000000;
    --theme-bg-secondary: #0a0a0a;
    --theme-bg-tertiary: #171717;
    --theme-text-primary: #fafafa;
    --theme-text-secondary: #a3a3a3;
    --theme-gradient: linear-gradient(135deg, #404040 0%, #262626 100%);
}

/* ============================================
   LIGHT THEMES
   ============================================ */

/* ============================================
   THEME 16: LIGHT CLEAN
   ============================================ */
[data-theme="light-clean"] {
    --theme-primary: #3b82f6;
    --theme-primary-light: #60a5fa;
    --theme-primary-dark: #2563eb;
    --theme-accent: #6366f1;
    --theme-bg-primary: #ffffff;
    --theme-bg-secondary: #f8fafc;
    --theme-bg-tertiary: #f1f5f9;
    --theme-text-primary: #0f172a;
    --theme-text-secondary: #475569;
    --theme-gradient: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    --theme-border-color: #e2e8f0;
    --theme-card-bg: #ffffff;
}

/* ============================================
   THEME 17: LIGHT LAVENDER
   ============================================ */
[data-theme="light-lavender"] {
    --theme-primary: #8b5cf6;
    --theme-primary-light: #a78bfa;
    --theme-primary-dark: #7c3aed;
    --theme-accent: #a855f7;
    --theme-bg-primary: #faf5ff;
    --theme-bg-secondary: #f3e8ff;
    --theme-bg-tertiary: #ede9fe;
    --theme-text-primary: #1e1b4b;
    --theme-text-secondary: #5b21b6;
    --theme-gradient: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%);
    --theme-border-color: #ddd6fe;
    --theme-card-bg: #ffffff;
}

/* ============================================
   THEME 18: LIGHT MINT
   ============================================ */
[data-theme="light-mint"] {
    --theme-primary: #10b981;
    --theme-primary-light: #34d399;
    --theme-primary-dark: #059669;
    --theme-accent: #14b8a6;
    --theme-bg-primary: #f0fdfa;
    --theme-bg-secondary: #ccfbf1;
    --theme-bg-tertiary: #d1fae5;
    --theme-text-primary: #134e4a;
    --theme-text-secondary: #0d9488;
    --theme-gradient: linear-gradient(135deg, #10b981 0%, #14b8a6 100%);
    --theme-border-color: #99f6e4;
    --theme-card-bg: #ffffff;
}

/* ============================================
   THEME 19: LIGHT ROSE
   ============================================ */
[data-theme="light-rose"] {
    --theme-primary: #f43f5e;
    --theme-primary-light: #fb7185;
    --theme-primary-dark: #e11d48;
    --theme-accent: #ec4899;
    --theme-bg-primary: #fff1f2;
    --theme-bg-secondary: #ffe4e6;
    --theme-bg-tertiary: #fecdd3;
    --theme-text-primary: #881337;
    --theme-text-secondary: #be123c;
    --theme-gradient: linear-gradient(135deg, #f43f5e 0%, #ec4899 100%);
    --theme-border-color: #fda4af;
    --theme-card-bg: #ffffff;
}

/* ============================================
   THEME 20: LIGHT OCEAN
   ============================================ */
[data-theme="light-ocean"] {
    --theme-primary: #0ea5e9;
    --theme-primary-light: #38bdf8;
    --theme-primary-dark: #0284c7;
    --theme-accent: #06b6d4;
    --theme-bg-primary: #f0f9ff;
    --theme-bg-secondary: #e0f2fe;
    --theme-bg-tertiary: #bae6fd;
    --theme-text-primary: #0c4a6e;
    --theme-text-secondary: #0369a1;
    --theme-gradient: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    --theme-border-color: #7dd3fc;
    --theme-card-bg: #ffffff;
}

/* ============================================
   LIGHT THEME OVERRIDES
   ============================================ */
[data-theme^="light-"] {
    --border-color: var(--theme-border-color, #e2e8f0);
    --bg-card: var(--theme-card-bg, #ffffff);
    --bg-glass: rgba(255, 255, 255, 0.8);
}

/* Light theme specific dropdown fix */
[data-theme^="light-"] select.form-control option {
    background-color: #ffffff !important;
    color: #0f172a !important;
}

/* Light theme sidebar adjustments */
[data-theme^="light-"] .sidebar {
    background: linear-gradient(180deg, var(--theme-bg-secondary) 0%, var(--theme-bg-tertiary) 100%) !important;
    border-right: 1px solid var(--theme-border-color);
}

[data-theme^="light-"] .sidebar-station-selector {
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: var(--theme-border-color);
}

[data-theme^="light-"] .sidebar-station-selector option {
    background-color: #ffffff !important;
    color: #0f172a !important;
}

[data-theme^="light-"] .sidebar-menu-link {
    color: var(--theme-text-primary) !important;
}

[data-theme^="light-"] .sidebar-menu-link:hover,
[data-theme^="light-"] .sidebar-menu-link.active {
    background: var(--theme-bg-tertiary) !important;
}

[data-theme^="light-"] .sidebar-section-title {
    color: var(--theme-text-secondary) !important;
}

[data-theme^="light-"] .sidebar-logo-text {
    color: var(--theme-text-primary) !important;
}

[data-theme^="light-"] .card {
    background: #ffffff !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-color: var(--theme-border-color);
}

[data-theme^="light-"] .card-header {
    border-bottom-color: var(--theme-border-color);
}

[data-theme^="light-"] .card-title {
    color: var(--theme-text-primary) !important;
}

[data-theme^="light-"] .form-control {
    background: #ffffff !important;
    color: var(--theme-text-primary) !important;
    border-color: var(--theme-border-color) !important;
}

[data-theme^="light-"] .form-label {
    color: var(--theme-text-primary) !important;
}

[data-theme^="light-"] .text-muted {
    color: var(--theme-text-secondary) !important;
}

[data-theme^="light-"] .dropdown-menu {
    background: #ffffff;
    border: 1px solid var(--theme-border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-theme^="light-"] .dropdown-item {
    color: var(--theme-text-primary) !important;
}

[data-theme^="light-"] .dropdown-item:hover {
    background: var(--theme-bg-tertiary);
}

[data-theme^="light-"] .navbar {
    background: var(--theme-bg-secondary) !important;
    border-bottom: 1px solid var(--theme-border-color);
}

[data-theme^="light-"] .main-content {
    background: var(--theme-bg-primary) !important;
}

[data-theme^="light-"] h1,
[data-theme^="light-"] h2,
[data-theme^="light-"] h3,
[data-theme^="light-"] h4,
[data-theme^="light-"] h5,
[data-theme^="light-"] h6 {
    color: var(--theme-text-primary) !important;
}

[data-theme^="light-"] .table th,
[data-theme^="light-"] .table td {
    border-color: var(--theme-border-color);
    color: var(--theme-text-primary);
}

[data-theme^="light-"] .badge {
    background: var(--theme-bg-tertiary);
    color: var(--theme-text-primary);
}

/* ============================================
   APPLY THEME VARIABLES
   ============================================ */
body {
    --primary-500: var(--theme-primary);
    --primary-400: var(--theme-primary-light);
    --primary-600: var(--theme-primary-dark);
    --accent-violet: var(--theme-accent);
    --bg-primary: var(--theme-bg-primary);
    --bg-secondary: var(--theme-bg-secondary);
    --bg-tertiary: var(--theme-bg-tertiary);
    --text-primary: var(--theme-text-primary);
    --text-secondary: var(--theme-text-secondary);
    --gradient-primary: var(--theme-gradient);
}

/* ============================================
   FIX DROPDOWN/SELECT COLORS
   ============================================ */
select.form-control,
select.form-control option {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

select.form-control option {
    padding: 10px;
    background-color: #1a1a2e !important;
    color: #f8fafc !important;
}

select.form-control option:hover,
select.form-control option:checked {
    background-color: var(--primary-500) !important;
    color: white !important;
}

/* For webkit browsers */
select.form-control::-webkit-scrollbar {
    width: 8px;
}

select.form-control::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

select.form-control::-webkit-scrollbar-thumb {
    background: var(--primary-500);
    border-radius: 4px;
}

/* ============================================
   THEME SELECTOR COMPONENT
   ============================================ */
.theme-selector {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.theme-option {
    position: relative;
    cursor: pointer;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.theme-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-option-preview {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.theme-option:hover .theme-option-preview {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.theme-option input:checked+.theme-option-preview {
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
}

.theme-option-preview::before {
    content: '';
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background: var(--theme-primary);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
}

.theme-option input:checked+.theme-option-preview::before {
    display: flex;
}

.theme-option-preview .preview-header {
    height: 30%;
    background: var(--preview-gradient);
}

.theme-option-preview .preview-body {
    flex: 1;
    background: var(--preview-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-option-name {
    text-align: center;
    font-size: 11px;
    margin-top: 6px;
    color: var(--text-secondary);
}

/* Individual theme previews */
.theme-option[data-theme="midnight-purple"] .preview-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.theme-option[data-theme="midnight-purple"] .preview-body {
    background: #0f0f23;
}

.theme-option[data-theme="ocean-blue"] .preview-header {
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
}

.theme-option[data-theme="ocean-blue"] .preview-body {
    background: #0c1929;
}

.theme-option[data-theme="emerald-green"] .preview-header {
    background: linear-gradient(135deg, #10b981 0%, #14b8a6 100%);
}

.theme-option[data-theme="emerald-green"] .preview-body {
    background: #0a1f1a;
}

.theme-option[data-theme="sunset-orange"] .preview-header {
    background: linear-gradient(135deg, #f97316 0%, #f59e0b 100%);
}

.theme-option[data-theme="sunset-orange"] .preview-body {
    background: #1c1008;
}

.theme-option[data-theme="rose-pink"] .preview-header {
    background: linear-gradient(135deg, #f43f5e 0%, #ec4899 100%);
}

.theme-option[data-theme="rose-pink"] .preview-body {
    background: #1a0a10;
}

.theme-option[data-theme="golden-amber"] .preview-header {
    background: linear-gradient(135deg, #f59e0b 0%, #eab308 100%);
}

.theme-option[data-theme="golden-amber"] .preview-body {
    background: #1a1505;
}

.theme-option[data-theme="crimson-red"] .preview-header {
    background: linear-gradient(135deg, #dc2626 0%, #e11d48 100%);
}

.theme-option[data-theme="crimson-red"] .preview-body {
    background: #1a0808;
}

.theme-option[data-theme="forest-teal"] .preview-header {
    background: linear-gradient(135deg, #14b8a6 0%, #06b6d4 100%);
}

.theme-option[data-theme="forest-teal"] .preview-body {
    background: #0a1a18;
}

.theme-option[data-theme="electric-cyan"] .preview-header {
    background: linear-gradient(135deg, #06b6d4 0%, #0ea5e9 100%);
}

.theme-option[data-theme="electric-cyan"] .preview-body {
    background: #051518;
}

.theme-option[data-theme="lavender-dream"] .preview-header {
    background: linear-gradient(135deg, #a855f7 0%, #d946ef 100%);
}

.theme-option[data-theme="lavender-dream"] .preview-body {
    background: #150a1f;
}

.theme-option[data-theme="neon-green"] .preview-header {
    background: linear-gradient(135deg, #22c55e 0%, #84cc16 100%);
}

.theme-option[data-theme="neon-green"] .preview-body {
    background: #0a150a;
}

.theme-option[data-theme="slate-gray"] .preview-header {
    background: linear-gradient(135deg, #475569 0%, #64748b 100%);
}

.theme-option[data-theme="slate-gray"] .preview-body {
    background: #0f172a;
}

.theme-option[data-theme="royal-blue"] .preview-header {
    background: linear-gradient(135deg, #2563eb 0%, #6366f1 100%);
}

.theme-option[data-theme="royal-blue"] .preview-body {
    background: #0a1020;
}

.theme-option[data-theme="warm-coral"] .preview-header {
    background: linear-gradient(135deg, #fb7185 0%, #f97316 100%);
}

.theme-option[data-theme="warm-coral"] .preview-body {
    background: #1c100f;
}

.theme-option[data-theme="dark-abyss"] .preview-header {
    background: linear-gradient(135deg, #404040 0%, #262626 100%);
}

.theme-option[data-theme="dark-abyss"] .preview-body {
    background: #000000;
}

/* Light theme previews */
.theme-option[data-theme="light-clean"] .preview-header {
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
}

.theme-option[data-theme="light-clean"] .preview-body {
    background: #ffffff;
}

.theme-option[data-theme="light-lavender"] .preview-header {
    background: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%);
}

.theme-option[data-theme="light-lavender"] .preview-body {
    background: #faf5ff;
}

.theme-option[data-theme="light-mint"] .preview-header {
    background: linear-gradient(135deg, #10b981 0%, #14b8a6 100%);
}

.theme-option[data-theme="light-mint"] .preview-body {
    background: #f0fdfa;
}

.theme-option[data-theme="light-rose"] .preview-header {
    background: linear-gradient(135deg, #f43f5e 0%, #ec4899 100%);
}

.theme-option[data-theme="light-rose"] .preview-body {
    background: #fff1f2;
}

.theme-option[data-theme="light-ocean"] .preview-header {
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
}

.theme-option[data-theme="light-ocean"] .preview-body {
    background: #f0f9ff;
}

/* Add border to all light theme previews so they're visible on dark backgrounds */
.theme-option[data-theme^="light-"] .theme-option-preview {
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.theme-option[data-theme^="light-"] input:checked+.theme-option-preview {
    border-color: var(--theme-primary);
}