/* Theme system with CSS custom properties */

/* Light theme (default) */
:root {
    --bg-color: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #f1f5f9 100%);
    --bg-solid: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-bg-hover: rgba(255, 255, 255, 0.9);
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.18);
    --text-color: #0f172a;
    --text-muted: #475569;
    --border-color: rgba(226, 232, 240, 0.5);
    --accent-color: #6366f1;
    --accent-hover: #4f46e5;
    --accent-bg: rgba(238, 242, 255, 0.6);
    --accent-text: #312e81;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-accent: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --tech-grid: rgba(100, 116, 139, 0.05);
}

/* Dark theme */
[data-theme="dark"] {
    --bg-color: linear-gradient(135deg, #0c0a1a 0%, #1e1b3a 50%, #0f172a 100%);
    --bg-solid: #0c0a1a;
    --card-bg: rgba(30, 27, 58, 0.6);
    --card-bg-hover: rgba(30, 27, 58, 0.8);
    --glass-bg: rgba(30, 27, 58, 0.25);
    --glass-border: rgba(148, 163, 184, 0.1);
    --text-color: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: rgba(71, 85, 105, 0.3);
    --accent-color: #818cf8;
    --accent-hover: #6366f1;
    --accent-bg: rgba(30, 58, 138, 0.4);
    --accent-text: #c7d2fe;
    --gradient-primary: linear-gradient(135deg, #818cf8 0%, #c084fc 100%);
    --gradient-accent: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --tech-grid: rgba(129, 140, 248, 0.08);
}

/* System preference detection */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-color: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
        --bg-solid: #0f172a;
        --card-bg: rgba(30, 41, 59, 0.8);
        --card-bg-solid: #1e293b;
        --text-color: #f1f5f9;
        --text-muted: #94a3b8;
        --border-color: #475569;
        --accent-color: #60a5fa;
        --accent-hover: #3b82f6;
        --accent-bg: linear-gradient(135deg, #1e3a8a 0%, #312e81 100%);
        --accent-bg-solid: #1e3a8a;
        --accent-text: #bfdbfe;
        --gradient-primary: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
        --gradient-accent: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    }
}

/* Smooth theme transitions */
*,
*::before,
*::after {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* Theme-specific adjustments */
[data-theme="dark"] .profile-image {
    border-color: var(--accent-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .nav-link:hover {
    background: #2563eb;
    border-color: var(--accent-color);
}

[data-theme="dark"] .phd-notice {
    background: var(--accent-bg);
    border-color: var(--accent-color);
    box-shadow: 0 0 20px rgba(96, 165, 250, 0.1);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000000;
        --text-color: #000000;
        --accent-color: #0000ff;
    }
    
    [data-theme="dark"] {
        --border-color: #ffffff;
        --text-color: #ffffff;
        --accent-color: #00ffff;
        --bg-color: #000000;
        --card-bg: #000000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .profile-image {
        animation: none;
    }
    
    .phd-notice {
        animation: none;
    }
}

/* Print theme */
@media print {
    :root {
        --bg-color: #ffffff;
        --card-bg: #ffffff;
        --text-color: #000000;
        --text-muted: #666666;
        --border-color: #cccccc;
        --accent-color: #000000;
        --accent-bg: #f5f5f5;
        --accent-text: #000000;
    }
    
    .theme-toggle {
        display: none !important;
    }
}

/* Theme toggle button states - removed conflicting pseudo-elements */

/* Theme transition for theme toggle button */
.theme-toggle {
    position: relative;
    overflow: hidden;
}

.theme-toggle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: var(--accent-color);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
    opacity: 0.1;
}

.theme-toggle:hover::before {
    width: 100%;
    height: 100%;
}

/* Alternative color schemes */
.theme-warm {
    --accent-color: #f59e0b;
    --accent-hover: #d97706;
    --accent-bg: #fef3c7;
    --accent-text: #92400e;
}

.theme-cool {
    --accent-color: #06b6d4;
    --accent-hover: #0891b2;
    --accent-bg: #cffafe;
    --accent-text: #155e75;
}

.theme-nature {
    --accent-color: #10b981;
    --accent-hover: #059669;
    --accent-bg: #d1fae5;
    --accent-text: #065f46;
}