/* Theme Toggle Styles */
:root {
    /* Dark theme (default) */
    --primary-color: #00ffc3;
    --secondary-color: #00a3ff;
    --accent-color: #ff6b6b;
    --bg-dark: #0a0a0a;
    --bg-darker: #050505;
    --bg-light: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-muted: #666666;
    --border-color: #333333;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow-glow: 0 0 20px rgba(0, 255, 195, 0.3);
    --shadow-glow-blue: 0 0 20px rgba(0, 163, 255, 0.3);
    --card-bg: rgba(26, 26, 26, 0.8);
    --input-bg: rgba(26, 26, 26, 0.8);
    --modal-bg: rgba(10, 10, 10, 0.95);
    --tooltip-bg: rgba(10, 10, 10, 0.9);
}

/* Light theme */
[data-theme="light"] {
    --primary-color: #00a3ff;
    --secondary-color: #00ffc3;
    --accent-color: #ff6b6b;
    --bg-dark: #ffffff;
    --bg-darker: #f8f9fa;
    --bg-light: #f1f3f4;
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --text-muted: #6c757d;
    --border-color: #e9ecef;
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px rgba(0, 163, 255, 0.2);
    --shadow-glow-blue: 0 0 20px rgba(0, 255, 195, 0.2);
    --card-bg: rgba(255, 255, 255, 0.9);
    --input-bg: rgba(255, 255, 255, 0.9);
    --modal-bg: rgba(255, 255, 255, 0.95);
    --tooltip-bg: rgba(26, 26, 26, 0.9);
}

/* Theme toggle button */
.theme-toggle {
    position: relative;
    width: 50px;
    height: 26px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    padding: 2px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.theme-toggle:hover {
    box-shadow: var(--shadow-glow);
}

.theme-toggle::before {
    content: '🌙';
    position: absolute;
    left: 4px;
    font-size: 12px;
    transition: all 0.3s ease;
    opacity: 1;
}

.theme-toggle::after {
    content: '☀️';
    position: absolute;
    right: 4px;
    font-size: 12px;
    transition: all 0.3s ease;
    opacity: 0;
}

[data-theme="light"] .theme-toggle::before {
    opacity: 0;
}

[data-theme="light"] .theme-toggle::after {
    opacity: 1;
}

.theme-toggle-slider {
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    transition: all 0.3s ease;
    transform: translateX(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .theme-toggle-slider {
    transform: translateX(24px);
}

/* Theme transition for all elements */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
    
    .theme-toggle-slider {
        transition: none !important;
    }
}

/* Theme toggle in navbar */
.navbar .theme-toggle {
    margin-left: 15px;
}

/* Theme toggle in mobile menu */
@media (max-width: 768px) {
    .navbar .theme-toggle {
        margin: 10px 0;
        align-self: center;
    }
}

/* Theme toggle animation */
@keyframes themeSwitch {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.theme-toggle.switching {
    animation: themeSwitch 0.3s ease;
}

/* Theme-specific adjustments */
[data-theme="light"] body {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 50%, #dee2e6 100%);
}

[data-theme="light"] .navbar {
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

[data-theme="light"] .card,
[data-theme="light"] .service-card,
[data-theme="light"] .project-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .btn {
    border: 1px solid var(--border-color);
}

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

[data-theme="light"] .modal-content {
    background: var(--modal-bg);
    border: 1px solid var(--border-color);
}

/* Theme toggle tooltip */
.theme-toggle-container {
    position: relative;
}

.theme-toggle-container::after {
    content: 'Toggle theme';
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--tooltip-bg);
    color: var(--text-primary);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.theme-toggle-container:hover::after {
    opacity: 1;
}
