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

/* Default Theme (Blue Ocean) */
:root {
    --primary-color: #0066cc;
    --secondary-color: #00a8e8;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --dark-bg: #1a1a2e;
    --card-bg: #16213e;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --border-color: #2a2a3e;
    --accent-glow: rgba(0, 168, 232, 0.3);
    --header-gradient-1: #0066cc;
    --header-gradient-2: #00a8e8;
    --theme-name: 'Blue Ocean';
}

/* Red Night Vision Theme - Für Nachtsegeln */
[data-theme="red-night"] {
    --primary-color: #8b0000;
    --secondary-color: #dc143c;
    --success-color: #ff6b6b;
    --danger-color: #ff4444;
    --warning-color: #ff8800;
    --dark-bg: #0a0000;
    --card-bg: #1a0505;
    --text-primary: #ffcccc;
    --text-secondary: #cc8888;
    --border-color: #330000;
    --accent-glow: rgba(220, 20, 60, 0.3);
    --header-gradient-1: #8b0000;
    --header-gradient-2: #dc143c;
    --theme-name: 'Red Night Vision';
}

/* Green Matrix Theme */
[data-theme="green-matrix"] {
    --primary-color: #00cc00;
    --secondary-color: #00ff00;
    --success-color: #00ff00;
    --danger-color: #ff4444;
    --warning-color: #ffff00;
    --dark-bg: #0a0f0a;
    --card-bg: #0d180d;
    --text-primary: #00ff00;
    --text-secondary: #00aa00;
    --border-color: #1a331a;
    --accent-glow: rgba(0, 255, 0, 0.3);
    --header-gradient-1: #00aa00;
    --header-gradient-2: #00ff00;
    --theme-name: 'Green Matrix';
}

/* Amber Sunset Theme */
[data-theme="amber-sunset"] {
    --primary-color: #ff6600;
    --secondary-color: #ff9933;
    --success-color: #00cc66;
    --danger-color: #ff3333;
    --warning-color: #ffcc00;
    --dark-bg: #1a0f00;
    --card-bg: #2a1a0a;
    --text-primary: #ffe6cc;
    --text-secondary: #cc9966;
    --border-color: #4d2600;
    --accent-glow: rgba(255, 153, 51, 0.3);
    --header-gradient-1: #ff6600;
    --header-gradient-2: #ff9933;
    --theme-name: 'Amber Sunset';
}

/* Purple Deep Sea Theme */
[data-theme="purple-deep"] {
    --primary-color: #6600cc;
    --secondary-color: #9933ff;
    --success-color: #00ff88;
    --danger-color: #ff4466;
    --warning-color: #ffaa00;
    --dark-bg: #0f0a1a;
    --card-bg: #1a0f2e;
    --text-primary: #e6ccff;
    --text-secondary: #b399cc;
    --border-color: #2d1a4d;
    --accent-glow: rgba(153, 51, 255, 0.3);
    --header-gradient-1: #6600cc;
    --header-gradient-2: #9933ff;
    --theme-name: 'Purple Deep';
}

/* Cyan Arctic Theme */
[data-theme="cyan-arctic"] {
    --primary-color: #00cccc;
    --secondary-color: #00ffff;
    --success-color: #00ff99;
    --danger-color: #ff5555;
    --warning-color: #ffcc33;
    --dark-bg: #0a1a1a;
    --card-bg: #0f2a2a;
    --text-primary: #ccffff;
    --text-secondary: #99cccc;
    --border-color: #1a4d4d;
    --accent-glow: rgba(0, 255, 255, 0.3);
    --header-gradient-1: #00aaaa;
    --header-gradient-2: #00ffff;
    --theme-name: 'Cyan Arctic';
}

/* High Contrast Theme - Für maximale Lesbarkeit */
[data-theme="high-contrast"] {
    --primary-color: #ffffff;
    --secondary-color: #ffff00;
    --success-color: #00ff00;
    --danger-color: #ff0000;
    --warning-color: #ffaa00;
    --dark-bg: #000000;
    --card-bg: #0a0a0a;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --border-color: #444444;
    --accent-glow: rgba(255, 255, 0, 0.4);
    --header-gradient-1: #333333;
    --header-gradient-2: #555555;
    --theme-name: 'High Contrast';
}

/* Golden Black Luxury Theme */
[data-theme="golden-luxury"] {
    --primary-color: #d4af37;
    --secondary-color: #ffd700;
    --success-color: #00ff88;
    --danger-color: #ff4444;
    --warning-color: #ffaa00;
    --dark-bg: #0a0a0a;
    --card-bg: #1a1a1a;
    --text-primary: #ffd700;
    --text-secondary: #b8860b;
    --border-color: #2a2a1a;
    --accent-glow: rgba(212, 175, 55, 0.4);
    --header-gradient-1: #8b7500;
    --header-gradient-2: #d4af37;
    --theme-name: 'Golden Luxury';
}

/* Theme Selector Styles */
.theme-selector-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-selector-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: white;
    transform: translateY(-2px);
}

.theme-icon {
    font-size: 1.2rem;
}

/* Theme Selector Modal */
.theme-modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
}

.theme-modal.active {
    display: flex;
}

.theme-modal-content {
    background: linear-gradient(135deg, var(--card-bg), var(--dark-bg));
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    max-width: 900px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 0 50px var(--accent-glow);
}

.theme-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.theme-modal-header h2 {
    color: var(--secondary-color);
    font-size: 2rem;
    margin: 0;
}

.theme-close-btn {
    background: var(--danger-color);
    color: white;
    border: none;
    font-size: 2rem;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-close-btn:hover {
    transform: rotate(90deg);
    background: #ff0000;
}

.themes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.theme-option {
    background: var(--card-bg);
    border: 3px solid var(--border-color);
    border-radius: 15px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.theme-option:hover {
    transform: translateY(-5px);
    border-color: var(--secondary-color);
    box-shadow: 0 10px 30px var(--accent-glow);
}

.theme-option.active {
    border-color: var(--success-color);
    box-shadow: 0 0 30px var(--accent-glow);
}

.theme-option.active::before {
    content: "✓";
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--success-color);
    color: var(--dark-bg);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.theme-name {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.theme-preview {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.theme-color-box {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.theme-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Theme-specific preview colors */
.theme-option[data-theme="blue-ocean"] .theme-color-box:nth-child(1) { background: #0066cc; }
.theme-option[data-theme="blue-ocean"] .theme-color-box:nth-child(2) { background: #00a8e8; }
.theme-option[data-theme="blue-ocean"] .theme-color-box:nth-child(3) { background: #28a745; }

.theme-option[data-theme="red-night"] .theme-color-box:nth-child(1) { background: #8b0000; }
.theme-option[data-theme="red-night"] .theme-color-box:nth-child(2) { background: #dc143c; }
.theme-option[data-theme="red-night"] .theme-color-box:nth-child(3) { background: #ff6b6b; }

.theme-option[data-theme="green-matrix"] .theme-color-box:nth-child(1) { background: #00cc00; }
.theme-option[data-theme="green-matrix"] .theme-color-box:nth-child(2) { background: #00ff00; }
.theme-option[data-theme="green-matrix"] .theme-color-box:nth-child(3) { background: #00ff00; }

.theme-option[data-theme="amber-sunset"] .theme-color-box:nth-child(1) { background: #ff6600; }
.theme-option[data-theme="amber-sunset"] .theme-color-box:nth-child(2) { background: #ff9933; }
.theme-option[data-theme="amber-sunset"] .theme-color-box:nth-child(3) { background: #00cc66; }

.theme-option[data-theme="purple-deep"] .theme-color-box:nth-child(1) { background: #6600cc; }
.theme-option[data-theme="purple-deep"] .theme-color-box:nth-child(2) { background: #9933ff; }
.theme-option[data-theme="purple-deep"] .theme-color-box:nth-child(3) { background: #00ff88; }

.theme-option[data-theme="cyan-arctic"] .theme-color-box:nth-child(1) { background: #00cccc; }
.theme-option[data-theme="cyan-arctic"] .theme-color-box:nth-child(2) { background: #00ffff; }
.theme-option[data-theme="cyan-arctic"] .theme-color-box:nth-child(3) { background: #00ff99; }

.theme-option[data-theme="high-contrast"] .theme-color-box:nth-child(1) { background: #ffffff; }
.theme-option[data-theme="high-contrast"] .theme-color-box:nth-child(2) { background: #ffff00; }
.theme-option[data-theme="high-contrast"] .theme-color-box:nth-child(3) { background: #00ff00; }

.theme-option[data-theme="golden-luxury"] .theme-color-box:nth-child(1) { background: #d4af37; }
.theme-option[data-theme="golden-luxury"] .theme-color-box:nth-child(2) { background: #ffd700; }
.theme-option[data-theme="golden-luxury"] .theme-color-box:nth-child(3) { background: #00ff88; }

/* Responsive */
@media (max-width: 768px) {
    .theme-modal-content {
        padding: 1.5rem;
        width: 95%;
    }

    .theme-modal-header h2 {
        font-size: 1.5rem;
    }

    .themes-grid {
        grid-template-columns: 1fr;
    }

    .theme-selector-btn {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
    }

    .theme-icon {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .theme-modal-content {
        padding: 1rem;
    }

    .theme-modal-header h2 {
        font-size: 1.2rem;
    }

    .theme-name {
        font-size: 1.1rem;
    }

    .theme-preview {
        gap: 0.3rem;
    }

    .theme-color-box {
        width: 30px;
        height: 30px;
    }
}
