@import url('https://googleapis.com');

:root {
    --bg-azul-acero: #4c6474;
    --bg-gris-morado: #49384e;
    --accent-elyos: #e6c687;
    --accent-asmodian: #9c6ca7;
    --text-white: #ffffff;
    --text-silver: #d1d5db;
    --nav-height: 75px;
}

/* Reinicio de Caja */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg-gris-morado);
    color: var(--text-white);
    overflow-x: hidden;
}

/* NAVBAR ORIGINAL ACOPLADA */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background-color: rgba(51, 70, 84, 0.35); 
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4rem;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08); 
}

.logo img {
    height: 60px;
    object-fit: contain;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 3rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-silver);
    font-size: 0.9rem;
    transition: color 0.3s, text-shadow 0.3s;
}

.nav-links a:hover {
    color: var(--text-white);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* SECCIÓN CENTRAL CON TU DEGRADADO A 45 GRADOS */
.video-gallery-section {
    width: 100%;
    min-height: 100vh;
    padding-top: calc(var(--nav-height) + 3rem);
    padding-bottom: 4rem;
    background: linear-gradient(45deg, var(--bg-gris-morado) 0%, #3e4453 50%, var(--bg-azul-acero) 100%) !important;
}

.gallery-container {
    width: 90%;
    max-width: 1240px;
    margin: 0 auto;
}

.gallery-title {
    font-family: 'Cinzel', serif;
    font-size: 2.8rem;
    color: var(--accent-elyos);
    text-align: center;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 12px rgba(230, 198, 135, 0.3);
}

.gallery-subtitle {
    font-size: 1rem;
    color: var(--text-silver);
    text-align: center;
    margin-bottom: 3.5rem;
    font-weight: 300;
}

/* REJILLA ESTILO YOUTUBE (GRILLA DINÁMICA) */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.video-card {
    background: rgba(51, 70, 84, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.video-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-elyos);
    box-shadow: 0 15px 35px rgba(0,0,0,0.5);
}

.video-thumbnail {
    width: 100%;
    height: 180px;
    background-size: cover;
    background-position: center;
    position: relative;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* BOTÓN FLOTANTE PLAY */
.play-button-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-card:hover .play-button-overlay {
    opacity: 1;
}

.play-icon {
    font-size: 2.5rem;
    color: #ffffff;
    background: rgba(22, 46, 84, 0.8);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding-left: 5px;
    border: 1px solid var(--accent-elyos);
    transition: transform 0.2s;
}

.video-card:hover .play-icon {
    transform: scale(1.1);
}

.video-card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.video-card-body h3 {
    font-size: 1.15rem;
    color: #fff;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.video-card-body p {
    font-size: 0.88rem;
    color: var(--text-silver);
    line-height: 1.5;
    margin-bottom: 1rem;
    font-weight: 300;
}

/* BADGES IDENTIFICADORES DE ORIGEN */
.badge-origen {
    margin-top: auto;
    align-self: flex-start;
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.badge-origen.local { background-color: #25497b; color: #fff; }
.badge-origen.youtube { background-color: #c4302b; color: #fff; }

/* --- CINE/MODAL DE REPRODUCCIÓN INTERNA --- */
.theater-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.theater-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.theater-modal-container {
    background: #1c242b;
    border: 1px solid rgba(230, 198, 135, 0.2);
    width: 90%;
    max-width: 850px;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 40px rgba(0,0,0,0.8);
}

.theater-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    font-size: 1.8rem;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2010;
}

.theater-player-box {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* Relación de aspecto 16:9 perfecta */
    background: #000;
}

.theater-player-box video,
.theater-player-box iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.theater-info-box {
    padding: 1.5rem;
}

#theater-video-title {
    font-family: 'Cinzel', serif;
    font-size: 1.4rem;
    color: var(--accent-elyos);
    margin-bottom: 0.5rem;
}

#theater-video-desc {
    font-size: 0.9rem;
    color: var(--text-silver);
    line-height: 1.6;
    font-weight: 300;
}

/* Responsividad para pantallas móviles */
@media (max-width: 768px) {
    .navbar { padding: 0 1.5rem; }
    .nav-links { gap: 1rem; }
    .gallery-title { font-size: 2rem; }
}
/* =========================================================
   MENÚ DESPLEGABLE (DROPDOWN) PARA NAVBAR
   ========================================================= */
.nav-links {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.nav-links li {
    position: relative;
    white-space: nowrap; /* Evita que el texto se parta en dos líneas */
}

/* Botón disparador del desplegable */
.dropdown-toggle {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.dropdown-arrow {
    font-size: 0.7rem;
    transition: transform 0.25s ease;
}

.nav-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

/* Caja flotante del submenú */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 210px;
    background: rgba(16, 20, 30, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 0.5rem 0;
    margin-top: 10px;
    list-style: none;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 9999;
}

/* Puente invisible para que no se cierre al bajar el mouse */
.nav-dropdown::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 12px;
}

.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Alinear el último menú (Usuario) a la derecha para que no se salga de pantalla */
.dropdown-menu-right {
    left: auto;
    right: 0;
}

.dropdown-menu li {
    width: 100%;
}

.dropdown-menu a {
    display: block;
    padding: 0.65rem 1.2rem;
    color: var(--text-silver, #cfd8e3);
    text-decoration: none;
    font-size: 0.92rem;
    transition: background 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
}

.dropdown-menu a:hover,
.dropdown-menu a.active {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    padding-left: 1.5rem;
}

.dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0.4rem 0;
}

.dropdown-menu a.logout-item {
    color: #ff6b6b;
}

.dropdown-menu a.logout-item:hover {
    background: rgba(255, 107, 107, 0.12);
    color: #ff8787;
}