/* ============================================
   BEINSCIENCES - MODERN UNIFIED DESIGN SYSTEM
   ============================================ */

/* CSS Variables - Design Tokens */
:root {
    /* Primary Colors */
    --color-primary: #6366f1;
    --color-primary-dark: #4f46e5;
    --color-primary-light: #818cf8;

    /* Secondary Colors */
    --color-secondary: #8b5cf6;
    --color-accent: #ec4899;

    /* Neutral Colors */
    --color-dark: #0f172a;
    --color-gray-900: #1e293b;
    --color-gray-800: #334155;
    --color-gray-700: #475569;
    --color-gray-600: #64748b;
    --color-gray-500: #94a3b8;
    --color-gray-400: #cbd5e1;
    --color-gray-300: #e2e8f0;
    --color-gray-200: #f1f5f9;
    --color-gray-100: #f8fafc;
    --color-white: #ffffff;

    /* Status Colors */
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-error: #ef4444;
    --color-info: #3b82f6;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   BASE STYLES
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    /* Better mobile scrolling */
    -webkit-overflow-scrolling: touch;
}

body {
    font-family: 'Poppins', 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-gray-800);
    background: linear-gradient(135deg, #f5f7fa 0%, #ffffff 100%);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Prevent text size adjustment on mobile */
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    /* Better touch scrolling */
    overflow-x: hidden;
    position: relative;
}

/* ============================================
   LOADING SCREEN
   ============================================ */

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 50%, #ffffff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loading-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(102, 126, 234, 0.03) 0%, transparent 70%);
    animation: pulseGlow 4s ease-in-out infinite;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    animation: fadeInUp 0.8s ease;
    position: relative;
    z-index: 1;
}

.loading-logo {
    width: 180px;
    height: auto;
    margin-bottom: 3rem;
    animation: smoothPulse 2.5s ease-in-out infinite;
    filter: drop-shadow(0 10px 30px rgba(99, 102, 241, 0.15));
}

/* Orbital Loader with Sigma Symbol */
.orbital-loader {
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem;
    position: relative;
}

.sigma-symbol {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: sigmaPulse 2s ease-in-out infinite;
    z-index: 2;
}

.orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.orbit-1 {
    width: 60px;
    height: 60px;
    animation: orbitRotate1 3s linear infinite;
}

.orbit-2 {
    width: 90px;
    height: 90px;
    animation: orbitRotate2 4s linear infinite reverse;
}

.orbit-3 {
    width: 120px;
    height: 120px;
    animation: orbitRotate3 5s linear infinite;
}

.particle {
    width: 10px;
    height: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.6);
    animation: particleGlow 1s ease-in-out infinite alternate;
}

.orbit-2 .particle {
    background: linear-gradient(135deg, #764ba2 0%, #f093fb 100%);
    box-shadow: 0 0 15px rgba(118, 75, 162, 0.6);
    animation-delay: 0.3s;
}

.orbit-3 .particle {
    background: linear-gradient(135deg, #667eea 0%, #4facfe 100%);
    box-shadow: 0 0 15px rgba(79, 172, 254, 0.6);
    animation-delay: 0.6s;
}

.loading-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    animation: textPulse 2s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

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

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

/* New Loading Animations */
@keyframes smoothPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.08);
        opacity: 0.85;
    }
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes spinFast {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes spinSlow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes textPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(0.98);
    }
}

@keyframes pulseGlow {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

/* Orbital Animations */
@keyframes sigmaPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.8;
    }
}

@keyframes orbitRotate1 {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes orbitRotate2 {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes orbitRotate3 {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes particleGlow {
    0% {
        box-shadow: 0 0 10px rgba(102, 126, 234, 0.4);
        transform: translateX(-50%) scale(0.9);
    }
    100% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.8);
        transform: translateX(-50%) scale(1.1);
    }
}

/* ============================================
   CONTAINER & LAYOUT
   ============================================ */

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--spacing-xl);
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-dark);
    margin-bottom: var(--spacing-md);
}

h1 {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: 2.25rem;
    color: var(--color-gray-900);
}

h3 {
    font-size: 1.875rem;
}

h4 {
    font-size: 1.5rem;
}

.subtitle {
    font-size: 1.125rem;
    color: var(--color-gray-600);
    font-weight: 400;
}

/* ============================================
   NAVIGATION
   ============================================ */

.navbar {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-gray-200);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--spacing-md);
    padding-bottom: var(--spacing-md);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-primary);
    text-decoration: none;
}

.logo:hover {
    opacity: 0.9;
}

.logo-image {
    height: 35px;
    width: auto;
    display: block;
    object-fit: contain;
}

.nav-links {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

/* Modern Nav Links with Icons */
.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    color: var(--color-gray-700);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    position: relative;
}

.nav-link svg {
    flex-shrink: 0;
    opacity: 0.8;
}

.nav-link:hover {
    color: var(--color-primary);
    background: var(--color-gray-100);
}

.nav-link:hover svg {
    opacity: 1;
}

/* Special Badge Links */
.wallet-badge {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    color: #059669;
    font-weight: 600;
}

.wallet-badge:hover {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #047857;
}

.qa-badge {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    font-weight: 600;
}

.qa-badge:hover {
    background: linear-gradient(135deg, #fde68a 0%, #fcd34d 100%);
    color: #78350f;
}

.subscriptions-badge {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
    font-weight: 600;
}

.subscriptions-badge:hover {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
}

/* User Menu & Dropdown */
.user-menu {
    position: relative;
    margin-left: var(--spacing-sm);
}

.user-avatar {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    transition: all var(--transition-base);
}

.user-avatar:hover .avatar-circle {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    transition: all var(--transition-base);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

.avatar-circle-large {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    min-width: 260px;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--color-gray-200);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-base), visibility var(--transition-base);
    z-index: 100;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
}

.dropdown-header {
    padding: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--color-gray-900);
    margin-bottom: 0.25rem;
}

.user-role {
    font-size: 0.8125rem;
    color: var(--color-gray-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dropdown-divider {
    height: 1px;
    background: var(--color-gray-200);
    margin: 0 var(--spacing-md);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    color: var(--color-gray-700);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: all var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--color-gray-50);
    color: var(--color-error);
}

.dropdown-item svg {
    opacity: 0.7;
}

.dropdown-item:hover svg {
    opacity: 1;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-sm);
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.mobile-menu-toggle:hover {
    background: var(--color-gray-100);
}

.menu-icon {
    display: block;
    position: relative;
    width: 24px;
    height: 2px;
    background: var(--color-gray-700);
    transition: all var(--transition-base);
}

.menu-icon::before,
.menu-icon::after {
    content: '';
    position: absolute;
    left: 0;
    width: 24px;
    height: 2px;
    background: var(--color-gray-700);
    transition: all var(--transition-base);
}

.menu-icon::before {
    top: -8px;
}

.menu-icon::after {
    bottom: -8px;
}

/* Animated Menu Icon */
.mobile-menu-toggle.active .menu-icon {
    background: transparent;
}

.mobile-menu-toggle.active .menu-icon::before {
    transform: rotate(45deg);
    top: 0;
}

.mobile-menu-toggle.active .menu-icon::after {
    transform: rotate(-45deg);
    bottom: 0;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-base);
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    /* Better touch targets */
    min-height: 44px;
    /* Prevent text selection on buttons */
    user-select: none;
    -webkit-user-select: none;
    /* Better touch feedback */
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: var(--color-white);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--color-gray-100);
    color: var(--color-gray-700);
}

.btn-secondary:hover {
    background: var(--color-gray-200);
}

.btn-success {
    background: var(--color-success);
    color: var(--color-white);
    box-shadow: var(--shadow-md);
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: var(--color-error);
    color: var(--color-white);
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
}

.btn-outline:hover {
    background: var(--color-primary);
    color: var(--color-white);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Navigation Auth Buttons - Enhanced Design */
.btn-nav-login {
    background: transparent;
    color: var(--color-gray-700);
    border: 2px solid var(--color-gray-300);
    padding: 0.625rem 1.25rem;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.btn-nav-login svg {
    transition: transform var(--transition-base);
}

.btn-nav-login:hover {
    background: var(--color-gray-100);
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-nav-login:hover svg {
    transform: translateX(-2px);
}

.btn-nav-register {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: white;
    border: 2px solid transparent;
    padding: 0.625rem 1.5rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-nav-register::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-primary) 100%);
    transition: left var(--transition-base);
}

.btn-nav-register span,
.btn-nav-register svg {
    position: relative;
    z-index: 1;
}

.btn-nav-register svg {
    transition: transform var(--transition-base);
}

.btn-nav-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-nav-register:hover::before {
    left: 0;
}

.btn-nav-register:hover svg {
    transform: rotate(360deg);
}

.btn-nav-register:active {
    transform: translateY(0);
}

/* ============================================
   CARDS
   ============================================ */



/* ============================================
   COURSE GRID
   ============================================ */

.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--spacing-xl);
    margin-top: var(--spacing-xl);
}

.course-card {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: box-shadow var(--transition-slow);
    border: 1px solid var(--color-gray-200);
    display: flex;
    flex-direction: column;
    height: 100%;
}



.course-thumbnail {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
}

.course-thumbnail::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.1) 100%);
}

.course-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.default-course-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
}

.default-course-image svg {
    width: 100%;
    height: 100%;
    display: block;
}

.course-info {
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    flex: 1;
}

.course-info h3 {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-sm);
    color: var(--color-gray-900);
}

.course-info .btn {
    margin-top: auto;
}

.course-tutor {
    color: var(--color-gray-600);
    font-size: 0.875rem;
    margin-bottom: var(--spacing-sm);
}

/* ============================================
   DASHBOARD STATS
   ============================================ */

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--spacing-lg);
    margin: var(--spacing-xl) 0;
}

.stat-card {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: var(--color-white);
    padding: var(--spacing-xl);
    border-radius: var(--radius-xl);
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.stat-card:hover {
    box-shadow: var(--shadow-xl);
}

.stat-card h3 {
    font-size: 3rem;
    color: var(--color-white);
    margin-bottom: var(--spacing-sm);
    font-weight: 800;
}

.stat-card p {
    font-size: 1rem;
    opacity: 0.9;
}

/* ============================================
   PROGRESS BAR
   ============================================ */

.progress-bar {
    width: 100%;
    height: 12px;
    background-color: var(--color-gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin: var(--spacing-md) 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    transition: width var(--transition-slow);
    border-radius: var(--radius-full);
}

.progress-text {
    font-size: 0.875rem;
    color: var(--color-gray-600);
    margin-top: var(--spacing-sm);
}

/* ============================================
   FORMS
   ============================================ */

.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
    color: var(--color-gray-800);
    font-size: 0.9375rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="url"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--color-gray-300);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-family: inherit;
    transition: all var(--transition-base);
    background: var(--color-white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* ============================================
   AUTH PAGES
   ============================================ */

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    padding: var(--spacing-xl) 0;
}

.auth-box {
    background: var(--color-white);
    padding: var(--spacing-3xl);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 460px;
    border: 1px solid var(--color-gray-200);
}

.auth-box h2 {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.auth-footer {
    margin-top: var(--spacing-lg);
    text-align: center;
    color: var(--color-gray-600);
    font-size: 0.9375rem;
}

.auth-footer a {
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ============================================
   TABLES
   ============================================ */

.data-table {
    width: 100%;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-gray-200);
}

.data-table thead {
    background: var(--color-gray-100);
}

.data-table th,
.data-table td {
    padding: var(--spacing-md) var(--spacing-lg);
    text-align: left;
}

.data-table th {
    font-weight: 600;
    color: var(--color-gray-800);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--color-gray-200);
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--color-gray-50);
}

/* ============================================
   BADGES
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

/* ============================================
   VIDEO PLAYER
   ============================================ */

.video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    margin-bottom: var(--spacing-xl);
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: var(--color-dark);
    box-shadow: var(--shadow-xl);
}

.video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-block-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 5;
    pointer-events: auto;
    cursor: not-allowed;
}

.video-external-controls {
    margin-top: var(--spacing-lg);
    padding: var(--spacing-lg);
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    border: 1px solid var(--color-gray-200);
}

.video-control-button {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 0.875rem 1.75rem;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: var(--color-white);
    border: none;
    border-radius: var(--radius-full);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
}

.video-control-button:hover:not(:disabled) {
    box-shadow: var(--shadow-lg);
}

.video-control-button:active:not(:disabled) {
    opacity: 0.9;
}

.video-control-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--color-gray-400);
}

.video-control-button #playIcon {
    font-size: 1.25rem;
}

.video-control-button.fullscreen-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.video-control-button.fullscreen-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.video-control-button #fullscreenIcon {
    font-size: 1.25rem;
    line-height: 1;
}

/* Fullscreen mode styles */
.video-section.fullscreen-active {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    background: #000 !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
}

.video-section.fullscreen-active .video-wrapper {
    height: calc(100vh - 80px) !important;
    max-height: none !important;
}

.video-section.fullscreen-active .video-container {
    height: 100% !important;
}

.video-section.fullscreen-active .video-external-controls {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
    z-index: 10000 !important;
}

.video-status {
    color: var(--color-gray-600);
    font-size: 0.9375rem;
    font-weight: 500;
    flex: 1;
}

/* ============================================
   LESSON PAGE
   ============================================ */

.breadcrumb {
    color: var(--color-gray-600);
    margin-bottom: var(--spacing-lg);
    font-size: 0.9375rem;
}

.breadcrumb a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.lesson-header {
    background: var(--color-white);
    padding: var(--spacing-xl);
    border-radius: var(--radius-xl);
    margin-bottom: var(--spacing-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-gray-200);
}

.lesson-content {
    background: var(--color-white);
    padding: var(--spacing-xl);
    border-radius: var(--radius-xl);
    line-height: 1.8;
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-xl);
    border: 1px solid var(--color-gray-200);
}

.lesson-navigation {
    display: flex;
    justify-content: space-between;
    gap: var(--spacing-md);
    margin: var(--spacing-xl) 0;
}

.lesson-sidebar {
    background: var(--color-white);
    padding: var(--spacing-xl);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-gray-200);
}

.lesson-sidebar ul {
    list-style: none;
}

.lesson-sidebar li {
    margin-bottom: var(--spacing-sm);
}

.lesson-sidebar a {
    color: var(--color-gray-700);
    text-decoration: none;
    padding: var(--spacing-sm) var(--spacing-md);
    display: block;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    font-weight: 500;
}

.lesson-sidebar a:hover,
.lesson-sidebar a.active {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: var(--color-white);
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
    background: var(--color-gray-900);
    color: var(--color-gray-400);
    padding: var(--spacing-2xl) 0;
    text-align: center;
    margin-top: var(--spacing-3xl);
}

.footer p {
    font-size: 0.9375rem;
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
    min-height: calc(100vh - 200px);
    padding: var(--spacing-2xl) 0;
}

/* ============================================
   SECTION
   ============================================ */

.section {
    margin: var(--spacing-2xl) 0;
}

/* ============================================
   MOBILE NAVIGATION
   ============================================ */

/* Note: Mobile menu toggle is already defined in NAVIGATION section above (lines 386-445) */

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

/* Tablets (768px - 1024px) */
@media (max-width: 1024px) {
    .container {
        padding: 0 var(--spacing-lg);
    }

    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2rem;
    }

    .course-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: var(--spacing-lg);
    }

    .dashboard-stats {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

/* Mobile Landscape and smaller tablets (481px - 768px) */
@media (max-width: 768px) {
    :root {
        /* Reduce spacing for mobile */
        --spacing-xl: 1.5rem;
        --spacing-2xl: 2rem;
        --spacing-3xl: 2.5rem;
    }

    .container {
        padding: 0 var(--spacing-md);
    }

    h1 {
        font-size: 1.875rem;
        line-height: 1.1;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    /* Navigation Mobile */
    .navbar {
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    .navbar .container {
        flex-wrap: wrap;
        padding-top: var(--spacing-sm);
        padding-bottom: var(--spacing-sm);
        position: relative;
    }

    .logo {
        font-size: 1.25rem;
        flex: 1;
    }

    .logo-image {
        height: 32px;
    }

    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        background: transparent;
        border: none;
        border-radius: var(--radius-md);
        cursor: pointer;
        z-index: 1001;
        order: 2;
    }

    .mobile-menu-toggle:hover {
        background: var(--color-gray-100);
    }

    .mobile-menu-toggle .menu-icon {
        display: block;
        position: relative;
        width: 24px;
        height: 2px;
        background: var(--color-gray-700);
        transition: all var(--transition-base);
    }

    .mobile-menu-toggle .menu-icon::before,
    .mobile-menu-toggle .menu-icon::after {
        content: '';
        position: absolute;
        left: 0;
        width: 24px;
        height: 2px;
        background: var(--color-gray-700);
        transition: all var(--transition-base);
    }

    .mobile-menu-toggle .menu-icon::before {
        top: -8px;
    }

    .mobile-menu-toggle .menu-icon::after {
        bottom: -8px;
    }

    .mobile-menu-toggle.active .menu-icon {
        background: transparent;
    }



    
    .nav-links {
        display: none !important;
        width: 100%;
        flex-direction: column;
        gap: var(--spacing-xs);
        padding: var(--spacing-md) 0;
        border-top: 1px solid var(--color-gray-200);
        margin-top: var(--spacing-md);
        order: 3;
        background: var(--color-white);
        z-index: 999;
    }

    .nav-links.active {
        display: flex !important;
    }

    .nav-link {
        width: 100%;
        justify-content: flex-start;
        padding: var(--spacing-md);
        background: var(--color-gray-50);
    }

    .nav-link:hover {
        background: var(--color-gray-100);
    }

    /* Auth buttons mobile */
    .btn-nav-login,
    .btn-nav-register {
        width: 100%;
        justify-content: center;
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
        margin-bottom: 0.5rem;
        margin-top: 0.75rem;
    }

    .btn-nav-login {
        order: 2;
    }

    .btn-nav-register {
        order: 1; /* Show "Get Started" first on mobile */
        border-top: 2px solid var(--color-gray-200);
        padding-top: 1.125rem;
    }

    /* Mobile User Menu */
    .user-menu {
        width: 100%;
        margin-left: 0;
        margin-top: var(--spacing-sm);
    }

    .user-avatar {
        width: 100%;
        justify-content: flex-start;
        padding: var(--spacing-md);
        background: var(--color-gray-50);
        border-radius: var(--radius-md);
    }

    .user-dropdown {
        position: static;
        width: 100%;
        margin-top: var(--spacing-sm);
        box-shadow: none;
        border: 1px solid var(--color-gray-200);
    }

    /* Mobile wallet and badges */
    .wallet-badge,
    .qa-badge,
    .subscriptions-badge {
        width: 100%;
        justify-content: flex-start;
    }

    /* Course Grid */
    .course-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .course-card {
        margin: 0 auto;
        max-width: 100%;
    }

    /* Dashboard Stats */
    .dashboard-stats {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .stat-card {
        padding: var(--spacing-lg);
    }

    .stat-card h3 {
        font-size: 2.5rem;
    }

    /* Buttons */
    .btn {
        width: 100%;
        justify-content: center;
        padding: var(--spacing-md) var(--spacing-lg);
    }

    .btn-small {
        padding: var(--spacing-sm) var(--spacing-md);
    }

    /* Forms */
    .auth-box {
        padding: var(--spacing-xl);
        margin: 0 var(--spacing-md);
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Prevent zoom on iOS */
    }

    /* Lesson Navigation */
    .lesson-navigation {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .lesson-navigation .btn {
        width: 100%;
    }

    /* Video Controls */
    .video-external-controls {
        flex-direction: column;
        align-items: stretch;
        padding: var(--spacing-md);
    }

    .video-control-button {
        width: 100%;
        justify-content: center;
        padding: var(--spacing-md);
    }

    .video-status {
        text-align: center;
        padding: var(--spacing-sm) 0;
    }

    /* Tables */
    .data-table {
        font-size: 0.875rem;
    }

    .data-table th,
    .data-table td {
        padding: var(--spacing-sm) var(--spacing-md);
    }

    /* Cards */
    .card {
        padding: var(--spacing-lg);
    }

    .lesson-header,
    .lesson-content,
    .lesson-sidebar {
        padding: var(--spacing-lg);
    }

    /* Main Content */
    .main-content {
        padding: var(--spacing-lg) 0;
    }

    /* Footer */
    .footer {
        padding: var(--spacing-xl) 0;
    }
}

/* Mobile Portrait (320px - 480px) */
@media (max-width: 480px) {
    :root {
        font-size: 14px;
    }

    /* Auth buttons on small screens */
    .btn-nav-login,
    .btn-nav-register {
        padding: 0.75rem 1.25rem;
        font-size: 0.9375rem;
    }

    .container {
        padding: 0 var(--spacing-sm);
    }

    h1 {
        font-size: 1.625rem;
    }

    h2 {
        font-size: 1.375rem;
    }

    .logo {
        font-size: 1.125rem;
    }

    .logo-image {
        height: 30px;
    }

    .logo-icon {
        font-size: 1.375rem;
    }

    /* Tighter spacing */
    .course-info,
    .card,
    .lesson-header,
    .lesson-content {
        padding: var(--spacing-md);
    }

    .auth-box {
        padding: var(--spacing-lg);
    }

    /* Video player */
    .video-wrapper {
        border-radius: var(--radius-lg);
    }

    /* Stat cards more compact */
    .stat-card h3 {
        font-size: 2rem;
    }

    .stat-card p {
        font-size: 0.875rem;
    }

    /* Navigation */
    .nav-links a {
        font-size: 0.9375rem;
        padding: var(--spacing-sm);
    }

    /* Course thumbnails slightly shorter on very small screens */
    .course-thumbnail {
        height: 180px;
    }
}

/* Very small screens (below 360px) */
@media (max-width: 360px) {
    :root {
        font-size: 13px;
    }

    h1 {
        font-size: 1.5rem;
    }

    .logo-text {
        font-size: 0.95rem;
    }

    .stat-card h3 {
        font-size: 1.75rem;
    }
}

/* Landscape orientation fixes */
@media (max-height: 600px) and (orientation: landscape) {
    .auth-container {
        min-height: auto;
        padding: var(--spacing-md) 0;
    }

    .auth-box {
        padding: var(--spacing-lg);
    }

    .main-content {
        padding: var(--spacing-md) 0;
    }
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast-container {
    position: fixed;
    top: 80px;
    right: var(--spacing-xl);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    pointer-events: none;
}

.toast {
    min-width: 320px;
    max-width: 500px;
    padding: var(--spacing-lg) var(--spacing-xl);
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    pointer-events: all;
    transform: translateX(400px);
    opacity: 0;
    transition: all var(--transition-slow);
    border-left: 4px solid var(--color-primary);
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 700;
    font-size: 0.9375rem;
    margin-bottom: 0.25rem;
    color: var(--color-gray-900);
}

.toast-message {
    font-size: 0.875rem;
    color: var(--color-gray-600);
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: var(--color-gray-400);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.toast-close:hover {
    background: var(--color-gray-100);
    color: var(--color-gray-600);
}

.toast-success {
    border-left-color: var(--color-success);
}

.toast-success .toast-icon {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
}

.toast-error {
    border-left-color: var(--color-error);
}

.toast-error .toast-icon {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-error);
}

.toast-warning {
    border-left-color: var(--color-warning);
}

.toast-warning .toast-icon {
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
}

.toast-info {
    border-left-color: var(--color-info);
}

.toast-info .toast-icon {
    background: rgba(59, 130, 246, 0.1);
    color: var(--color-info);
}

/* Mobile Toast */
@media (max-width: 768px) {
    .toast-container {
        top: auto;
        bottom: var(--spacing-xl);
        left: var(--spacing-md);
        right: var(--spacing-md);
    }

    .toast {
        min-width: auto;
        width: 100%;
        transform: translateY(150px);
    }

    .toast.show {
        transform: translateY(0);
    }
}

/* ============================================
   MODAL DIALOGS
   ============================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.modal-overlay.show {
    opacity: 1;
}

.modal {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 480px;
    width: 100%;
    transform: scale(0.9);
    transition: transform var(--transition-base);
    overflow: hidden;
}

.modal-overlay.show .modal {
    transform: scale(1);
}

.modal-header {
    padding: var(--spacing-xl);
    border-bottom: 1px solid var(--color-gray-200);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.modal-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.modal-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
}

.modal-icon.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-error);
}

.modal-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
}

.modal-icon.info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--color-info);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-gray-900);
    flex: 1;
}

.modal-body {
    padding: var(--spacing-xl);
    color: var(--color-gray-600);
    line-height: 1.6;
    font-size: 0.9375rem;
}

.modal-footer {
    padding: var(--spacing-xl);
    border-top: 1px solid var(--color-gray-200);
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-end;
}

.modal-footer .btn {
    min-width: 100px;
}

/* Mobile Modal */
@media (max-width: 768px) {
    .modal-overlay {
        padding: var(--spacing-md);
    }

    .modal {
        max-width: 100%;
    }

    .modal-footer {
        flex-direction: column-reverse;
    }

    .modal-footer .btn {
        width: 100%;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-center {
    text-align: center;
}

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }
.mt-4 { margin-top: var(--spacing-xl); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }
.mb-4 { margin-bottom: var(--spacing-xl); }

/* ============================================
   TOUCH & MOBILE OPTIMIZATIONS
   ============================================ */

/* Better image loading on mobile */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Smooth scrolling containers */
.scrollable {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

/* Remove tap highlight on links */
a {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

/* Better focus states for accessibility */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Hide focus outline for mouse users, show for keyboard users */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) {
    outline: none;
}

/* Touch-friendly spacing for interactive elements */
@media (hover: none) and (pointer: coarse) {
    /* This targets touch devices */
    .btn,
    .nav-links a,
    .course-card {
        min-height: 44px;
        min-width: 44px;
    }

    /* Larger tap targets on mobile */
    .video-control-button {
        min-height: 56px;
        padding: 1rem 2rem;
    }

    /* Better touch feedback with active states */
    .btn:active,
    .nav-links a:active,
    .mobile-menu-toggle:active {
        transform: scale(0.98);
        opacity: 0.9;
    }

    /* Prevent user selection on UI elements */
    .btn,
    .nav-links a,
    .mobile-menu-toggle,
    .video-control-button,
    .navbar,
    .badge {
        user-select: none;
        -webkit-user-select: none;
    }

    /* Better touch scrolling */
    .lesson-sidebar,
    .course-grid,
    .data-table {
        -webkit-overflow-scrolling: touch;
    }
}

/* Mobile Landscape Orientation Optimizations */
@media (max-width: 896px) and (orientation: landscape) {
    /* Optimize video player for landscape viewing on phones */
    .video-section.fullscreen-active .video-wrapper {
        height: 100vh !important;
    }

    .video-section.fullscreen-active .video-external-controls {
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .video-section.fullscreen-active .video-control-button {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.875rem;
    }

    .video-section.fullscreen-active #fullscreenText,
    .video-section.fullscreen-active #playText {
        display: none; /* Hide text, show icons only in landscape fullscreen */
    }

    .video-section.fullscreen-active .video-status {
        font-size: 0.75rem;
    }
}

/* Smooth scrolling for entire page */
html {
    scroll-behavior: smooth;
}

/* Prevent overscroll on mobile */
body {
    overscroll-behavior-y: none;
}

/* Better touch feedback for all clickable elements */
button:active,
a:active,
.card:active {
    opacity: 0.9;
}

/* Prevent double-tap zoom on buttons and controls */
button,
.btn,
.video-control-button,
.mobile-menu-toggle {
    touch-action: manipulation;
}

/* ============================================
   MODERN ENHANCEMENTS - TAKIACADEMY STYLE
   ============================================ */

/* Enhanced Loading Bar (NProgress style) */
#nprogress {
    pointer-events: none;
}

#nprogress .bar {
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    box-shadow: 0 0 10px var(--color-primary), 0 0 5px var(--color-primary);
}

#nprogress .peg {
    display: block;
    position: absolute;
    right: 0px;
    width: 100px;
    height: 100%;
    box-shadow: 0 0 10px var(--color-primary), 0 0 5px var(--color-primary);
    opacity: 1;
}

#nprogress .spinner {
    display: block;
    position: fixed;
    z-index: 9999;
    top: 20px;
    right: 20px;
}

#nprogress .spinner-icon {
    width: 22px;
    height: 22px;
    box-sizing: border-box;
    border-width: 3px;
    border-style: solid;
    border-color: var(--color-primary) transparent transparent var(--color-primary);
    border-radius: 50%;
    animation: nprogress-spinner 400ms linear infinite;
}








/* Floating Animation for Featured Elements */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.floating {
    animation: float 3s ease-in-out infinite;
}

/* Smooth Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

.fade-in-delay-1 {
    animation: fadeIn 0.6s ease-out 0.1s forwards;
    opacity: 0;
}

.fade-in-delay-2 {
    animation: fadeIn 0.6s ease-out 0.2s forwards;
    opacity: 0;
}

.fade-in-delay-3 {
    animation: fadeIn 0.6s ease-out 0.3s forwards;
    opacity: 0;
}

/* Pulse Animation for Badges and Notifications */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Enhanced Button Ripple Effect */
.btn {
    position: relative;
    overflow: hidden;
}

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

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

/* Glassmorphism Effect */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

/* Enhanced Navbar with Blur Effect */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Enhanced Progress Bar with Gradient Animation */
.progress-fill {
    background: linear-gradient(90deg,
        var(--color-primary) 0%,
        var(--color-secondary) 50%,
        var(--color-primary) 100%);
    background-size: 200% 100%;
    animation: gradientShift 2s ease infinite;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Smooth Scale Animation for Interactive Elements */
.scale-on-hover {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.scale-on-hover:hover {
    transform: scale(1.03);
}

/* Enhanced Shadow on Scroll */
.shadow-on-scroll {
    transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.shadow-on-scroll.scrolled {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* Skeleton Loading Animation */
.skeleton {
    background: linear-gradient(90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Smooth Text Gradient Animation */
.gradient-text {
    background: linear-gradient(135deg,
        var(--color-primary) 0%,
        var(--color-secondary) 50%,
        var(--color-accent) 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientText 3s ease infinite;
}

@keyframes gradientText {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}




.course-thumbnail {
    transform: translateZ(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Smooth Parallax Effect */
.parallax {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced Badge Animation */
.badge {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.badge::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.badge:hover::before {
    opacity: 1;
}

/* Enhanced Video Player with Modern Controls */
.video-wrapper {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.video-wrapper:hover {
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.2);
}

/* Modern Tooltip */
[data-tooltip] {
    position: relative;
    cursor: pointer;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 8px 12px;
    background: rgba(15, 23, 42, 0.95);
    color: white;
    font-size: 0.875rem;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

[data-tooltip]::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(15, 23, 42, 0.95);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-16px);
}

[data-tooltip]:hover::after {
    transform: translateX(-50%) translateY(-8px);
}

/* Enhanced Form Focus States */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.15);
}

/* Smooth Page Transitions */
.page-transition {
    animation: pageTransition 0.5s ease-out;
}

@keyframes pageTransition {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced Dashboard Stats with Glow Effect */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    animation: statGlow 3s linear infinite;
}

@keyframes statGlow {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* Modern Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--color-gray-100);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    border-radius: 10px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
}

/* Firefox Scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--color-primary) var(--color-gray-100);
}

/* Enhanced Link Underline Animation */
a:not(.btn):not(.nav-link) {
    position: relative;
}

a:not(.btn):not(.nav-link)::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

a:not(.btn):not(.nav-link):hover::after {
    width: 100%;
}

/* Reduced Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Chapter Sections for Student View */
.chapter-section {
    margin-bottom: 2rem;
}

.chapter-header-student {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px 8px 0 0;
    margin-bottom: 0;
}

.chapter-title-student {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.chapter-lesson-count {
    font-size: 0.875rem;
    opacity: 0.9;
}

.chapter-section .lessons-grid {
    border: 1px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 1rem;
    background: #f9fafb;
}

/* Chapter group styles for lesson view */
.chapter-group {
    margin-bottom: 1.5rem;
}

.chapter-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 8px 8px 0 0;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0;
}

.chapter-group .lesson-list {
    list-style: none;
    padding: 0;
    margin: 0;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 8px 8px;
}

.chapter-group .lesson-list li {
    border-bottom: 1px solid #e5e7eb;
}

.chapter-group .lesson-list li:last-child {
    border-bottom: none;
}

.chapter-group .lesson-list a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: #374151;
    transition: all 0.2s;
}

.chapter-group .lesson-list a:hover {
    background: #e5e7eb;
}

.chapter-group .lesson-list a.active {
    background: #667eea;
    color: white;
    font-weight: 600;
}

.chapter-group .lesson-list .lesson-num {
    background: #667eea;
    color: white;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 600;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.chapter-group .lesson-list a.active .lesson-num {
    background: white;
    color: #667eea;
}

.chapter-group .lesson-list .lesson-name {
    flex: 1;
}

/* All lessons section */
.all-lessons-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #e5e7eb;
}

.all-lessons-section h3 {
    color: #1f2937;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

/* ============================================
   MOBILE-FIRST STUDENT PAGES - APP-LIKE DESIGN
   ============================================ */

/* Student Dashboard Wrapper */
.dashboard-wrapper {
    display: flex;
    min-height: calc(100vh - 60px);
    position: relative;
}

/* Sidebar Collapse Button */
.sidebar-collapse-btn {
    position: fixed;
    left: 260px;
    top: 80px;
    z-index: 999;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.sidebar-collapse-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.sidebar-collapse-btn .collapse-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

/* Sidebar */
.dashboard-sidebar {
    width: 260px;
    background: white;
    border-right: 1px solid #e5e7eb;
    position: fixed;
    left: 0;
    top: 60px;
    height: calc(100vh - 60px);
    overflow-y: auto;
    z-index: 998;
    transition: transform 0.3s ease;
}

.dashboard-sidebar.collapsed {
    transform: translateX(-260px);
}

.sidebar-content {
    padding: 1.5rem 0;
}

.sidebar-logo {
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 1rem;
}

.sidebar-logo img.sidebar-logo-img {
    width: 100%;
    height: auto;
    display: block;
}

.sidebar-logo img.sidebar-logo-icon {
    display: none;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0 0.75rem;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    color: #6b7280;
    font-weight: 500;
    transition: all 0.2s;
}

.sidebar-nav-item:hover {
    background: #f3f4f6;
    color: #667eea;
}

.sidebar-nav-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.sidebar-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Main Content Area */
.dashboard-main {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
    transition: margin-left 0.3s ease;
}

.dashboard-sidebar.collapsed ~ .dashboard-main {
    margin-left: 0;
}

/* ============================================
   MOBILE RESPONSIVE - APP-LIKE EXPERIENCE
   ============================================ */

/* Tablet (768px and below) */
@media (max-width: 768px) {
    .dashboard-wrapper {
        min-height: calc(100vh - 56px);
    }

    /* Mobile Sidebar */
    .dashboard-sidebar {
        transform: translateX(-100%);
        width: 280px;
        top: 56px;
        height: calc(100vh - 56px);
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }

    .dashboard-sidebar.active {
        transform: translateX(0);
    }

    /* Sidebar Overlay */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 997;
        display: none;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }

    /* Mobile Sidebar Toggle Button */
    .sidebar-collapse-btn {
        left: 1rem;
        top: calc(56px + 1rem);
        width: 40px;
        height: 40px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .sidebar-collapse-btn .collapse-icon {
        width: 24px;
        height: 24px;
    }

    .dashboard-sidebar.active ~ .sidebar-collapse-btn .collapse-icon {
        transform: rotate(180deg);
    }

    /* Main Content */
    .dashboard-main {
        margin-left: 0;
        padding: 1rem;
        width: 100%;
    }

    /* Cards Mobile */
    .stats-grid,
    .courses-grid,
    .lessons-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    /* Course Card Mobile */
    .course-card {
        border-radius: 12px;
    }

    .course-card-header {
        padding: 0 !important;
    }

    .course-thumbnail {
        border-radius: 12px 12px 0 0 !important;
    }

    .course-card-body {
        padding: 1rem !important;
    }

    /* Lesson View Mobile */
    .lesson-page-wrapper {
        flex-direction: column !important;
    }

    .lesson-main-content {
        width: 100% !important;
        padding: 1rem !important;
    }

    .qa-sidebar {
        width: 100% !important;
        position: relative !important;
        height: auto !important;
        border-left: none !important;
        border-top: 1px solid #e5e7eb !important;
        margin-top: 2rem !important;
    }

    /* Video Player Mobile */
    .video-wrapper {
        border-radius: 12px !important;
        overflow: hidden !important;
    }

    .video-container {
        border-radius: 12px !important;
    }

    /* Chapter Groups Mobile */
    .chapter-group {
        margin-bottom: 1rem;
    }

    .chapter-header {
        font-size: 0.9rem;
        padding: 0.6rem 0.875rem;
    }

    .lesson-list a {
        padding: 0.625rem 0.875rem;
        font-size: 0.875rem;
    }

    .lesson-num {
        width: 24px !important;
        height: 24px !important;
        font-size: 0.75rem !important;
    }
}

/* Mobile Portrait (480px and below) */
@media (max-width: 480px) {
    /* Tighter spacing for small phones */
    .dashboard-main {
        padding: 0.75rem;
    }

    /* Navbar Mobile */
    .navbar {
        height: 56px;
        padding: 0 1rem;
    }

    .logo-image {
        height: 32px;
    }

    /* Sidebar Mobile */
    .dashboard-sidebar {
        width: 85vw;
        max-width: 300px;
    }

    .sidebar-nav-item {
        padding: 0.75rem 0.875rem;
        font-size: 0.9rem;
    }

    .sidebar-icon {
        width: 18px;
        height: 18px;
    }

    /* Stats Cards Mobile */
    .stat-card {
        padding: 1rem !important;
    }

    .stat-value {
        font-size: 1.5rem !important;
    }

    .stat-label {
        font-size: 0.8rem !important;
    }

    /* Buttons Mobile */
    .btn {
        padding: 0.625rem 1rem !important;
        font-size: 0.875rem !important;
    }

    /* Typography Mobile */
    h1 {
        font-size: 1.75rem !important;
    }

    h2 {
        font-size: 1.5rem !important;
    }

    h3 {
        font-size: 1.25rem !important;
    }

    /* Course Hero Mobile */
    .course-hero {
        padding: 1.5rem 1rem !important;
    }

    .course-title {
        font-size: 1.5rem !important;
    }

    /* Lesson Header Mobile */
    .lesson-header h1 {
        font-size: 1.5rem !important;
    }

    /* Breadcrumb Mobile */
    .breadcrumb {
        font-size: 0.8rem !important;
        margin-bottom: 1rem !important;
    }

    /* Video Controls Mobile */
    .video-control-buttons {
        gap: 0.5rem !important;
    }

    .video-control-btn {
        width: 40px !important;
        height: 40px !important;
    }

    .video-control-btn#playPauseBtn {
        width: 48px !important;
        height: 48px !important;
    }

    /* Q&A Chat Mobile */
    .chat-container {
        height: 400px !important;
    }

    .chat-messages {
        padding: 0.75rem !important;
    }

    .message-bubble {
        max-width: 85% !important;
        padding: 0.75rem !important;
        font-size: 0.875rem !important;
    }

    /* Forms Mobile */
    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px !important; /* Prevents zoom on iOS */
    }

    /* Table Mobile - Make scrollable */
    .table-container {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    table {
        min-width: 600px !important;
    }
}

/* Extra Small Phones (360px and below) */
@media (max-width: 360px) {
    .dashboard-main {
        padding: 0.5rem;
    }

    .sidebar-nav-item {
        font-size: 0.85rem;
        padding: 0.625rem 0.75rem;
    }

    h1 {
        font-size: 1.5rem !important;
    }

    h2 {
        font-size: 1.25rem !important;
    }

    .course-card-body {
        padding: 0.75rem !important;
    }

    .btn {
        padding: 0.5rem 0.875rem !important;
        font-size: 0.8rem !important;
    }
}

/* PWA-like Features */
@media (max-width: 768px) {
    /* Smooth scrolling for app-like feel */
    * {
        -webkit-overflow-scrolling: touch;
    }

    /* Hide scrollbar but keep functionality */
    .dashboard-main::-webkit-scrollbar {
        width: 0;
        height: 0;
    }

    /* Touch-friendly tap targets */
    a, button, .clickable {
        min-height: 44px;
        min-width: 44px;
    }

    /* Prevent text selection for app-like feel */
    .sidebar-nav-item,
    .course-card,
    .btn {
        -webkit-user-select: none;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }

    /* Safe area insets for notched devices */
    .navbar {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }

    .dashboard-sidebar {
        padding-bottom: env(safe-area-inset-bottom);
    }
}
