/* ==================== THEME ENHANCEMENTS CSS ==================== */
/* Advanced styling for both Light and Dark modes */

/* ==================== SMOOTH PAGE TRANSITIONS ==================== */
* {
    transition-property: background-color, color, border-color, box-shadow, transform;
    transition-duration: 0.3s;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Preserve specific animations */
*[class*="animate"],
*[class*="transition"],
.loading,
.spinner {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== LIGHT MODE ENHANCEMENTS ==================== */

/* Light Mode - Enhanced Shadows */
body.light-theme .card,
body.light-theme .course-card,
body:not(.dark-theme) .card,
body:not(.dark-theme) .course-card {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.light-theme .card:hover,
body.light-theme .course-card:hover,
body:not(.dark-theme) .card:hover,
body:not(.dark-theme) .course-card:hover {
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

/* Light Mode - Buttons */
body.light-theme .btn-primary,
body:not(.dark-theme) .btn-primary {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

body.light-theme .btn-primary:hover,
body:not(.dark-theme) .btn-primary:hover {
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
}

/* Light Mode - Inputs */
body.light-theme input:focus,
body.light-theme textarea:focus,
body.light-theme select:focus,
body:not(.dark-theme) input:focus,
body:not(.dark-theme) textarea:focus,
body:not(.dark-theme) select:focus {
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* ==================== GLASSMORPHISM EFFECTS ==================== */

/* Glass effect for modals and dropdowns */
.modal,
.dropdown-menu,
.tooltip {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

body.light-theme .modal,
body.light-theme .dropdown-menu,
body:not(.dark-theme) .modal,
body:not(.dark-theme) .dropdown-menu {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

html.dark-theme .modal,
html.dark-theme .dropdown-menu,
body.dark-theme .modal,
body.dark-theme .dropdown-menu {
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(96, 165, 250, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

/* ==================== HERO SECTION ENHANCEMENTS ==================== */

.hero {
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 50%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

html.dark-theme .hero::before,
body.dark-theme .hero::before {
    background: radial-gradient(circle at 30% 50%, rgba(96, 165, 250, 0.2) 0%, transparent 50%);
}

/* ==================== INTERACTIVE ELEMENTS ==================== */

/* Enhanced link hover */
a:not(.btn):not(.nav-link):not(.social-link) {
    position: relative;
    transition: color 0.3s ease;
}

a:not(.btn):not(.nav-link):not(.social-link)::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: currentColor;
    transition: width 0.3s ease;
}

a:not(.btn):not(.nav-link):not(.social-link):hover::after {
    width: 100%;
}

/* ==================== LOADING STATES ==================== */

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

html.dark-theme .skeleton,
body.dark-theme .skeleton {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ==================== BADGES AND TAGS ==================== */

.badge,
.tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

body.light-theme .badge,
body:not(.dark-theme) .badge {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

html.dark-theme .badge,
body.dark-theme .badge {
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
}

/* ==================== ANIMATIONS ==================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Apply animations to elements */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.slide-in-right {
    animation: slideInFromRight 0.6s ease-out;
}

.slide-in-left {
    animation: slideInFromLeft 0.6s ease-out;
}

.scale-in {
    animation: scaleIn 0.4s ease-out;
}

/* ==================== ACCESSIBILITY IMPROVEMENTS ==================== */

/* Focus visible enhancements */
*:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 2px;
}

body.light-theme *:focus-visible,
body:not(.dark-theme) *:focus-visible {
    outline-color: #3b82f6;
}

html.dark-theme *:focus-visible,
body.dark-theme *:focus-visible {
    outline-color: #60a5fa;
}

/* Skip to main content link */
.skip-to-main {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: #3b82f6;
    color: white;
    padding: 1rem 2rem;
    border-radius: 0 0 8px 8px;
    font-weight: 600;
    z-index: 10000;
    transition: top 0.3s ease;
}

.skip-to-main:focus {
    top: 0;
}

/* ==================== 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;
        scroll-behavior: auto !important;
    }
}

/* ==================== PRINT STYLES ==================== */

@media print {
    /* Force light mode for printing */
    body,
    html {
        background: white !important;
        color: black !important;
    }
    
    .header,
    .footer,
    .nav-toggle,
    .theme-toggle,
    .scroll-to-top {
        display: none !important;
    }
    
    a {
        text-decoration: underline !important;
    }
}

/* ==================== CUSTOM SCROLLBAR FOR BOTH THEMES ==================== */

::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

body.light-theme ::-webkit-scrollbar-track,
body:not(.dark-theme) ::-webkit-scrollbar-track {
    background: #f1f5f9;
}

body.light-theme ::-webkit-scrollbar-thumb,
body:not(.dark-theme) ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 6px;
    border: 2px solid #f1f5f9;
}

body.light-theme ::-webkit-scrollbar-thumb:hover,
body:not(.dark-theme) ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #2563eb 0%, #1e40af 100%);
}

/* ==================== MOBILE OPTIMIZATIONS ==================== */

@media (max-width: 768px) {
    /* Larger touch targets for mobile */
    button,
    a,
    input,
    select,
    textarea {
        min-height: 44px;
    }
    
    /* Optimize animations for mobile */
    * {
        transition-duration: 0.2s !important;
    }
}
