* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; }
body { background-color: #0b0f19; color: #f8fafc; display: flex; height: 100vh; overflow: hidden; }

/* --- SIDEBAR --- */
.sidebar { 
    width: 320px; 
    background-color: #111827; 
    height: 100vh; 
    overflow-y: auto; 
    border-right: 1px solid #1f2937; 
    transition: width 0.3s ease, min-width 0.3s ease, transform 0.3s ease;
    display: flex;
    flex-direction: column;
}
.sidebar.collapsed { width: 0; min-width: 0; border: none; overflow: hidden; }

.sidebar-header { 
    padding: 20px; 
    background-color: #0b0f19; 
    border-bottom: 1px solid #1f2937; 
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700; 
    font-size: 1.1rem; 
    color: #e2e8f0;
    white-space: nowrap;
}

/* Novo Botão de Fechar o Menu (Interno) */
.close-menu-btn {
    background: transparent;
    color: #94a3b8;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 2px 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.close-menu-btn:hover { background: #ef4444; color: white; border-color: #ef4444; }

.modulo { margin-bottom: 5px; }
.modulo-title { 
    background-color: #1f2937; 
    padding: 12px 20px; 
    font-weight: 600; 
    font-size: 0.85rem; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    color: #94a3b8; 
    white-space: nowrap;
}
.aula-item { 
    padding: 15px 20px; 
    border-bottom: 1px solid #1f2937; 
    cursor: pointer; 
    transition: all 0.2s; 
    font-size: 0.95rem; 
    color: #cbd5e1;
    display: flex;
    align-items: center;
    white-space: nowrap;
}
.aula-item::before { content: '▶'; font-size: 0.7rem; margin-right: 10px; color: #475569; transition: 0.2s; }
.aula-item:hover { background-color: #1e293b; color: #fff; }
.aula-item:hover::before { color: #3b82f6; }
.aula-item.active { background-color: #2563eb; color: white; border-left: 4px solid #60a5fa; }
.aula-item.active::before { color: #fff; }

/* --- CONTEÚDO PRINCIPAL --- */
.main-content { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    overflow-y: auto; 
    position: relative;
    background-color: #0b0f19;
}

/* Botão Flutuante do Menu (Externo) */
.toggle-menu-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 110;
    background: rgba(15, 23, 42, 0.7);
    color: white;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
}
.toggle-menu-btn:hover { background: #3b82f6; border-color: #3b82f6; }

/* Vídeo */
.video-container { 
    background-color: #000; 
    width: 100%; 
    max-height: 70vh;
    aspect-ratio: 16/9; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.video-container video { width: 100%; height: 100%; outline: none; }

/* Informações da Aula e Controles */
.aula-info-wrapper { padding: 40px; max-width: 1100px; margin: 0 auto; width: 100%; }

.aula-header-controls {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 25px;
    border-bottom: 1px solid #1f2937;
    padding-bottom: 25px;
}

.aula-info { flex: 1; margin-right: 20px; }
.aula-info h1 { font-size: 2rem; margin-bottom: 10px; color: #f8fafc; font-weight: 700; }
.aula-info .descricao { color: #94a3b8; line-height: 1.7; font-size: 1.05rem; }
.aula-info a { color: #3b82f6; text-decoration: none; font-weight: 500; }
.aula-info a:hover { text-decoration: underline; color: #60a5fa; }

/* Botões de Navegação */
.nav-buttons { display: flex; gap: 10px; }
.btn-nav {
    background-color: #1e293b;
    color: #e2e8f0;
    border: 1px solid #334155;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.btn-nav:hover { background-color: #334155; color: #fff; }
.btn-nav:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-nav.primary { background-color: #2563eb; color: white; border-color: #2563eb; }
.btn-nav.primary:hover { background-color: #1d4ed8; }

/* Scrollbar Bonita */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #0f172a; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

/* Lógica de Admin */
.admin-login { display: flex; justify-content: center; align-items: center; width: 100%; height: 100vh; }
.login-box { background: #1e293b; padding: 40px; border-radius: 8px; width: 350px; text-align: center; }
.login-box input { width: 100%; padding: 12px; margin: 10px 0; border-radius: 4px; border: 1px solid #334155; background: #0f172a; color: white; }
.btn { background: #3b82f6; color: white; padding: 12px 20px; border: none; border-radius: 4px; cursor: pointer; font-weight: bold; width: 100%; transition: 0.2s; }
.btn:hover { background: #2563eb; }
.btn-danger { background: #ef4444; width: auto; padding: 8px 12px; font-size: 0.8rem; }
.btn-danger:hover { background: #dc2626; }
.admin-panel { padding: 40px; width: 100%; max-width: 1200px; margin: 0 auto; overflow-y: auto; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; padding-bottom: 20px; border-bottom: 1px solid #334155; }
.admin-card { background: #1e293b; padding: 25px; border-radius: 8px; margin-bottom: 30px; border: 1px solid #334155; }
.admin-card h3 { margin-bottom: 15px; color: #3b82f6; }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-size: 0.9rem; color: #94a3b8; }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: 10px; border-radius: 4px; border: 1px solid #334155; background: #0f172a; color: white; }

/* OTIMIZAÇÃO PARA DISPOSITIVOS MÓVEIS */
@media (max-width: 768px) {
    .sidebar {
        position: absolute;
        z-index: 100;
        width: 280px;
        box-shadow: 2px 0 15px rgba(0,0,0,0.7);
    }
    
    .sidebar.collapsed {
        width: 0;
        min-width: 0;
    }
    
    .toggle-menu-btn {
        top: 10px;
        left: 10px;
        padding: 6px 10px;
        font-size: 1.1rem;
    }

    .aula-header-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
        padding-bottom: 15px;
        margin-bottom: 15px;
    }

    .aula-info-wrapper { padding: 20px 15px; }
    .aula-info { margin-right: 0; }
    .aula-info h1 { font-size: 1.4rem; }
    .aula-info .descricao { font-size: 0.95rem; }

    .nav-buttons { width: 100%; display: flex; gap: 10px; }
    .btn-nav { flex: 1; justify-content: center; font-size: 0.85rem; padding: 12px 5px; }

    .admin-panel { padding: 15px; }
    .admin-panel > div[style*="display:flex"] { flex-direction: column !important; gap: 15px !important; }
    .admin-header { flex-direction: column; align-items: stretch; text-align: center; gap: 15px; }
    .admin-header div { display: flex; flex-direction: column; gap: 10px; }
    .admin-header a { margin: 0 !important; text-align: center; }
    .login-box { width: 90%; padding: 20px; }
}