/* ===================================
   DARK MODE - CSS AWARDS READY
   Smooth transitions, perfect contrast
   =================================== */

/* CSS Variables for Light/Dark Mode */
:root {
    /* Light Mode Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    
    --text-primary: #1a1a1a;
    --text-secondary: #4a5568;
    --text-tertiary: #718096;
    
    --border-color: rgba(0, 0, 0, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.1);
    
    --card-bg: rgba(255, 255, 255, 0.95);
    --card-border: rgba(255, 255, 255, 0.2);
    
    /* Accent Colors (same in both modes) */
    --accent-blue: #0066CC;
    --accent-green: #00AA55;
    --accent-orange: #FF6600;
    
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #2d2d2d;
    
    --text-primary: #ffffff;
    --text-secondary: #cbd5e0;
    --text-tertiary: #a0aec0;
    
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.5);
    
    --card-bg: rgba(26, 26, 26, 0.95);
    --card-border: rgba(255, 255, 255, 0.1);
}

/* Apply Theme to Elements */
body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark Mode Toggle Button */
.theme-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient-primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px var(--shadow-color);
    z-index: 999;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 8px 30px var(--shadow-color);
}

.theme-toggle:active {
    transform: scale(0.95);
}

/* Sun and Moon Icons */
.theme-toggle svg {
    width: 28px;
    height: 28px;
    color: white;
    transition: all 0.3s ease;
}

.theme-toggle .sun-icon {
    display: block;
}

.theme-toggle .moon-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .sun-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    display: block;
}

/* Animate toggle on click */
.theme-toggle.toggling {
    animation: toggleSpin 0.6s ease;
}

@keyframes toggleSpin {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.2); }
    100% { transform: rotate(360deg) scale(1); }
}

/* ===================================
   DARK MODE STYLES FOR COMPONENTS
   =================================== */

/* Header */
.main-header {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
}

/* Cards */
.service-card,
.glass-card,
.team-member,
.feature-box {
    background: var(--card-bg);
    border-color: var(--card-border);
    color: var(--text-primary);
}

/* Text Elements */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
}

p {
    color: var(--text-secondary);
}

/* Links */
a {
    color: var(--text-primary);
}

a:hover {
    color: var(--accent-blue);
}

/* Inputs */
input, textarea, select {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-tertiary);
}

/* Hero Section Dark Mode */
[data-theme="dark"] .hero {
    background: linear-gradient(-45deg, #0a0a0a, #1a1a2e, #0f1729, #16213e);
}

/* Footer */
.main-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

/* Buttons remain vibrant in dark mode */
.btn-primary {
    background: var(--gradient-primary);
    color: white;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

/* Statistics */
.stat-item {
    background: var(--card-bg);
    border-color: var(--card-border);
}

/* Navigation */
.nav-menu > li > a {
    color: var(--text-primary);
}

.dropdown-menu {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

/* ===================================
   SMOOTH TRANSITIONS
   =================================== */

* {
    transition: background-color 0.3s ease, 
                color 0.3s ease, 
                border-color 0.3s ease,
                box-shadow 0.3s ease;
}

/* Exclude animations from transition */
*[class*="animate"],
*[class*="transition-"] {
    transition: all 0.3s ease !important;
}

/* ===================================
   DARK MODE ENHANCEMENTS
   =================================== */

/* Images adjust to dark mode */
[data-theme="dark"] img:not(.logo) {
    opacity: 0.9;
    filter: brightness(0.9);
    transition: opacity 0.3s ease, filter 0.3s ease;
}

[data-theme="dark"] img:not(.logo):hover {
    opacity: 1;
    filter: brightness(1);
}

/* Code blocks in dark mode */
[data-theme="dark"] pre,
[data-theme="dark"] code {
    background: var(--bg-tertiary);
    color: #a0aec0;
}

/* Shadows adjust in dark mode */
[data-theme="dark"] .shadow,
[data-theme="dark"] .card,
[data-theme="dark"] .service-card {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* Glassmorphism in dark mode */
[data-theme="dark"] .glass-card {
    background: rgba(26, 26, 26, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Custom scrollbar for dark mode */
[data-theme="dark"] ::-webkit-scrollbar {
    width: 10px;
    background: var(--bg-secondary);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 10px;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #3d3d3d;
}

/* Selection color in dark mode */
[data-theme="dark"] ::selection {
    background: rgba(102, 126, 234, 0.3);
    color: white;
}

/* ===================================
   ACCESSIBILITY
   =================================== */

/* Focus styles for dark mode */
[data-theme="dark"] *:focus-visible {
    outline-color: #667eea;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --text-primary: #000000;
        --bg-primary: #ffffff;
    }
    
    [data-theme="dark"] {
        --text-primary: #ffffff;
        --bg-primary: #000000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .theme-toggle,
    * {
        transition: none !important;
        animation: none !important;
    }
}

/* ===================================
   RESPONSIVE
   =================================== */

@media (max-width: 768px) {
    .theme-toggle {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
    
    .theme-toggle svg {
        width: 24px;
        height: 24px;
    }
}

/* ===================================
   PRINT STYLES
   =================================== */

@media print {
    .theme-toggle {
        display: none;
    }
    
    [data-theme="dark"] {
        --bg-primary: white;
        --text-primary: black;
    }
}
