/* CSS para corregir problemas específicos de mobile y navegación */

/* ===================
   CORRECCIÓN ESPECÍFICA DE PROBLEMAS
====================== */

/* 1. HEADER NEGRO CUANDO ESTÁ ESTÁTICO (no rojo) */
.modern-header {
    background-color: rgba(17, 17, 17, 1) !important; /* Negro sólido, NO rojo */
    padding: 10px 0 !important; /* Reducir padding para menos altura */
    transition: all 0.4s ease-in-out !important;
    z-index: 1000 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 70px !important; /* Altura mínima reducida */
}

/* Override cualquier estilo de Burgundy que esté aplicándose */
.modern-header,
.modern-navbar,
.navbar {
    background-color: rgba(17, 17, 17, 1) !important; /* Forzar negro */
    background: rgba(17, 17, 17, 1) !important; /* Forzar negro */
}

/* NO permitir que se aplique el color burgundy */
.modern-header:not(.scrolled),
.modern-navbar:not(.scrolled) {
    background-color: rgba(17, 17, 17, 1) !important;
    background: rgba(17, 17, 17, 1) !important;
}

/* 2. EFECTO DE TRANSPARENCIA AL HACER SCROLL (ya funcionaba, pero asegurar) */
.modern-header.scrolled {
    background-color: rgba(17, 17, 17, 0.85) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
    border-bottom: 1px solid rgba(201, 161, 67, 0.2) !important;
    padding: 8px 0 !important; /* Aún más pequeño en scroll */
    min-height: 60px !important;
}

/* 3. CORREGIR ESPACIADO BODY */
body {
    padding-top: 70px !important; /* Reducido de 80px a 70px */
}

body.logged-in {
    padding-top: 70px !important; /* Mismo para usuarios logueados */
}

/* 4. MOBILE - REDUCIR ESPACIOS DRÁSTICAMENTE */
@media (max-width: 991.98px) {
    .modern-header {
        padding: 8px 0 !important; /* Muy reducido en mobile */
        min-height: 60px !important;
    }
    
    .modern-header.scrolled {
        padding: 6px 0 !important;
        min-height: 55px !important;
    }
    
    body,
    body.logged-in {
        padding-top: 60px !important; /* Reducido para mobile */
    }
    
    /* Logo más pequeño en mobile */
    .site-logo {
        height: 45px !important;
    }
    
    .scrolled .site-logo {
        height: 40px !important;
    }
}

/* 5. MOBILE ESPECÍFICO - ESPACIADO HERO SECTION */
@media (max-width: 768px) {
    .modern-header {
        padding: 6px 0 !important;
        min-height: 55px !important;
    }
    
    body,
    body.logged-in {
        padding-top: 55px !important; /* Aún más reducido */
    }
    
    /* Reducir espaciado de la sección hero */
    .hero-section {
        padding-top: 20px !important; /* Reducido drásticamente */
        min-height: calc(100vh - 55px) !important; /* Ajustar altura */
    }
    
    .hero-title {
        font-size: 2.5rem !important; /* Reducir tamaño de título */
        margin-top: 10px !important;
        margin-bottom: 15px !important;
    }
    
    .hero-subtitle {
        font-size: 1.2rem !important;
        margin-bottom: 10px !important;
    }
    
    .hero-text {
        font-size: 0.95rem !important;
        margin-bottom: 20px !important;
    }
}

/* 6. MENSAJE DE BIENVENIDA - POSICIÓN Y EFECTOS */
.alert-success {
    position: fixed !important;
    top: 70px !important; /* Justo debajo del header */
    left: 0 !important;
    right: 0 !important;
    z-index: 999 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    background-color: rgba(25, 135, 84, 0.95) !important; /* Con transparencia */
    backdrop-filter: blur(5px) !important;
    -webkit-backdrop-filter: blur(5px) !important;
    border: none !important;
    padding: 12px 15px !important;
    font-weight: 500 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
    animation: slideInAlert 0.5s ease-out, fadeOutAlert 4s ease-out 3s forwards !important;
}

/* Animaciones para el mensaje de bienvenida */
@keyframes slideInAlert {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeOutAlert {
    0%, 70% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-100%);
    }
}

/* Ajustar posición en mobile */
@media (max-width: 991.98px) {
    .alert-success {
        top: 60px !important;
        font-size: 14px !important;
        padding: 10px 12px !important;
    }
}

@media (max-width: 768px) {
    .alert-success {
        top: 55px !important;
        font-size: 13px !important;
        padding: 8px 10px !important;
    }
}

/* 7. CORREGIR ALTURA DEL CONTAINER PRINCIPAL */
.container {
    max-width: 1200px !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
}

/* 8. HERO SECTION - OPTIMIZACIÓN MOBILE */
@media (max-width: 576px) {
    .hero-section {
        padding-top: 10px !important;
        padding-bottom: 30px !important;
    }
    
    .hero-title {
        font-size: 2rem !important;
        line-height: 1.2 !important;
    }
    
    .hero-subtitle {
        font-size: 1rem !important;
        line-height: 1.3 !important;
    }
    
    .hero-text {
        font-size: 0.9rem !important;
        line-height: 1.4 !important;
        margin-bottom: 15px !important;
    }
    
    .hero-buttons-container {
        margin-top: 20px !important;
    }
    
    .hero-btn {
        font-size: 0.9rem !important;
        padding: 10px 20px !important;
    }
}

/* 9. OVERRIDE CRÍTICO - ELIMINAR CUALQUIER ESPACIO EXTRA */
.hero-section .container {
    padding-top: 0 !important;
}

/* 10. NAVEGACIÓN - ASEGURAR NEGRO SIEMPRE */
.logged-in .modern-header {
    background-color: rgba(17, 17, 17, 1) !important;
}

.logged-in .modern-header.scrolled {
    background-color: rgba(17, 17, 17, 0.85) !important;
}

/* Override para cualquier clase que esté aplicando burgundy */
.bg-burgundy-brand,
.modern-header.bg-burgundy-brand {
    background-color: rgba(17, 17, 17, 1) !important;
    background: rgba(17, 17, 17, 1) !important;
}

/* 11. AUTO-HIDE PARA MENSAJE DE BIENVENIDA */
.alert-dismissible {
    animation: slideInAlert 0.5s ease-out, autoHideAlert 5s ease-out forwards !important;
}

@keyframes autoHideAlert {
    0%, 60% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-100%);
        display: none;
    }
}

/* 12. ESPACIADO OPTIMIZADO PARA TODO EL LAYOUT */
@media (max-width: 480px) {
    body,
    body.logged-in {
        padding-top: 50px !important;
    }
    
    .modern-header {
        min-height: 50px !important;
        padding: 5px 0 !important;
    }
    
    .alert-success {
        top: 50px !important;
    }
    
    .hero-section {
        padding-top: 5px !important;
        min-height: calc(100vh - 50px) !important;
    }
}

/* 13. ASEGURAR QUE EL CONTENIDO ESTÉ VISIBLE */
.hero-section {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* 14. OVERRIDE FINAL PARA CUALQUIER CONFLICTO DE COLOR */
.modern-header,
.modern-navbar,
.navbar,
.logged-in .modern-header,
.logged-in .modern-navbar {
    background-color: rgba(17, 17, 17, 1) !important;
    background: rgba(17, 17, 17, 1) !important;
}

.modern-header.scrolled,
.logged-in .modern-header.scrolled {
    background-color: rgba(17, 17, 17, 0.85) !important;
    background: rgba(17, 17, 17, 0.85) !important;
}
