/* style.css - COMPLETO (Login Pro + Dashboard + Player) */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;800&display=swap');

:root {
    --primary-purple: #4a0080;
    --dark-purple: #1a0b2e;
    --neon-glow: rgba(138, 43, 226, 0.6);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --active-border: #ffffff;
    --text-color: #ffffff;
    --logo-gradient: linear-gradient(to bottom, #FFD700, #FF8C00);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; }

/* Configuração Padrão do Body (Dashboard) */
body {
    background-color: var(--dark-purple);
    background: 
        radial-gradient(circle at 20% 50%, rgba(76, 0, 130, 0.6) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(138, 43, 226, 0.4) 0%, transparent 50%),
        linear-gradient(to bottom, #240046, #0f001e);
    height: 100vh;
    width: 100vw;
    color: var(--text-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* =========================================
   ESTILOS EXCLUSIVOS DA TELA DE LOGIN
   ========================================= */

/* Fundo Imersivo (Sobrescreve o body padrão) */
body.login-page {
    background: #0f0c29;
    /* Imagem de fundo estilo Streaming com overlay escuro */
    background: 
        linear-gradient(to bottom, rgba(15, 12, 41, 0.9), rgba(48, 43, 99, 0.85)),
        url('https://assets.nflxext.com/ffe/siteui/vlv3/f841d4c7-10e1-40af-bcae-07a3f8dc141a/f6d7434e-d6de-4185-a6d4-c77a2d08737b/US-en-20220502-popsignuptwoweeks-perspective_alpha_website_medium.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    justify-content: center;
    align-items: center;
}

.login-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 3rem;
    border-radius: 20px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    text-align: center;
    position: relative;
    animation: fadeIn 0.8s ease-out;
}

/* Logo na tela de login */
.login-card .logo-area h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 5px;
    background: linear-gradient(to right, #ffffff, #a8a8a8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 2px;
}
.login-card .logo-area p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

/* Inputs da Tela de Login */
.input-group {
    position: relative;
    margin-bottom: 20px;
    text-align: left;
}
.input-group i {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
    z-index: 2;
}
.input-group input, .input-group select {
    width: 100%;
    padding: 15px 15px 15px 45px; /* Espaço para ícone */
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    outline: none;
    font-size: 1rem;
    transition: 0.3s;
}
.input-group select {
    appearance: none;
    cursor: pointer;
}
.input-group input:focus, .input-group select:focus {
    border-color: #00ffca;
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 15px rgba(0, 255, 202, 0.2);
}

/* Botão de Login */
.login-btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    margin-top: 10px;
    transition: 0.3s;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}
.login-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(37, 117, 252, 0.4);
}

/* Rodapé do Card de Login */
.card-footer {
    margin-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1rem;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
}
.admin-link {
    display: inline-block;
    margin-top: 10px;
    color: rgba(255,255,255,0.3);
    text-decoration: none;
}
.admin-link:hover { color: #fff; }

.error-msg {
    background: rgba(255, 75, 75, 0.2);
    color: #ff4b4b;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 75, 75, 0.3);
}

/* =========================================
   ESTILOS DO DASHBOARD / PLAYER
   ========================================= */

/* Topo / Header */
.header-area {
    flex: 0 0 auto; /* Não esticar */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
}

.logo-text {
    font-size: 3.5rem;
    font-weight: 800;
    text-transform: uppercase;
    background: var(--logo-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0px 0px 10px rgba(255, 140, 0, 0.5);
    letter-spacing: 2px;
}
.logo-plus {
    color: #FFD700;
    -webkit-text-fill-color: #FFD700;
    font-size: 4.5rem;
    vertical-align: middle;
    margin-left: -5px;
    text-shadow: 0 0 15px #FF8C00;
}

/* Container Principal Centralizado */
.app-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.menu-container {
    flex: 1; 
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    padding-bottom: 80px; 
    z-index: 10;
    flex-wrap: wrap;
}

.menu-card {
    width: 160px;
    height: 160px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.menu-card i {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: #fff;
    filter: drop-shadow(0 0 5px rgba(255,255,255,0.5));
}
.menu-card span { font-size: 1.1rem; font-weight: 600; letter-spacing: 0.5px; }

/* Ícones Coloridos */
.icon-orange { color: #FFA500 !important; }
.icon-yellow { color: #FFD700 !important; }
.icon-blue { color: #00BFFF !important; }

/* Hover e Active */
.menu-card:hover, .menu-card.active {
    border: 3px solid var(--active-border);
    background: rgba(74, 0, 128, 0.6);
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.8);
}

/* Rodapé do Dashboard */
.footer-area {
    flex: 0 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 20px 50px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    background: linear-gradient(to top, #0f001e, transparent);
}

.reload-btn {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 10px 40px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
}
.reload-btn:hover { background: rgba(255,255,255,0.3); }

/* Interfaces Internas (TV e VOD) */
.tv-interface, .vod-interface {
    display: none;
    height: calc(100vh - 100px); /* Ajuste de altura */
    padding: 10px;
    gap: 15px;
}

.tv-interface { display: none; }
.vod-interface { display: none; }

.col-categories {
    flex: 0 0 250px;
    background: rgba(0,0,0,0.4);
    border-radius: 10px;
    overflow-y: auto;
    border: 1px solid rgba(255,255,255,0.05);
}
.col-channels {
    flex: 0 0 350px;
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    overflow-y: auto;
    border: 1px solid rgba(255,255,255,0.05);
}
.col-player {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

/* List Items */
.list-item {
    padding: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    cursor: pointer;
    color: #ccc;
    font-size: 0.9rem;
    transition: 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.list-item:hover { background: rgba(255,255,255,0.1); color: white; }
.list-item.active {
    background: #fff;
    color: #000;
    font-weight: bold;
    border-radius: 5px;
    margin: 5px;
}

/* Grid de Filmes */
.vod-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    padding: 10px;
    overflow-y: auto;
    height: 100%;
}
.vod-poster {
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: 8px;
    overflow: hidden;
    background: #222;
    transition: transform 0.3s;
    border: 1px solid transparent;
}
.vod-poster img { width: 100%; height: 100%; object-fit: cover; }
.vod-poster:hover { transform: scale(1.05); border-color: #fff; z-index: 2; }
.vod-title {
    font-size: 0.8rem;
    text-align: center;
    margin-top: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #ddd;
}

/* =========================================
   MODAIS (DETALHES E PLAYER)
   ========================================= */

/* Modal de Detalhes (Filme/Série) */
.details-modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(10, 5, 20, 0.98);
    z-index: 2000;
    overflow-y: auto;
    backdrop-filter: blur(15px);
}
.details-content {
    max-width: 1100px;
    margin: 80px auto;
    display: flex;
    gap: 50px;
    padding: 20px;
    animation: slideUp 0.4s ease-out;
}
.details-poster {
    width: 300px;
    height: 450px;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 0 40px rgba(0,0,0,0.8);
    border: 1px solid rgba(255,255,255,0.1);
}
.details-info { flex: 1; }
.details-info h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    color: #fff;
    text-shadow: 0 0 20px rgba(255,255,255,0.1);
}
.details-meta {
    display: flex; gap: 15px;
    color: #00ffca;
    font-weight: bold;
    margin-bottom: 20px;
}
.details-plot {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #ccc;
    margin-bottom: 30px;
    max-width: 800px;
}
.play-btn-large {
    background: linear-gradient(135deg, #ff00cc, #333399);
    border: none;
    color: white;
    padding: 15px 50px;
    font-size: 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: 0.3s;
}
.play-btn-large:hover { transform: scale(1.05); box-shadow: 0 0 30px rgba(255, 0, 204, 0.6); }

/* Abas de Temporada */
.seasons-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.season-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.1);
    color: #ccc;
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
}
.season-btn:hover, .season-btn.active {
    background: #009FFD;
    color: white;
    border-color: #009FFD;
}

/* Modal Player VOD */
#vod-player-modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}
#vod-player-modal[style*="display: flex"] { display: flex !important; }

.vod-player-wrapper {
    width: 80%;
    max-width: 1100px;
    aspect-ratio: 16/9;
    background: #000;
    position: relative;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
}
.close-vod-btn {
    position: absolute;
    top: -40px; right: 0;
    background: #ff0000;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    z-index: 10000;
}
.close-vod-btn:hover { background: #cc0000; }
#vod-player-element { width: 100%; height: 100%; }

/* Mobile Responsive Geral */
@media (max-width: 768px) {
    .menu-container { flex-direction: column; overflow-y: auto; }
    .details-content { flex-direction: column; align-items: center; margin-top: 20px; }
    .details-poster { width: 180px; height: 270px; }
    .details-info h1 { font-size: 1.8rem; text-align: center; }
    .tv-interface, .vod-interface { flex-direction: column; }
    .col-categories, .col-channels { flex: none; height: 150px; }
    .login-card { padding: 2rem; width: 90%; }
}

@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
/* --- CORREÇÃO DE LAYOUT: MODO COMPACTO --- */
/* Quando a classe .compact-mode é adicionada ao body via JS */
body.compact-mode .header-area {
    padding: 5px 20px;
    height: 60px; /* Altura fixa pequena */
    background: rgba(0,0,0,0.6);
    justify-content: flex-start; /* Alinha a esquerda */
    backdrop-filter: blur(10px);
    position: fixed; /* Fixa no topo */
    top: 0; width: 100%; z-index: 100;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

body.compact-mode .logo-text { font-size: 1.5rem; margin-left: 10px; cursor: pointer; }
body.compact-mode .logo-plus { font-size: 2rem; }

body.compact-mode .app-container {
    padding-top: 70px; /* Espaço para não ficar debaixo do header fixo */
    height: 100vh;
}

body.compact-mode .tv-interface, 
body.compact-mode .vod-interface {
    height: 100%; /* Ocupa toda altura restante */
    padding: 0 10px 10px 10px;
}

/* Ajuste das listas para ocupar a altura correta */
.col-categories, .col-channels, .vod-grid {
    height: calc(100vh - 80px) !important; /* Força altura total menos o topo */
}

/* --- MINIPLAYER FLUTUANTE (PIP) - CORRIGIDO --- */
#mini-player-wrapper {
    display: none;
    position: fixed; /* OBRIGATÓRIO */
    bottom: 20px;
    right: 20px;
    width: 400px;
    height: 225px;
    background: #000;
    
    /* SOMBRA E BORDA PARA DESTAQUE */
    box-shadow: 0 0 100px rgba(0,0,0,1);
    border: 2px solid #00ffca;
    
    /* CAMADA SUPERIOR EXTREMA */
    z-index: 2147483647 !important; /* Valor máximo possível no CSS */
    
    flex-direction: column;
    overflow: hidden;
    animation: popUp 0.3s ease-out forwards; /* Animação suave */
}

@keyframes popUp {
    from { transform: scale(0.8) translateY(50px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

/* Header do Miniplayer (SEMPRE VISÍVEL AGORA) */
.mini-player-header {
    background: rgba(0,0,0,0.9);
    padding: 8px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: absolute;
    top: 0; width: 100%;
    z-index: 10;
    opacity: 1 !important; /* Força visibilidade para os botões funcionarem */
}

/* Botões do Miniplayer */
.mini-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    cursor: pointer;
    font-size: 1rem;
    margin-left: 5px;
    width: 30px; 
    height: 30px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}
.mini-btn:hover { background: white; color: black; }

/* Classe expandida (Tela Cheia) */
#mini-player-wrapper.expanded {
    bottom: 0 !important; 
    right: 0 !important;
    width: 100vw !important; 
    height: 100vh !important;
    border: none;
    border-radius: 0;
}

#mini-video-element {
    width: 100%;
    height: 100%;
    background: black;
    object-fit: contain; /* Garante que o vídeo não corte */
}

/* Garante que o botão de fechar modal (X) funcione */
.close-vod-btn {
    z-index: 999999 !important;
    cursor: pointer;
}
#mini-player-wrapper.expanded video { object-fit: contain; }

#mini-video-element { width: 100%; height: 100%; background: black; object-fit: cover; }
/* --- MODAL DE CONTA (PLAYLISTS) --- */
.account-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 15px;
    padding: 30px;
    max-width: 500px;
    margin: 100px auto;
    text-align: center;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
    position: relative;
}
.account-info-row {
    background: rgba(0,0,0,0.3);
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}
.account-label { color: #aaa; font-weight: 600; }
.account-value { color: #fff; font-weight: bold; font-family: monospace; letter-spacing: 1px; }

/* --- MODAL DE CONFIGURAÇÕES (SETTINGS) --- */
.settings-content {
    max-width: 800px;
    margin: 60px auto;
    background: #1a0b2e; /* Roxo escuro sólido */
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 0 60px rgba(0,0,0,0.8);
}
.settings-header {
    background: linear-gradient(90deg, #4a0080, #240046);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.settings-list {
    padding: 0;
    list-style: none;
    max-height: 60vh;
    overflow-y: auto;
}
.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: 0.2s;
}
.setting-item:hover { background: rgba(255,255,255,0.03); }
.setting-info h4 { color: #fff; margin-bottom: 5px; }
.setting-info p { color: #888; font-size: 0.8rem; }

/* Toggle Switch (Botão Ligar/Desligar) */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #444;
    transition: .4s;
    border-radius: 34px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider { background-color: #00ffca; }
input:checked + .slider:before { transform: translateX(24px); }

