/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Poppins", sans-serif;
    overflow-x: hidden;
}

/* Sección de Video Hero */
.video-hero-section {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background: #000;
}

.video-container {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Video principal - MÓVIL OPTIMIZADO */
.hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
    z-index: 1;
}

/* Para móviles - mostrar video completo */
@media (max-width: 768px) {
    .video-hero-section {
        height: 70vh !important; /* Reducir altura del contenedor */
    }

    .hero-video {
        object-fit: contain !important;
        width: 100% !important;
        height: 100% !important;
        min-width: auto !important;
        min-height: auto !important;
        object-position: center top !important; /* ⬅️ NUEVO */
        top: 70% !important; /* ⬅️ NUEVO */
    }
}

/* Fallback para navegadores sin soporte */
.video-fallback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    text-align: center;
    font-size: 1.2rem;
    z-index: 5;
}

.video-fallback a {
    color: var(--colorSecundario);
    text-decoration: none;
}

.video-fallback a:hover {
    color: var(--colorPrincipal);
}

/* Overlay oscuro sutil (opcional) */
.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    z-index: 2;
    pointer-events: none;
}

/* Controles de video mejorados */
.video-controls {
    position: absolute;
    left: 18rem;
    top: 18rem;
    pointer-events: all;
    z-index: 100000;
}

/* Para móviles - mostrar video completo */
@media (max-width: 768px) {
    .video-controls {
        left: 1rem;
        top: 17.5rem;
    }
}

.mute-btn {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    border: 3px solid rgba(124, 89, 165, 0.8);
    border-radius: 50%;
    width: 80px;
    height: 80px;
    color: var(--colorPrincipal);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 8px 25px rgba(124, 89, 165, 0.3);
    animation: pulseVolume 2s ease-in-out infinite;
}

.mute-btn:hover {
    background: rgba(255, 255, 255, 1);
    border-color: var(--colorPrincipal);
    transform: scale(1.1);
    box-shadow: 0 12px 35px rgba(124, 89, 165, 0.5);
    animation: none;
}

.mute-btn:active {
    transform: scale(0.95);
}

/* Animación de pulso para llamar la atención */
@keyframes pulseVolume {
    0% {
        box-shadow: 0 8px 25px rgba(124, 89, 165, 0.3);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 8px 30px rgba(124, 89, 165, 0.6);
        transform: scale(1.05);
    }
    100% {
        box-shadow: 0 8px 25px rgba(124, 89, 165, 0.3);
        transform: scale(1);
    }
}

/* Indicador de ondas de sonido - Ajustado para superior izquierda */
.mute-btn::before {
    content: "";
    position: absolute;
    top: -15px;
    left: -15px;
    width: 110px;
    height: 110px;
    border: 2px solid rgba(124, 89, 165, 0.3);
    border-radius: 50%;
    animation: soundWaves 2s ease-in-out infinite;
    pointer-events: none;
}

.mute-btn::after {
    content: "";
    position: absolute;
    top: -25px;
    left: -25px;
    width: 130px;
    height: 130px;
    border: 2px solid rgba(124, 89, 165, 0.2);
    border-radius: 50%;
    animation: soundWaves 2s ease-in-out infinite 0.5s;
    pointer-events: none;
}

@keyframes soundWaves {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

/* Tooltip del botón */
.audio-tooltip {
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.8rem 1.2rem;
    border-radius: 10px;
    white-space: nowrap;
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 10px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 100;
}

.audio-tooltip::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 20px;
    border: 6px solid transparent;
    border-bottom-color: rgba(0, 0, 0, 0.9);
}

.mute-btn:hover .audio-tooltip {
    opacity: 1;
    transform: translateY(0);
}

/* Mensaje de audio disponible - MÓVIL CENTRADO */
.audio-notification {
    position: absolute;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    padding: 1rem 2rem;
    border-radius: 25px;
    border: 2px solid var(--colorSecundario);
    color: var(--colorPrincipal);
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    animation: slideInDown 0.6s ease 1s both, fadeOutUp 0.5s ease 8s both;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    max-width: 90%;
}

.audio-notification i {
    font-size: 1.2rem;
    color: var(--colorTerciario);
    animation: bounce 1s ease infinite alternate;
}

/* Para móviles - mostrar video completo */
@media (max-width: 768px) {
    .audio-notification {
        position: absolute;
        top: 2rem;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(15px);
        padding: 1rem 2rem;
        border-radius: 25px;
        border: 2px solid var(--colorSecundario);
        color: var(--colorPrincipal);
        font-weight: 600;
        font-size: 0.95rem;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
        animation: slideInDown 0.6s ease 1s both, fadeOutUp 0.5s ease 8s both;
        z-index: 10;
        display: flex;
        align-items: center;
        gap: 0.8rem;
        width: 16em;
    }

    /* BOTÓN MÁS PEQUEÑO EN MÓVILES */
    .mute-btn {
        width: 60px !important;
        height: 60px !important;
        font-size: 1.2rem !important;
        border-width: 2px !important;
    }

    .mute-btn::before {
        width: 80px !important;
        height: 80px !important;
        top: -10px !important;
        left: -10px !important;
    }

    .mute-btn::after {
        width: 100px !important;
        height: 100px !important;
        top: -20px !important;
        left: -20px !important;
    }

    /* TOOLTIP ARRIBA EN MÓVILES */
    .audio-tooltip {
        top: auto !important;
        bottom: 100% !important;
        margin-top: 0 !important;
        margin-bottom: 10px !important;
        transform: translateY(10px) !important;
        font-size: 0.8rem !important;
        padding: 0.6rem 1rem !important;
    }

    .audio-tooltip::after {
        bottom: auto !important;
        top: 100% !important;
        border-bottom-color: transparent !important;
        border-top-color: rgba(0, 0, 0, 0.9) !important;
    }

    .mute-btn:hover .audio-tooltip {
        transform: translateY(0) !important;
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes fadeOutUp {
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-30px);
    }
}

@keyframes bounce {
    to {
        transform: translateY(-3px);
    }
}

/* Estado cuando el audio está activado */
.mute-btn.audio-on {
    background: var(--colorPrincipal);
    color: white;
    border-color: var(--colorTerciario);
    animation: none;
}

.mute-btn.audio-on::before,
.mute-btn.audio-on::after {
    display: none;
}

/* Contenido sobre el video (opcional) */
.video-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    pointer-events: none;
}

.content-wrapper {
    text-align: center;
    color: white;
    max-width: 800px;
    padding: 2rem;
}

.video-title {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.7);
    animation: fadeInUp 1s ease 0.5s both;
}
@media (max-width: 768px) {
    .video-title {
        margin-top: 8em;
    }
}

.video-subtitle {
    font-size: 1.4rem;
    font-weight: 300;
    opacity: 0.9;
    text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.7);
    animation: fadeInUp 1s ease 1s both;
}

/* Animaciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading state para el video */
.video-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--colorSecundario), var(--colorPrincipal));
    z-index: 0;
    transition: opacity 0.5s ease;
}

.video-container.video-loaded::before {
    opacity: 0;
    pointer-events: none;
}

/* Indicador de carga */
.loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 1.1rem;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Responsive con selectores específicos */
@media (max-width: 768px) {
    .video-title {
        font-size: 2.5rem;
    }

    .video-subtitle {
        font-size: 1.1rem;
    }

    .content-wrapper {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .video-title {
        font-size: 2rem;
    }

    .video-subtitle {
        font-size: 1rem;
    }

    /* BOTÓN AÚN MÁS PEQUEÑO PARA PANTALLAS MUY PEQUEÑAS */
    .mute-btn {
        width: 50px !important;
        height: 50px !important;
        font-size: 1rem !important;
    }

    .mute-btn::before {
        width: 70px !important;
        height: 70px !important;
        top: -10px !important;
        left: -10px !important;
    }

    .mute-btn::after {
        width: 85px !important;
        height: 85px !important;
        top: -17px !important;
        left: -17px !important;
    }
}

/* Estado cuando el video está pausado */
.hero-video:not([autoplay]) {
    cursor: pointer;
}

/* Efecto cuando el video está cargando */
.hero-video[data-loading="true"] {
    opacity: 0.5;
}

/* Ajuste para navegadores que no soportan object-fit */
@supports not (object-fit: cover) {
    .hero-video {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
}
