/* --- Reset Global & Correção de Layout --- */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: #0d1117;
    color: #c9d1d9;
    margin: 0;
    padding-top: 20px;
    padding-bottom: 120px; /* Aumentado para garantir espaço suficiente */
}

main.container {
    text-align: center;
    width: 100%;
    max-width: 800px;
    padding: 30px 20px;
    margin: 0 auto;
}

/* --- Estrutura do Menu Fixo --- */
#bottom-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #161b22;
    border-top: 1px solid #30363d;
    /* height: 65px; */          /* Removido para ajuste automático */
    padding: 6px 10px;     /* Ajuste conforme sugestão do ChatGPT */
    box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
    z-index: 100;
}

#menu-buttons-container {
    display: flex;
    flex-direction: column;
    gap: 6px;              /* Ajuste conforme sugestão do ChatGPT */
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

/* Otimizações para Desktop: Remover max-width do menu container */
@media (min-width: 769px) {
    #menu-buttons-container {
        max-width: none; /* Remove a restrição de largura para dar mais espaço ao grid */
        padding: 0 20px; /* Adiciona um padding lateral para não colar nas bordas */
    }
}

.container h1 {
    margin-bottom: 30px;
    font-size: 2.5rem;
}

/* --- Grid de Botões (Flexbox) --- */
/* --- Grid de Botões --- */
.button-grid {
    width: 100%;
}

/* Otimizações para Desktop */
@media (min-width: 769px) {
    .button-grid {
        display: grid; /* Ativa o grid para os botões em desktop */
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); /* Colunas responsivas */
        gap: 10px; /* Espaçamento entre os botões */
    }
    .button-grid .panel-btn {
        width: auto; /* Garante que o grid controle a largura */
    }
}

.panel-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #21262d;
    color: #c9d1d9;
    padding: 8px 12px;     /* Ajuste conforme sugestão do ChatGPT */
    font-size: 14px;       /* Ajuste conforme sugestão do ChatGPT */
    border-radius: 8px;    /* Ajuste conforme sugestão do ChatGPT */
    text-align: center;
    border: 1px solid #30363d;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    min-width: 120px;
}

.panel-btn:hover {
    background-color: #30363d;
    transform: translateY(-2px);
    color: #ffffff;
}

.back-button {
    flex-grow: 2;
}

.back-button-wrapper {
    display: flex;
    justify-content: center;
    padding: 0 10%;
}

/* --- Barra de Pesquisa --- */
.menu-search-input {
    width: 100%;
    padding: 12px;
    background-color: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #c9d1d9;
    font-size: 1rem;
    margin-bottom: 8px;
}

/* --- Otimizações para Mobile (sugestão ChatGPT) --- */
@media (max-width: 600px) {
    #bottom-menu { padding: 5px 8px; }
    .panel-btn { padding: 6px 8px; font-size: 13px; }
}

/* --- Otimizações para Mobile --- */
@media (max-width: 768px) {
    .button-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .panel-btn {
        font-size: 0.9rem;
        padding: 12px 8px;
    }

    /* Fix for pagination buttons on mobile */
    .pagination-controls .panel-btn {
        min-width: unset; /* Allow buttons to shrink */
        padding: 10px 5px; /* Reduce padding to save space */
    }

    .pagination-controls .back-button {
        flex-grow: 1; /* Remove the extra growth */
    }

    .container h1 {
        font-size: 2rem;
    }
}

.voltar-container {
    margin-top: 20px;
    width: 100%;
    max-width: 220px;
    margin-left: auto;
    margin-right: auto;
}

#conteudo-final {
    background-color: #010409;
    padding: 25px;
    border-radius: 6px;
    border: 1px solid #21262d;
    line-height: 1.7;
    text-align: left;
    margin-bottom: 30px;
}

#conteudo-final p, #conteudo-final li {
    font-size: 1.1rem;
    margin-bottom: 15px;
}

#conteudo-final ul {
    padding-left: 20px;
}

#conteudo-final strong {
    color: #58a6ff;
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo img {
    max-width: 100px;
}

/* --- Login Page --- */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    width: 100%;
    max-width: 400px;
    margin-top: 50px;
}

.login-container form {
    width: 100%;
    background-color: #161b22;
    padding: 30px;
    border: 1px solid #30363d;
    border-radius: 6px;
}

.login-container .form-group {
    margin-bottom: 20px;
    text-align: left;
}

.login-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.login-container input {
    width: 100%;
    padding: 10px;
    background-color: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #c9d1d9;
    font-size: 1rem;
    box-sizing: border-box;
}

.login-container .panel-btn {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
}

.summary-container {
    margin-top: 40px;
    text-align: left;
}

.summary-item {
    background-color: #161b22;
    padding: 20px;
    border-left: 3px solid #58a6ff;
    border-radius: 0 6px 6px 0;
    margin-bottom: 15px;
}

.summary-item h3 {
    margin: 0 0 5px 0;
    color: #c9d1d9;
    font-size: 1.2rem;
}

.summary-item p {
    margin: 0;
    color: #8b949e;
    font-size: 1rem;
}

/* --- ESTILOS DO NOVO PLAYER DE VÍDEO VERTICAL --- */

.video-player-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 200;
    background: #000;
}

.swiper-main {
    width: 100%;
    height: 100%;
}

.swiper-main .swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
}

.swiper-slide .plyr {
    z-index: 10;
}

.plyr {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.swiper-thumbs {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    z-index: 210;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.swiper-thumbs.visible {
    opacity: 1;
    visibility: visible;
}

.swiper-thumbs .swiper-slide {
    width: 70px;
    height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s, transform 0.3s;
}

.swiper-thumbs .swiper-slide-thumb-active {
    opacity: 1;
    transform: scale(1.1);
}

.swiper-thumbs .thumb-image {
    width: 60px;
    height: 80px;
    object-fit: cover;
    border-radius: 5px;
    border: 2px solid transparent;
}

.swiper-thumbs .swiper-slide-thumb-active .thumb-image {
    border-color: #58a6ff;
}

/* Customização do Plyr */
:root {
  --plyr-color-main: #58a6ff;
}

.plyr--video .plyr__control.plyr__tab-focus,
.plyr--video .plyr__control:hover,
.plyr--video .plyr__control[aria-expanded=true] {
    background: var(--plyr-color-main);
}

/* --- NOVAS REGRAS PARA O BOTÃO DE PLAY --- */

/* Força a exibição do botão grande de play */
.plyr__control--overlaid {
    display: block !important;
    opacity: 1 !important;
    background: rgba(22, 27, 34, 0.7) !important;
    border: 1px solid rgba(139, 148, 158, 0.3) !important;
    border-radius: 50% !important;
    padding: 20px !important;
    transition: opacity 0.2s ease-in-out !important;
}

/* Esconde o botão quando o vídeo está tocando */
.plyr--playing .plyr__control--overlaid {
    opacity: 0 !important;
    pointer-events: none; /* Impede que seja clicado quando invisível */
}

/* Mostra o botão novamente se o usuário pausar ou tocar/passar o mouse por cima */
.plyr--paused .plyr__control--overlaid,
.plyr--playing:hover .plyr__control--overlaid,
.plyr--playing.plyr--focused .plyr__control--overlaid {
    opacity: 1 !important;
    pointer-events: auto;
}
/* Estilo para o botão de teste de thumbnail */
.test-thumbnail-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 9999;
    padding: 10px 15px;
    background-color: #c92a2a;
    color: white;
    border: 1px solid #ff6b6b;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.test-thumbnail-btn:hover {
    opacity: 1;
}