/* ============================================
   COMPONENTS - FUTURISTIC UI
   Mentoria Dropshipping - Redesign
   ============================================ */

/* ============================================
   HEADER - Minimalist
   ============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--glass-bg);
    border-bottom: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 0 !important;
    padding-right: var(--space-8);
    z-index: 100;
}

.header-logo {
    font-family: var(--font-primary);
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    letter-spacing: -0.02em;
    align-items: center;
    gap: var(--space-3);
    letter-spacing: -0.02em;
    /* margin-left removed, handled by flexbox */
}

.header-start {
    display: flex;
    align-items: center;
}

.header-start .sidebar-toggle {
    position: static;
    background: transparent;
    height: 40px;
    /* Adjust if needed */
    width: 60px;
    border-right: 1px solid var(--glass-border);
}

.header-start .header-logo {
    margin-left: var(--space-4);
}

.header-logo span {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Make logo clickable */
a.header-logo {
    text-decoration: none;
    cursor: pointer;
    transition: opacity var(--transition-base);
}

a.header-logo:hover {
    opacity: 0.8;
}

.header-user {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.user-name {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* ============================================
   SIDEBAR - Glassmorphic
   ============================================ */
.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: var(--glass-bg);
    border-right: 1px solid var(--glass-border);
    padding: var(--space-6);
    overflow-y: auto;
    transition: transform var(--transition-base);
    backdrop-filter: blur(20px);
    z-index: 90;
}

@media (max-width: 1024px) {
    .sidebar.collapsed {
        transform: translateX(-100%);
    }
}

@media (min-width: 1025px) {
    .sidebar.collapsed {
        width: var(--sidebar-width-collapsed);
        transform: none;
    }

    .sidebar.collapsed .sidebar-menu-link {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
    }

    .sidebar.collapsed .sidebar-menu-link span:not(.sidebar-menu-icon) {
        display: none;
    }

    .sidebar.collapsed .sidebar-menu-icon {
        margin: 0;
    }

    .sidebar.collapsed .sidebar-footer .sidebar-menu-link {
        justify-content: center;
    }
}

.sidebar-toggle {
    position: fixed;
    top: 0;
    left: 0;
    width: 80px;
    /* Hardcoded width to match collapsed sidebar */
    height: var(--header-height);
    border: none;
    border-right: 1px solid var(--glass-border);
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition-base);
    z-index: 9999;
    /* Force on top */
    font-size: 24px;
    color: var(--text-primary);
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 15px;
    /* Adjust padding for click area */
}

/* Hamburger Icon Lines */
.sidebar-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition-base);
}

.sidebar-toggle:hover span {
    background-color: var(--accent-primary);
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent-primary);
}

/* Remove old state-specific positions */
body.sidebar-collapsed .sidebar-toggle,
body:not(.sidebar-collapsed) .sidebar-toggle {
    left: 0;
    border-radius: 0;
}

body:not(.sidebar-collapsed) .sidebar-toggle {
    left: calc(var(--sidebar-width) - 18px);
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu-item {
    margin-bottom: var(--space-2);
}

.sidebar-menu-link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    color: var(--text-secondary);
    border-radius: var(--border-radius-md);
    transition: all var(--transition-base);
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: 500;
}

.sidebar-menu-link:hover {
    background: var(--glass-bg-light);
    color: var(--text-primary);
}

.sidebar-menu-link.active {
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.1), rgba(139, 92, 246, 0.1));
    color: var(--accent-primary);
    border: 1px solid rgba(0, 217, 255, 0.2);
}

.sidebar-menu-icon {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

/* Mobile Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 85;
    backdrop-filter: blur(4px);
}

.sidebar-overlay.active {
    display: block;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    margin-top: var(--header-height);
    margin-left: var(--sidebar-width);
    padding: var(--space-8);
    min-height: calc(100vh - var(--header-height));
    transition: margin-left var(--transition-base);
}

.main-content.sidebar-collapsed {
    margin-left: 0;
}

@media (min-width: 1025px) {

    .main-content.sidebar-collapsed,
    body.sidebar-collapsed .main-content {
        margin-left: var(--sidebar-width-collapsed);
    }
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
}

/* ============================================
   PROGRESS SECTION - Minimalist
   ============================================ */
.progress-section {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: var(--space-6);
    margin-bottom: var(--space-8);
    backdrop-filter: blur(10px);
}

.progress-section-title {
    font-size: var(--text-xl);
    font-weight: 600;
    margin-bottom: var(--space-4);
}

/* ============================================
   COMPACT KPI CARDS
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-8);
}

.stat-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: var(--space-4);
    transition: all var(--transition-base);
    backdrop-filter: blur(10px);
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: var(--glow-subtle);
}

.stat-icon {
    font-size: 32px;
    margin-bottom: var(--space-3);
    filter: drop-shadow(var(--glow-subtle));
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-1);
    line-height: 1;
}

.stat-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    font-weight: 500;
}

/* ============================================
   MODULE CARDS - With Image Support
   ============================================ */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-6);
}

.module-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-xl);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    /* Stack image then content */
    position: relative;
    /* Removed aspect-ratio from card to let it grow with content */
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    color: var(--text-primary);
    backdrop-filter: blur(10px);
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform;
}

/* Bonus Module Style */
.module-card.bonus:hover {
    border-color: #FFD700;
    box-shadow: var(--shadow-lg), var(--glow-gold);
}

.module-card:hover {
    transform: translateY(-6px);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-lg), var(--glow-cyan);
}

/* Module Image */
.module-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    /* Keep image cinematic */
    height: auto;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.1), rgba(139, 92, 246, 0.1));
    flex-shrink: 0;
}

.module-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #0d1117;
    transition: transform var(--transition-slow);
}

.module-card:hover .module-image {
    transform: scale(1.05);
}

.module-image-overlay {
    display: none;
    /* No overlay needed */
}

.module-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.1), rgba(139, 92, 246, 0.1));
}

.module-content {
    position: relative;
    width: 100%;
    padding: var(--space-4);
    z-index: 2;
    display: flex;
    flex-direction: column;
    background: transparent;
}

.module-header {
    display: none;
}

/* Hide description and CTA */
.module-description,
.module-cta,
.module-stats {
    display: none;
}

.module-title {
    font-size: var(--text-base);
    font-weight: 600;
    margin-bottom: var(--space-3);
    line-height: 1.4;
    color: var(--text-primary);
    text-shadow: none;
    /* Limit lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.module-progress {
    margin-bottom: 0;
}

/* Hide description and CTA for cinematic view */
.module-description,
.module-cta,
.module-stats {
    display: none;
}

.module-title {
    font-size: var(--text-lg);
    font-weight: 700;
    margin-bottom: var(--space-2);
    line-height: 1.3;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.module-progress {
    margin-bottom: 0;
    /* Remove bottom margin */
}

.module-number {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.module-title {
    font-size: var(--text-lg);
    font-weight: 600;
    margin-bottom: var(--space-2);
    line-height: 1.3;
}

.module-description {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-4);
    flex: 1;
    line-height: 1.5;
}

.module-progress {
    margin-bottom: var(--space-4);
}

.module-stats {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-bottom: var(--space-4);
}

.module-cta {
    width: 100%;
}

/* ============================================
   LESSON CARDS
   ============================================ */
.lesson-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: var(--space-4);
    margin-bottom: var(--space-3);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    transition: all var(--transition-base);
    cursor: pointer;
    backdrop-filter: blur(10px);
    /* GPU Acceleration fixes for backdrop-filter rendering bugs */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform;
    isolation: isolate;
}

.lesson-card:hover {
    background: var(--glass-bg-light);
    border-color: rgba(255, 255, 255, 0.15);
}

.lesson-card.active {
    border-color: var(--accent-primary);
    background: rgba(0, 217, 255, 0.05);
    box-shadow: var(--glow-cyan);
}

.lesson-card.playing .btn-assistir {
    display: none !important;
}

.lesson-card.completed {
    opacity: 0.6;
}

.lesson-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--accent-primary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
    flex-shrink: 0;
}

.lesson-checkbox.checked {
    background: var(--success);
    border-color: var(--success);
}

.lesson-checkbox.checked::after {
    content: '✓';
    color: white;
    font-weight: 700;
    font-size: 12px;
}

.lesson-info {
    flex: 1;
}

.lesson-title {
    font-size: var(--text-base);
    font-weight: 600;
    margin-bottom: 2px;
}

.lesson-status {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.lesson-duration {
    font-size: var(--text-sm);
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ============================================
   VIDEO PLAYER
   ============================================ */
.video-player-container {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: var(--space-6);
    margin-bottom: var(--space-8);
    backdrop-filter: blur(10px);
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.video-iframe-wrapper {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto var(--space-6);
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--border-radius-lg);
}

.video-iframe-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: var(--border-radius-lg);
}

.btn-concluir {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    display: flex;
}

/* ============================================
   AUTH PAGES
   ============================================ */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
    background: var(--bg-primary);
    background-image:
        radial-gradient(circle at 30% 20%, rgba(0, 217, 255, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(139, 92, 246, 0.08) 0%, transparent 50%);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-xl);
    padding: var(--space-8);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-lg), var(--glow-subtle);
}

.auth-logo {
    text-align: center;
    margin-bottom: var(--space-8);
}

.auth-logo h1 {
    font-size: var(--text-3xl);
    font-weight: 700;
    margin: 0;
}

.auth-logo span {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-title {
    text-align: center;
    margin-bottom: var(--space-6);
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

.alert {
    padding: var(--space-4);
    border-radius: var(--border-radius-md);
    margin-bottom: var(--space-6);
    font-size: var(--text-sm);
    border: 1px solid;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error);
    color: var(--error);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
    color: var(--success);
}

.auth-footer {
    text-align: center;
    margin-top: var(--space-6);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* ============================================
   MODULE BANNER
   ============================================ */
.module-banner {
    position: relative;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-xl);
    padding: var(--space-8);
    margin-bottom: var(--space-8);
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform;
}

.module-banner-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
}

.module-banner-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.2;
}

.module-banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.05), rgba(139, 92, 246, 0.05));
    z-index: 1;
}

.module-banner-content {
    position: relative;
    z-index: 2;
}

.module-banner-header {
    display: flex;
    align-items: center;
    gap: var(--space-6);
    margin-bottom: var(--space-6);
}

.module-banner-icon {
    font-size: 72px;
    filter: drop-shadow(var(--glow-cyan));
}

.module-banner-info {
    flex: 1;
}

.module-banner-title {
    font-size: var(--text-3xl);
    font-weight: 700;
    margin-bottom: var(--space-2);
}

.module-banner-description {
    font-size: var(--text-base);
    color: var(--text-secondary);
    margin-bottom: var(--space-4);
}

.module-banner-stats {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* ============================================
   RESPONSIVE
/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        background: var(--bg-secondary);
        z-index: 1200;
        /* Higher than header (100) */
        box-shadow: var(--shadow-xl);
        top: 0;
        /* Cover full height on mobile */
        height: 100vh;
        width: 280px;
        /* Fixed width on mobile for consistency */
    }

    .sidebar.active {
        transform: translateX(0);
    }

    /* Ensure close button or specific header for sidebar exists if needed, 
       otherwise user clicks overlay to close */

    .sidebar-overlay {
        z-index: 1150;
        /* Between header and sidebar */
    }

    .main-content {
        margin-left: 0;
    }

    .stats-grid,
    .modules-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.continue-watching-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    /* Allow wider cards */
    gap: var(--space-6);
}

.continue-watching-content {
    display: flex;
    /* Ensure flex is active */
    flex-direction: row;
    align-items: center;
    gap: var(--space-6);
    /* More gap */
}

.continue-btn {
    flex-shrink: 0;
    /* Don't shrink button */
    padding-left: var(--space-6);
    padding-right: var(--space-6);
}


.module-icon-large {
    font-size: 32px;
}

.page-header-gap {
    margin-top: 40px;
}

.mb-sm {
    margin-bottom: var(--space-2);
}

.mb-xs {
    margin-bottom: var(--space-1);
}

@media (max-width: 768px) {
    .main-content {
        padding: var(--space-4);
        /* Reduzir espaçamento no mobile */
        padding-top: var(--space-5);
    }

    .continue-watching-section {
        margin-bottom: 80px;
        /* Increased from default/var(--space-8) to separate sections more */
    }

    .continue-watching-title {
        margin-top: var(--space-6);
    }

    .continue-watching-grid {
        grid-template-columns: 1fr;
        /* Stack vertically on mobile */
    }

    .continue-watching-content {
        flex-direction: column;
        /* Stack content vertically */
        align-items: flex-start;
        text-align: left;
    }

    .continue-btn {
        width: 100%;
        margin-top: var(--space-4);
        /* More space for button */
    }

    .page-header-gap {
        margin-top: var(--space-6);
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-4);
    }

    .header {
        padding: 0 var(--space-4);
        justify-content: center;
        /* Center everything if needed, but we use flex */
        position: relative;
    }

    .header-start {
        position: static;
        /* Let toggle button sit naturally */
    }

    .sidebar-toggle {
        position: absolute;
        left: var(--space-4);
        top: 50%;
        transform: translateY(-50%);
        z-index: 1002;
    }

    .header-logo {
        margin: 0 auto !important;
        /* Center logo absolutely */
        text-align: center;
    }

    .header-user {
        position: absolute;
        right: var(--space-4);
        top: 50%;
        transform: translateY(-50%);
    }

    .main-content {
        padding: var(--space-4);
        margin-top: 60px;
        /* Ensure content doesn't hide behind fixed header if applicable */
    }

    .stats-grid,
    .modules-grid {
        grid-template-columns: 1fr;
    }

    .auth-card {
        padding: var(--space-5);
        /* Reduced padding for mobile */
        margin: 0 var(--space-4);
        /* Ensure side margin */
        width: auto;
        /* Allow card to shrink if needed */
        max-width: 100%;
    }

    .auth-container {
        padding: var(--space-4);
        align-items: flex-start;
        /* Better for tall screens or keyboard open */
        padding-top: 10vh;
        /* Visual balance */
    }

    .auth-logo h1 {
        font-size: var(--text-2xl);
        /* Smaller logo font */
    }

    .auth-logo {
        margin-bottom: var(--space-6);
        /* Less gap */
    }


}


@media (max-width: 480px) {
    .header-logo {
        font-size: var(--text-base);
        /* Smaller font */
        gap: var(--space-2);
        /* Tighter gap */
    }

    .header-logo i {
        font-size: 18px;
        /* Smaller icon */
    }

    /* Don't hide the span - keep "Imersão" visible */
    .header-logo span {
        display: inline;
    }

    .header-user {
        display: none !important;
        /* Hide header logout on mobile */
    }

    .stats-card {
        padding: var(--space-4);
    }

    .stat-number {
        font-size: var(--text-2xl);
    }

    /* Module Banner Mobile Adjustments */
    .module-banner {
        padding: var(--space-5);
    }

    .module-banner-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-4);
    }

    .module-banner-icon {
        font-size: 48px;
        /* Smaller icon */
    }

    .module-banner-title {
        font-size: var(--text-xl);
        /* Smaller title */
        line-height: 1.3;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .module-banner-description {
        font-size: var(--text-sm);
        line-height: 1.5;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .module-banner-stats {
        font-size: var(--text-xs);
    }

    /* Lesson Cards Mobile */
    .lesson-card {
        padding: var(--space-3);
        flex-wrap: wrap;
    }

    .lesson-title {
        font-size: var(--text-sm);
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .lesson-status {
        font-size: 11px;
    }

    .lesson-duration {
        font-size: var(--text-xs);
    }

    .btn-assistir {
        font-size: var(--text-xs);
        padding: var(--space-2) var(--space-3);
    }

    /* Admin Page Header Mobile */
    .admin-header {
        flex-direction: column;
        align-items: stretch !important;
        gap: var(--space-4);
    }

    .admin-header-content {
        text-align: center;
    }

    .admin-title {
        font-size: var(--text-xl) !important;
        line-height: 1.3;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .admin-subtitle {
        font-size: var(--text-sm);
        line-height: 1.5;
    }

    .admin-add-btn {
        width: 100%;
        justify-content: center;
        font-size: var(--text-sm);
    }
}

/* Sidebar Footer */
.sidebar {
    display: flex;
    flex-direction: column;
}

.sidebar-header-mobile {
    display: none;
    /* Hidden on desktop */
    align-items: center;
    justify-content: space-between;
    padding-bottom: var(--space-4);
    margin-bottom: var(--space-4);
    border-bottom: 1px solid var(--glass-border);
}

.sidebar-header-mobile .logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.sidebar-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
}

.sidebar-menu {
    flex: 1;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: var(--space-4);
    border-top: 1px solid var(--glass-border);
}

.logout-link {
    color: var(--error) !important;
}

.logout-link:hover {
    background: rgba(239, 68, 68, 0.1) !important;
}

/* Fix Header Mobile Alignment */
@media (max-width: 768px) {

    /* Mobile Content Spacing Fix */
    .main-content {
        padding: var(--space-4);
        padding-top: var(--space-2) !important;
    }

    .header {
        justify-content: center;
        /* Center logo */
        padding: 0 var(--space-4);
    }

    .header-start {
        width: 100%;
        justify-content: center;
    }

    .header-logo {
        margin: 0 !important;
    }

    /* Increase specificity to override .header-start .sidebar-toggle */
    .header-start .sidebar-toggle {
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        bottom: auto;
        width: 48px;
        height: 48px;
        margin: 0;
        z-index: 102;
        /* Above everything in header */
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        border-right: none;
        border-radius: 0 8px 8px 0;
        /* Slight rounding on right */
    }

    /* Show internal header on mobile */
    .sidebar-header-mobile {
        display: flex;
    }
}

/* ============================================
   CELEBRATION OVERLAY
   ============================================ */
.celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    /* Mais sutil (30%) */
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s;
    pointer-events: none;
}

.celebration-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.celebration-content {
    background: var(--bg-secondary);
    border: 1px solid var(--accent-primary);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    position: relative;
    /* Para posicionar o botão X */
    transform: scale(0.8);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    max-width: 400px;
    width: 90%;
}

.celebration-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.celebration-close:hover {
    color: var(--text-primary);
}

.celebration-overlay.active .celebration-content {
    transform: scale(1);
}

.celebration-icon {
    font-size: 60px;
    margin-bottom: 20px;
    animation: bounce 1s infinite alternate;
}

@keyframes bounce {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-10px);
    }
}

.celebration-content h2 {
    font-size: 28px;
    margin-bottom: 10px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.celebration-content p {
    color: var(--text-secondary);
    font-size: 16px;
}

/* ============================================
   MOBILE OPTIMIZATIONS - LESSON PAGE
   ============================================ */
@media (max-width: 768px) {

    /* Full Width Video Player */
    #dynamic-video-container {
        width: 100vw !important;
        max-width: 100vw !important;
        margin-left: calc(-50vw + 50%) !important;
        margin-right: calc(-50vw + 50%) !important;
        margin-top: 20px !important;
        margin-bottom: 24px !important;
        border-radius: 0 !important;
        border: none !important;
        padding: 0 !important;
        /* Remove internal padding */
        background: #000 !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
    }

    #dynamic-video-container .video-iframe-wrapper {
        border-radius: 0 !important;
        margin-bottom: 0 !important;
    }

    /* Player Controls (Button below video) */
    #dynamic-video-container>div:last-child {
        padding: 12px 16px !important;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--glass-border);
        justify-content: space-between !important;
        border-radius: 0 !important;
    }

    /* Mobile Lesson Cards */
    .lesson-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px !important;
        gap: 12px !important;
    }

    .lesson-card .lesson-checkbox {
        position: absolute;
        top: 20px;
        right: 20px;
    }

    .lesson-info {
        width: 100%;
        padding-right: 40px;
        /* Space for checkbox */
    }

    .lesson-title {
        font-size: 18px !important;
        margin-bottom: 6px !important;
        line-height: 1.4;
    }

    /* Assistir Button - Bigger on Mobile */
    .btn-assistir {
        width: 100%;
        display: flex;
        justify-content: center;
        padding: 16px !important;
        font-size: 15px !important;
        margin-top: 8px;
    }

    /* Status Text */
    .lesson-status {
        font-size: 14px !important;
    }

    .lesson-duration {
        font-size: 13px !important;
        margin-bottom: 4px;
        color: var(--accent-primary);
    }
}