/* Course Fix Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap');

:root {
    --primary-bg: #111827;
    --secondary-bg: #1f2937;
    --accent-color: #7c3aed;
    --accent-indigo: #6366f1;
    --accent-purple: #8b5cf6;
    --text-primary: #e5e7eb;
    --text-secondary: #9ca3af;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#root {
    margin: auto;
}

[data-theme="light"] {
    --primary-bg: #f3f4f6;
    --secondary-bg: #e5e7eb;
    --accent-color: #4f46e5;
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
}

[data-theme="blue"] {
    --primary-bg: #0f172a;
    --secondary-bg: #1e293b;
    --accent-color: #2563eb;
    --text-primary: #e5e7eb;
    --text-secondary: #9ca3af;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--primary-bg);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container that handles the sidebar transition */
#main-container {
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    display: flex;
    height: 100vh;
}

/* Sidebar styles */
#sidebar {
    width: 280px;
    flex-shrink: 0;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    transform: translateX(0);
    background: var(--secondary-bg);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
}

/* Class to hide the sidebar */
#main-container.sidebar-collapsed #sidebar {
    width: 0;
    transform: translateX(-100%);
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
    display: none;
}

/* Side button transition */
#sidebar-toggle-btn {
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform: translateX(-50px) scale(0.8);
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple)) !important;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
    z-index: 1000 !important;
    display: none;
    border: 2px solid rgba(255, 255, 255, 0.2) !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    user-select: none;
}

#sidebar-toggle-btn:hover {
    transform: translateX(0) scale(1.1) !important;
    box-shadow: 0 6px 25px rgba(99, 102, 241, 0.6) !important;
    background: linear-gradient(135deg, #4f46e5, #7c3aed) !important;
}

/* Ensure toggle button is visible when sidebar is collapsed */
#main-container.sidebar-collapsed #sidebar-toggle-btn {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(0) scale(1) !important;
}

/* Close button styling */
#sidebar-close-btn {
    cursor: pointer !important;
    user-select: none;
    z-index: 100;
}

#sidebar-close-btn:hover {
    background-color: #dc2626 !important;
    border-color: #dc2626 !important;
    color: white !important;
}

/* Ensure proper button interactions */
.btn-primary {
    pointer-events: auto !important;
    cursor: pointer !important;
}

#sidebar-toggle-btn:active {
    transform: translateX(0) scale(0.95) !important;
}

/* Class to show the side button */
#main-container.sidebar-collapsed #sidebar-toggle-btn {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(0) scale(1) !important;
    display: block !important;
    pointer-events: auto !important;
}

/* Ensure button is always visible when needed */
#sidebar-toggle-btn.force-visible {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    transform: translateX(0) scale(1) !important;
    pointer-events: auto !important;
}

/* Ensure button is always clickable */
#sidebar-toggle-btn * {
    pointer-events: none;
}

/* Close button in sidebar */
#sidebar-close-btn {
    transition: all 0.3s ease;
}

#sidebar-close-btn:hover {
    transform: rotate(90deg);
}

/* Main content transition */
#content {
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    width: 100%;
    position: relative;
    overflow-x: hidden;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    #main-container {
        position: relative;
    }

    #sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        z-index: 50;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
    }

    #sidebar.show {
        transform: translateX(0);
    }

    #sidebar-toggle-btn {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        position: fixed;
        top: 1rem;
        left: 1rem;
        z-index: 60;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 40;
        display: none;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .stats-card {
        background: rgba(40, 40, 40, 0.95);
    }

    .animate-fade-in-up {
        animation-duration: 0.4s;
    }
}

/* Entrance animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

.animate-delay-1 {
    animation-delay: 0.1s;
}

.animate-delay-2 {
    animation-delay: 0.2s;
}

.animate-delay-3 {
    animation-delay: 0.3s;
}

/* Course card enhancements */
.course-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: var(--secondary-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.course-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: 0.5s;
}

.course-card:hover::before {
    left: 100%;
}

.course-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.3);
}

/* Progress bar enhancements */
.progress-container {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    height: 10px;
    width: 100%;
}

.progress-bar {
    height: 100%;
    border-radius: 12px;
    background: linear-gradient(90deg, var(--accent-indigo), var(--accent-purple));
    transition: width 0.6s ease;
    position: relative;
    overflow: hidden;
    min-width: 2%;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Button enhancements */
.btn-primary {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:active::after {
    width: 300px;
    height: 300px;
}

/* Navigation link enhancements */
.nav-link {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-purple);
    transition: width 0.3s ease;
}

.nav-link:hover::before {
    width: 100%;
}

/* Removed loading overlay styles - no longer needed */

/* Active navigation item */
.nav-link.active {
    background: linear-gradient(90deg, var(--accent-indigo), var(--accent-purple));
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.4);
}

/* User profile enhancements */
.user-profile {
    transition: all 0.3s ease;
}

.user-profile:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

/* Header enhancements */
.header-title {
    background: none;
    -webkit-background-clip: initial;
    -webkit-text-fill-color: inherit;
    background-clip: initial;
    color: var(--text-primary);
    text-shadow: none;
    filter: none;
    -webkit-filter: none;
}

.navigation-links {
    flex-grow: 1;
    overflow-y: auto;
}

/* Brand section enhancements */
.brand-section {
    animation: none;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Theme Changer */
.theme-changer {
    padding: 0.5rem;
    border-radius: 9999px;
    background-color: var(--secondary-bg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-changer:hover {
    transform: scale(1.1);
}
