/* --- VARIÁVEIS DE CORES --- */
:root {
    --bg-color: #0f0f0f;
    --sidebar-color: #1a1a1a;
    --header-color: #121212;
    --text-color: #ffffff;
    --accent-color: #3ea6ff; 
    --whatsapp-color: #25d366; 
    --header-height: 80px; 
}

/* --- RESET E BASE --- */
* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- TELA DE LOGIN (CORRIGIDA PARA MOBILE) --- */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100svh; /* Evita rolagem no mobile */
    padding: 20px;
    overflow: hidden; 
    position: relative;
    background-color: var(--bg-color);
}

.login-card {
    background: var(--sidebar-color);
    padding: 40px 30px;
    border-radius: 20px;
    width: 90%;          /* Garante respiro lateral no mobile */
    max-width: 360px;    /* Mantém elegante no desktop */
    text-align: center;
    border: 1px solid rgba(62, 166, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: glow-pulse 3s infinite ease-in-out;
    z-index: 2;
}

@keyframes glow-pulse {
    0%, 100% { box-shadow: 0 0 5px rgba(62, 166, 255, 0.2); }
    50% { box-shadow: 0 0 20px rgba(62, 166, 255, 0.4); transform: translateY(-3px); }
}

.login-logo { 
    max-width: 220px; 
    width: 100%;
    height: auto; 
    margin-bottom: 20px; 
    object-fit: contain; 
}

.login-title { font-weight: 400; margin-bottom: 25px; font-size: 1.4rem; }

.login-card input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border-radius: 8px;
    border: 1px solid #333;
    background: #f0f4f9;
    color: #333;
    font-size: 16px; /* Impede zoom automático no iOS */
}

.btn-entrar {
    width: 100%;
    padding: 14px;
    background: var(--accent-color);
    border: none;
    color: white;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 15px;
    transition: filter 0.2s;
}

.btn-entrar:hover { filter: brightness(1.1); }

/* --- COPYRIGHT (LINHA ÚNICA CENTRALIZADA) --- */
.login-footer {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    text-align: center;
}

.login-footer p {
    color: rgba(255, 255, 255, 0.3);
    margin: 0;
    white-space: nowrap;
    font-size: 11px;
    letter-spacing: 0.3px;
}

/* --- CABEÇALHO DA PLATAFORMA --- */
header {
    min-height: var(--header-height);
    background-color: var(--header-color);
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid #333;
    justify-content: space-between;
}

.logo { height: 50px; width: auto; }
.header-actions { display: flex; gap: 10px; }

.help-btn {
    text-decoration: none;
    background-color: var(--whatsapp-color);
    color: white;
    padding: 10px 18px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.8rem;
}

#logoutBtn {
    padding: 10px 18px;
    background: transparent;
    border: 1.5px solid var(--accent-color);
    color: var(--accent-color);
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
}

/* --- CONTEÚDO PRINCIPAL --- */
.main-container {
    display: flex;
    flex: 1;
    height: calc(100vh - var(--header-height)); 
}

main { flex: 1; padding: 20px; overflow-y: auto; }

.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

.video-container iframe {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    border: none;
}

/* --- PLAYLIST --- */
aside {
    width: 350px;
    background-color: var(--sidebar-color);
    border-left: 1px solid #333;
    display: flex;
    flex-direction: column;
}

aside h2 { padding: 20px; font-size: 1rem; border-bottom: 1px solid #333; margin: 0; }
.playlist { overflow-y: auto; flex: 1; }

.video-item {
    display: flex;
    gap: 12px;
    padding: 15px;
    cursor: pointer;
    border-bottom: 1px solid #222;
}

.video-item.active { background-color: #1e2d40; border-left: 4px solid var(--accent-color); }
.video-item img { width: 100px; border-radius: 4px; aspect-ratio: 16/9; object-fit: cover; }

/* --- CARD DE CERTIFICADO (PLAYLIST) --- */
.certificado-item { background: rgba(218, 165, 32, 0.1); border-top: 1px solid rgba(218, 165, 32, 0.3); }
.certificado-item h4 { color: #daa520; margin: 0; }
.icon-cert { font-size: 25px; min-width: 100px; height: 56px; display: flex; align-items: center; justify-content: center; background: #222; border-radius: 4px; }

/* --- MODAL (POP-UP) --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9); display: none; justify-content: center; align-items: center; z-index: 9999; backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--sidebar-color);
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    border: 1px solid var(--accent-color);
}

.modal-content input {
    width: 100%; padding: 12px; margin: 15px 0; border-radius: 8px; border: none; font-size: 16px;
}

.btn-gerar {
    width: 100%; background: var(--whatsapp-color); color: white; padding: 15px; border-radius: 8px; border: none; font-weight: bold; cursor: pointer;
}

.btn-fechar { background: transparent; border: none; color: #777; cursor: pointer; text-decoration: underline; margin-top: 10px; }

/* --- RESPONSIVIDADE MOBILE --- */
@media (max-width: 1024px) {
    header { flex-direction: column; height: auto; padding: 15px; gap: 10px; }
    .main-container { flex-direction: column; height: auto; }
    aside { width: 100%; border-left: none; }
    .login-footer p { font-size: 10px; }
}