:root {
    --bg-color: #f8f9fa;
    --text-color: #212529;
    --card-bg: #ffffff;
    --accent-color: #007bff;
    --nav-bg: #ffffff;
    --ad-bg: #e9ecef;
}

body.dark-mode {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --card-bg: #1e1e1e;
    --accent-color: #3786ff;
    --nav-bg: #1e1e1e;
    --ad-bg: #2d2d2d;
}

* {
    box-sizing: border-box;
    transition: background-color 0.3s ease, color 0.3s ease;
}

html, body {
    height: 100vh;
    margin: 0;
    overflow: hidden; /* Remove o scroll */
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    display: flex;
    flex-direction: column;
}

/* Navbar - Altura Fixa */
.navbar {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    height: 50px;
    background-color: var(--nav-bg);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    z-index: 100;
}

.logo {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--accent-color);
}

#theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    padding: 0.4rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Layout Grid - Ajustado para favorecer 4:3 */
.layout-grid {
    display: grid;
    grid-template-columns: 1fr 320px; /* Aumentei um pouco a lateral para o vídeo ficar menos esticado */
    grid-template-rows: 1fr 110px;
    flex-grow: 1;
    width: 100%;
    min-height: 0;
}

.video-container {
    grid-area: 1 / 1 / 2 / 2;
    background-color: #000;
    position: relative;
    overflow: hidden;
}

/* Video - Preenchimento Total sem cortes */
video {
    width: 100%;
    height: 100%;
    object-fit: fill; /* ESTE AJUSTE: Garante que 100% da imagem apareça sem barras pretas */
    display: block;
    aspect-ratio: 4 / 3; /* Define a base como 4:3 */
}

/* Ajuste no Wrapper para não limitar o vídeo */
.video-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
}

/* Ad Styles */
.ad-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #888;
    font-weight: bold;
    text-align: center;
}

.ad-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Badge AO VIVO */
.status-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background-color: #ff0000;
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    animation: pulse 2s infinite;
    z-index: 10;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

/* Responsive - Para Celular */
@media (max-width: 768px) {
    .layout-grid {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto auto; /* Divide em 3 partes verticais */
    }
    
    .video-container { grid-area: 1 / 1 / 2 / 2; }
    
    .ad-side { 
        grid-area: 2 / 1 / 3 / 2; 
        height: 100px; /* Tamanho reduzido no celular para caber tudo */
        border-left: none;
        border-bottom: 1px solid rgba(128, 128, 128, 0.1);
    }
    
    .ad-bottom { 
        grid-area: 3 / 1 / 4 / 2; 
        height: 80px;
    }

    /* Em telas muito baixas (celular deitado), removemos as propagandas para focar no vídeo */
    @media (max-height: 400px) {
        .ad-side, .ad-bottom { display: none; }
        .layout-grid { grid-template-rows: 1fr; }
    }
}
