/**
 * Theme Toggle Styles
 */

/* Smooth transitions für Theme-Wechsel */
* {
    transition: background-color 0.3s ease, 
                color 0.3s ease, 
                border-color 0.3s ease,
                box-shadow 0.3s ease;
}

/* Light Theme Variables */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-card: #ffffff;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    --border-color: #dee2e6;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    
    /* Angepasste Komponenten-Farben */
    --header-bg: #ffffff;
    --sidebar-bg: #f8f9fa;
    --input-bg: #ffffff;
    --code-bg: #f8f9fa;
    --hover-bg: rgba(0, 0, 0, 0.05);
}

/* Header spezifische Light Mode Anpassungen */
[data-theme="light"] header {
    background: #ffffff !important;
    border-bottom: 1px solid #dee2e6 !important;
}

[data-theme="light"] .header-content {
    background: #ffffff !important;
}

[data-theme="light"] nav a {
    color: #212529 !important;
}

[data-theme="light"] nav a:hover {
    color: #3b82f6 !important;
}

[data-theme="light"] nav a.active {
    color: #3b82f6 !important;
}

[data-theme="light"] .user-menu,
[data-theme="light"] .signin-dropdown {
    background: #ffffff !important;
}

[data-theme="light"] .dropdown-menu {
    background: #ffffff !important;
    border: 1px solid #dee2e6 !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
}

[data-theme="light"] .dropdown-menu a {
    color: #212529 !important;
}

[data-theme="light"] .dropdown-menu a:hover {
    background: #f8f9fa !important;
}

/* Dark Theme Variables (Default) */
[data-theme="dark"] {
    --bg-primary: #0a0e1a;
    --bg-secondary: #141824;
    --bg-card: #1c2333;
    --text-primary: #ffffff;
    --text-secondary: #b8c0d0;
    --text-muted: #808080;
    --border-color: #2a3142;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    
    /* Angepasste Komponenten-Farben */
    --header-bg: #141824;
    --sidebar-bg: #1c2333;
    --input-bg: #141824;
    --code-bg: #0a0e1a;
    --hover-bg: rgba(255, 255, 255, 0.05);
}

/* Theme Toggle Button */
.theme-toggle-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    position: relative;
}

.theme-toggle-btn:hover {
    background: var(--hover-bg);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.theme-toggle-btn i {
    font-size: 16px;
    transition: transform 0.3s ease;
}

.theme-toggle-btn:hover i {
    transform: rotate(20deg);
}

/* Erweiterter Theme-Selector (für Settings) */
.theme-selector-group {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.theme-option {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
}

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

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

.theme-option i {
    font-size: 24px;
    margin-bottom: 8px;
    display: block;
}

.theme-option span {
    font-size: 12px;
    font-weight: 500;
}

/* Theme Notification */
.theme-notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 12px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 10000;
    pointer-events: none;
}

.theme-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.theme-notification i {
    font-size: 18px;
    color: var(--accent-primary);
}

.theme-notification span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

/* Mini Theme Toggle (für Header) */
.theme-toggle-mini {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.theme-toggle-mini:hover {
    background: var(--hover-bg);
}

/* Theme-spezifische Anpassungen */
[data-theme="light"] .theme-toggle-mini {
    color: #f59e0b;
}

[data-theme="dark"] .theme-toggle-mini {
    color: #3b82f6;
}

/* Animationen für Theme-Icons */
@keyframes sunRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes moonWobble {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

[data-theme="light"] .theme-toggle-btn i.fa-sun {
    animation: sunRotate 20s linear infinite;
}

[data-theme="dark"] .theme-toggle-btn i.fa-moon {
    animation: moonWobble 3s ease-in-out infinite;
}

/* Responsive */
@media (max-width: 768px) {
    .theme-notification {
        bottom: 20px;
        right: 20px;
        left: 20px;
        justify-content: center;
    }
    
    .theme-selector-group {
        flex-direction: column;
    }
}

/* Spezielle Anpassungen für Komponenten */
[data-theme="light"] .card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .btn-primary {
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

[data-theme="light"] input,
[data-theme="light"] textarea,
[data-theme="light"] select {
    background: var(--input-bg);
    color: var(--text-primary);
}

/* Code-Blöcke */
[data-theme="light"] pre,
[data-theme="light"] code {
    background: var(--code-bg);
    color: var(--text-primary);
}

/* Scrollbar Anpassungen */
[data-theme="light"] ::-webkit-scrollbar-track {
    background: #f1f1f1;
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: #888;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--border-color);
}