@import url("https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,600,900");

/* --- 1. RESET & BASE --- */
html {
    margin: 0; padding: 0;
    width: 100%; height: auto; min-height: 100%;
    overflow-y: scroll; overflow-x: hidden;
}

body {
    margin: 0; padding: 0;
    width: 100%; height: auto; min-height: 100vh;
    font-family: 'Source Sans Pro', sans-serif;
    font-weight: 300;
    color: #fff;
    background: transparent;
    overflow-x: hidden;
}

*, *:before, *:after { box-sizing: border-box; }

/* --- 2. FUNDO --- */
#bg {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100vh;
    z-index: 0;
    background-color: #348cb2;
    background-image: url("../img/bg.jpg");
    background-repeat: repeat;
    background-position: 0 0;
    background-size: 2250px auto; 
    animation: move-background 120s linear infinite;
}

@keyframes move-background {
    from { background-position: 0 0; }
    to { background-position: -2250px 0; }
}

#overlay {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100vh;
    background-image: url("../img/overlay-pattern.png"), url("../img/overlay.svg");
    background-position: top left, center center;
    background-repeat: repeat, no-repeat;
    background-size: auto, cover;
    z-index: 1; opacity: 1; pointer-events: none;
}

/* --- 3. LAYOUT --- */
#wrapper {
    position: relative; z-index: 2;
    display: flex; flex-direction: column;
    min-height: 100vh; width: 100%;
    opacity: 0; animation: fade-in 1.5s forwards;
    overflow: visible;
}

@keyframes fade-in { to { opacity: 1; } }

#main {
    flex: 1; width: 95%; max-width: 1200px;
    margin: 0 auto; padding-top: 2em;
    display: flex; flex-direction: column; align-items: center;
}

/* --- 4. HEADER & LOGO --- */
#header { text-align: center; margin-bottom: 2em; margin-top: 2em; position: relative; }

#header img { 
    max-width: 800px; 
    height: auto; 
    transition: max-width 0.3s ease;
    cursor: pointer;
}

.social-nav { margin-top: 2em; }

.social-nav ul { list-style: none; padding: 0; margin: 0; }
.social-nav li { display: inline-block; margin: 0 10px; }

.social-nav a {
    display: inline-block; width: 2.5em; height: 2.5em; line-height: 2.5em;
    border-radius: 50%; border: 1px solid rgba(255,255,255,0.5);
    color: #fff; text-decoration: none; transition: all 0.3s; text-align: center;
}
.social-nav a:hover {
    background: rgba(255,255,255,0.2); border-color: #fff; transform: scale(1.1);
}
.icon:before { font-family: FontAwesome; }
.label { display: none; } 

/* --- 5. MENU DE NAVEGAÇÃO SUPERIOR --- */
#top-menu {
    width: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    position: sticky; top: 0; z-index: 1000;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex; 
    flex-direction: column;
    align-items: center;
    padding: 0;
}

#top-menu ul {
    list-style: none; padding: 15px 0; margin: 0;
    display: flex; justify-content: center; flex-wrap: wrap;
    width: 100%;
    transition: max-height 0.3s ease-out;
}
#top-menu li { margin: 0 15px; }

/* Menus de conteúdo escondidos por defeito */
#menu-item-live, 
#menu-item-upcoming,
#menu-item-archive {
    display: none;
}

#top-menu a {
    color: #fff; text-decoration: none; font-weight: 600; text-transform: uppercase;
    letter-spacing: 1px; font-size: 0.9em; transition: color 0.3s; cursor: pointer;
}
#top-menu a:hover, #top-menu a.active {
    color: #348cb2; border-bottom: 2px solid #348cb2; padding-bottom: 5px;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.8em;
    padding: 10px 20px;
    align-self: flex-end; 
    outline: none;
}

/* --- 6. BARRA DE PESQUISA --- */
#search-container {
    width: 100%; max-width: 600px; margin: 0 auto 40px auto;
    position: relative;
}
#search-input {
    width: 100%; padding: 12px 20px;
    border-radius: 25px; border: 1px solid rgba(255,255,255,0.3);
    background: rgba(0,0,0,0.5); 
    color: #fff; 
    font-family: 'Source Sans Pro', sans-serif; font-size: 1em;
    outline: none; transition: all 0.3s;
}

#search-input::placeholder {
    color: rgba(255, 255, 255, 0.8);
    opacity: 1;
}

#search-input:focus {
    background: rgba(0,0,0,0.8); border-color: #348cb2;
}

/* --- 7. SECÇÕES E VÍDEOS --- */
.view-container { width: 100%; display: none; animation: fadeInView 0.5s; }
.view-container.active { display: block; }
@keyframes fadeInView { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.video-section { width: 100%; margin-bottom: 50px; }

h2.gallery-title {
    width: 100%; text-align: center;
    font-size: 1.5em; text-transform: uppercase; letter-spacing: 2px;
    border-top: 1px solid rgba(255,255,255,0.3);
    padding-top: 30px; margin: 20px 0 30px 0;
    font-weight: 600;
}

h2.live-title {
    color: #ff4444; border-top: none; animation: pulse-red 2s infinite;
}
@keyframes pulse-red {
    0% { opacity: 1; text-shadow: 0 0 10px rgba(255, 0, 0, 0.5); }
    50% { opacity: 0.7; text-shadow: 0 0 20px rgba(255, 0, 0, 0.8); }
    100% { opacity: 1; text-shadow: 0 0 10px rgba(255, 0, 0, 0.5); }
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px; width: 100%;
}

.video-card {
    background: rgba(10, 10, 10, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px; overflow: hidden;
    transition: transform 0.2s ease, background 0.2s;
    cursor: pointer; display: flex; flex-direction: column;
    backdrop-filter: blur(5px);
    height: 100%;
}
.video-card:hover {
    transform: translateY(-5px);
    background: rgba(30, 30, 30, 0.8);
    border-color: rgba(255, 255, 255, 0.5);
}

.thumbnail-container {
    position: relative; width: 100%; padding-top: 56.25%; background: #000; flex-shrink: 0;
}
.thumbnail-container img {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover;
}

.video-info {
    padding: 15px; 
    flex-grow: 1;
    display: flex; 
    flex-direction: column;
    justify-content: flex-start;
    gap: 5px;
}

.video-title {
    font-size: 1rem; font-weight: 600; line-height: 1.3; margin-bottom: 5px; color: #fff;
}

.video-date { 
    font-size: 0.8rem; 
    color: #fff; 
    margin-bottom: 10px; 
}

.video-desc {
    font-size: 1rem; 
    color: #fff; 
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 0; 
    margin-bottom: 10px;
}

.video-tags {
    font-size: 0.8rem;
    color: #348cb2;
    font-weight: 600;
    line-height: 1.4;
    word-wrap: break-word;
}
.video-tags span {
    margin-right: 5px;
    display: inline-block;
}

.btn-container { width: 100%; text-align: center; margin-top: 20px; }
.btn-more {
    background: transparent; color: #fff; border: 1px solid #fff;
    padding: 10px 25px; border-radius: 20px; cursor: pointer;
    font-size: 0.9em; text-transform: uppercase; letter-spacing: 1px;
    transition: all 0.3s;
}
.btn-more:hover {
    background: #fff; color: #000;
}

/* Badges */
.badge {
    position: absolute; top: 10px; right: 10px;
    padding: 4px 8px; border-radius: 4px;
    font-size: 0.7em; font-weight: bold;
    color: white; z-index: 2; text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.badge-live { background-color: #cc0000; }
.badge-upcoming { background-color: #0f9d58; }
.badge-video { background-color: #348cb2; display: inline-block; } 
.badge-stream { background-color: #8e44ad; border: none; }

/* --- 8. MODAL --- */
.modal {
    display: none; position: fixed; z-index: 9999; left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.75); /* Opacidade pedida de 0.75 */
    justify-content: center; align-items: center;
    padding: 20px;
}

.modal-content { 
    position: relative; 
    width: 90%; 
    max-width: 960px; 
    background: #111;
    border: 1px solid #333;
    display: flex;
    flex-direction: column;
    max-height: 90vh; /* Limite de altura */
    overflow: visible; /* IMPORTANTE: Para o X aparecer fora da caixa se necessário */
}

.modal-video-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background: #000;
    flex-shrink: 0;
}

.modal-video-container iframe {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
}

.close { 
    position: absolute; 
    top: -35px; /* Posição fora da caixa, acima */
    right: 0; 
    color: white; 
    font-size: 30px; 
    cursor: pointer; 
    z-index: 1001;
    text-shadow: 0 0 5px rgba(0,0,0,0.8);
}

/* Estilos da Informação Modal (Desktop) */
.modal-info {
    padding: 20px;
    color: #fff;
    background: #1a1a1a;
    overflow-y: auto; /* O Scroll acontece AQUI e não no modal inteiro */
    max-height: 30vh; /* Limita a altura do texto se for muito longo */
}

#modal-title {
    margin-top: 0;
    font-size: 1.4em;
    font-weight: 600;
    color: #fff;
    margin-bottom: 5px;
}

#modal-date {
    color: #aaa;
    font-size: 0.9em;
    margin-bottom: 15px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

#modal-desc {
    font-size: 1em;
    line-height: 1.5;
    color: #ddd;
    margin-bottom: 15px;
}

#footer {
    width: 100%; padding: 2em 0; text-align: center; font-size: 0.9em;
    background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.8));
    margin-top: auto;
}

.copyright {
    font-size: 1rem;
}

/* --- PAGINAÇÃO --- */
.pagination-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 40px;
    flex-wrap: wrap;
    gap: 10px;
}

.page-btn {
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 0.9em;
}

.page-btn:hover:not(:disabled) {
    background: #348cb2;
    border-color: #348cb2;
}

.page-btn.active {
    background: #348cb2;
    border-color: #348cb2;
    font-weight: bold;
    cursor: default;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: transparent;
}

/* --- 9. MOBILE --- */
@media screen and (max-width: 768px) {
    #header img { max-width: 80%; }
    
    .hamburger { 
        display: block; 
        cursor: pointer;
        z-index: 1002; 
        position: relative;
    } 
    
    #top-menu {
        z-index: 1001; 
    }

    #top-menu ul {
        display: none; 
        flex-direction: column;
        width: 100%;
        text-align: center;
        padding-bottom: 20px;
        /* ALTERADO PARA IGUALAR O DESKTOP */
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(10px);
        position: absolute;
        top: 100%; 
        left: 0;
        z-index: 1000;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    #top-menu ul.show {
        display: flex !important;
    }
    
    #top-menu li { margin: 15px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
    
    /* ESCONDER INFO NA MODAL EM MOBILE */
    .modal-info {
        display: none !important;
    }
    
    /* Ajuste para o vídeo ocupar mais espaço em mobile se necessário */
    .modal-content {
        width: 100%;
        border: none;
        background: transparent;
    }

    .close {
        top: -40px;
        right: 0;
    }
    
    html::-webkit-scrollbar { display: none; }
    body::-webkit-scrollbar { display: none; }
    html { -ms-overflow-style: none; scrollbar-width: none; overflow-y: scroll; }
}