:root {
    --fondo: #0b1020;
    --tarjeta: #121a33;
    --borde: rgba(255, 255, 255, 0.10);
    --texto: rgba(255, 255, 255, 0.92);
    --atenuado: rgba(255, 255, 255, 0.65);
    --acento: #5eead4;
    --sombra: 0 10px 24px rgba(0, 0, 0, 0.35);
    --live-red: #ff4b2b;
}

/* Modo Claro */
body.modo-claro {
    --fondo: #f0f2f5;
    --tarjeta: #ffffff;
    --borde: rgba(0, 0, 0, 0.10);
    --texto: #1a1a1a;
    --atenuado: #606770;
    --acento: #2d8cf0;
    --sombra: 0 4px 12px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: radial-gradient(1200px 700px at 20% 0%, rgba(94, 234, 212, 0.10), transparent 60%),
                radial-gradient(900px 500px at 90% 10%, rgba(99, 102, 241, 0.10), transparent 55%),
                var(--fondo);
    color: var(--texto);
    transition: background 0.3s ease, color 0.3s ease;
    min-height: 100vh;
}

.container {
    width: min(1400px, 95vw);
    margin: 0 auto;
}

/* ============ HEADER ============ */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(11, 16, 32, 0.85);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--borde);
}

body.modo-claro .header {
    background: rgba(240, 242, 245, 0.9);
}

.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    gap: 20px;
    flex-wrap: wrap;
}

.brand-logo {
    height: 60px;
    width: auto;
    object-fit: contain;
}

.nav {
    display: flex;
    gap: 8px;
}

.nav__link {
    color: var(--atenuado);
    text-decoration: none;
    font-size: 15px;
    padding: 10px 16px;
    border-radius: 10px;
    transition: all 0.2s;
    font-weight: 500;
}

.nav__link:hover,
.nav__link.active {
    color: var(--texto);
    background: rgba(94, 234, 212, 0.1);
}

.header__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header__search input {
    padding: 10px 18px;
    border-radius: 25px;
    border: 1px solid var(--borde);
    background: var(--tarjeta);
    color: var(--texto);
    width: 220px;
    outline: none;
    font-size: 14px;
    transition: all 0.3s;
}

.header__search input:focus {
    border-color: var(--acento);
    box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.1);
}

.theme-btn {
    background: var(--tarjeta);
    border: 1px solid var(--borde);
    color: var(--texto);
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    font-size: 20px;
}

.theme-btn:active {
    transform: scale(0.9);
}

.theme-btn .icon-sun {
    display: none;
}

body.modo-claro .theme-btn .icon-moon {
    display: none;
}

body.modo-claro .theme-btn .icon-sun {
    display: block;
}

/* ============ MAIN CONTENT ============ */
.main {
    padding: 30px 0;
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 75, 43, 0.15);
    color: var(--live-red);
    padding: 8px 18px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: bold;
    border: 1px solid rgba(255, 75, 43, 0.3);
    margin-bottom: 25px;
}

.dot {
    width: 10px;
    height: 10px;
    background-color: var(--live-red);
    border-radius: 50%;
    animation: blink 1.2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ============ VIDEO LAYOUT ============ */
.video-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 25px;
    margin-bottom: 50px;
}

/* Main Player */
.main-player {
    background: var(--tarjeta);
    border: 1px solid var(--borde);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--sombra);
}

.video-wrapper {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
}

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

/* Play Overlay */
.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.3s;
    z-index: 5;
}

.play-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.play-button {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--acento);
    border: none;
    color: #000;
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
    padding-left: 6px;
}

.play-button:hover {
    transform: scale(1.1);
}

/* Audio Button - CORREGIDO */
.audio-btn-overlay {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    display: none;
    pointer-events: none;
}

.audio-btn-overlay.show {
    display: block;
    pointer-events: auto;
}

.activate-audio-btn {
    background: #ff0d00;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(255, 3, 3, 0.4);
    transition: all 0.3s;
    animation: pulse 2s infinite;
    pointer-events: auto;
}

.activate-audio-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(255, 3, 3, 0.6);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Video Info */
.video-info {
    padding: 20px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.6), transparent);
}

.video-info h2 {
    font-size: 24px;
    margin-bottom: 8px;
}

.video-info p {
    color: var(--atenuado);
    font-size: 14px;
}

/* ============ SIDEBAR VIDEOS ============ */
.sidebar-videos {
    background: var(--tarjeta);
    border: 1px solid var(--borde);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--sombra);
    max-height: 800px;
    overflow-y: auto;
}

.sidebar-title {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--acento);
    border-bottom: 2px solid var(--borde);
    padding-bottom: 10px;
}

.video-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.video-item {
    display: flex;
    gap: 12px;
    cursor: pointer;
    border-radius: 12px;
    padding: 10px;
    transition: all 0.3s;
    border: 1px solid transparent;
}

.video-item:hover {
    background: rgba(94, 234, 212, 0.05);
    border-color: var(--acento);
}

.video-item.active {
    background: rgba(94, 234, 212, 0.1);
    border-color: var(--acento);
}

.video-thumb {
    position: relative;
    width: 120px;
    min-width: 120px;
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}

.video-thumb img,
.video-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-duration {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
}

.video-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.video-details h4 {
    font-size: 14px;
    margin-bottom: 5px;
    line-height: 1.3;
}

.video-details p {
    font-size: 12px;
    color: var(--atenuado);
}

/* ============ FILTER SECTION ============ */
.filter-section {
    margin: 50px 0 30px;
}

.section-title {
    font-size: 24px;
    margin-bottom: 20px;
    color: var(--acento);
}

.filter-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-tab {
    background: var(--tarjeta);
    border: 1px solid var(--borde);
    color: var(--texto);
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.filter-tab:hover {
    background: rgba(94, 234, 212, 0.1);
    border-color: var(--acento);
}

.filter-tab.active {
    background: var(--acento);
    color: #000;
    border-color: var(--acento);
}

/* ============ VIDEO GRID ============ */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 50px;
}

.grid-video-card {
    background: var(--tarjeta);
    border: 1px solid var(--borde);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
}

.grid-video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(94, 234, 212, 0.2);
    border-color: var(--acento);
}

.grid-video-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
    overflow: hidden;
}

.grid-video-thumb img,
.grid-video-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.grid-video-content {
    padding: 15px;
}

.grid-video-content h4 {
    font-size: 16px;
    margin-bottom: 8px;
}

.grid-video-content p {
    font-size: 13px;
    color: var(--atenuado);
}

/* ============ RESULTS SECTION ============ */
.results-section {
    background: var(--tarjeta);
    border: 1px solid var(--borde);
    border-radius: 16px;
    padding: 30px;
    margin: 50px 0;
    box-shadow: var(--sombra);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 15px;
}

.results-description {
    color: var(--atenuado);
    font-size: 15px;
    line-height: 1.6;
}

.btn-primary {
    background: var(--acento);
    color: #000;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(94, 234, 212, 0.3);
}

/* ============ FOOTER ============ */
.footer {
    border-top: 1px solid var(--borde);
    margin-top: 50px;
    background: rgba(0, 0, 0, 0.15);
}

.footer__inner {
    padding: 25px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.footer__muted {
    color: var(--atenuado);
    font-size: 14px;
}

.footer__links {
    display: flex;
    gap: 20px;
}

.footer__links a {
    color: var(--atenuado);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.footer__links a:hover {
    color: var(--acento);
}

/* ============ MODAL ============ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--tarjeta);
    border: 1px solid var(--borde);
    border-radius: 16px;
    padding: 30px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--texto);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.modal-close:hover {
    background: var(--acento);
    color: #000;
}

.modal-content h2 {
    margin-bottom: 20px;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
    .video-layout {
        grid-template-columns: 1fr;
    }

    .sidebar-videos {
        max-height: 400px;
    }

    .video-list {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 10px;
    }

    .video-item {
        min-width: 250px;
    }
}

@media (max-width: 768px) {
    .header__inner {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas: 
            "logo theme"
            "menu menu";
        align-items: center;
        padding: 8px 15px;
        gap: 10px;
    }

    .brand-logo {
        grid-area: logo;
        width: 60px;
        height: auto;
        justify-self: center;
    }

    .header__actions {
        grid-area: theme;
        justify-self: end;
    }

    .nav {
        grid-area: menu;
        display: flex;
        justify-content: space-around;
        border-top: 1px solid rgba(255,255,255,0.1);
        padding-top: 4px;
        width: 100%;
    }

    .nav__link {
        font-size: 13px;
        padding: 5px;
        text-align: center;
    }

    .theme-btn {
        padding: 5px;
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .play-button {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }

    .video-grid {
        grid-template-columns: 1fr;
    }

    .filter-tabs {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .filter-tab {
        text-align: center;
    }
}

/* Scrollbar personalizado */
.sidebar-videos::-webkit-scrollbar {
    width: 8px;
}

.sidebar-videos::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.sidebar-videos::-webkit-scrollbar-thumb {
    background: var(--acento);
    border-radius: 10px;
}

.sidebar-videos::-webkit-scrollbar-thumb:hover {
    background: #4dd4ba;
}

/* ============ ESTILOS PARA IMÁGENES DE PORTADA ============ */
.video-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Indicador LIVE mejorado */
.live-thumb-indicator {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ff4b2b 0%, #ff6b4b 50%, #ff4b2b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.live-thumb-indicator::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    animation: pulse-bg 3s ease-in-out infinite;
}

@keyframes pulse-bg {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

.live-pulse {
    font-size: 28px;
    position: relative;
    z-index: 2;
    animation: live-pulse 1.5s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.8));
}

@keyframes live-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
}

/* Indicador LIVE grande para el grid */
.live-thumb-indicator.large {
    flex-direction: column;
    gap: 10px;
}

.live-pulse.large {
    font-size: 56px;
}

.live-text {
    color: white;
    font-size: 18px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 3px;
    z-index: 2;
    position: relative;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* Efecto hover en las imágenes */
.video-item:hover .video-poster,
.grid-video-card:hover .video-poster {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

.video-thumb,
.grid-video-thumb {
    overflow: hidden;
}

/* Efecto de carga para imágenes */
.video-poster {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.05) 25%, 
        rgba(255, 255, 255, 0.1) 50%, 
        rgba(255, 255, 255, 0.05) 75%
    );
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.video-poster[src] {
    animation: none;
    background: transparent;
}