/* =================================================================
   OPTIMIZACIÓN MOBILE - COMMUNITY LEAGUE
   Mejoras adicionales para dispositivos móviles
   ================================================================= */

/* AJUSTES GENERALES PARA MÓVILES */
@media (max-width: 768px) {
    /* Mejorar espaciado general en móvil */
    .container {
        padding: 0 1rem !important;
    }
    
    /* Títulos de secciones más pequeños */
    h1 {
        font-size: 2rem !important;
    }
    
    h2 {
        font-size: 1.75rem !important;
    }
    
    h3 {
        font-size: 1.5rem !important;
    }
    
    /* Textos más legibles en móvil */
    p, li {
        font-size: 1rem !important;
        line-height: 1.6 !important;
    }
    
    /* Botones más accesibles en táctil */
    button, .btn, a[class*="btn"] {
        min-height: 44px !important;
        min-width: 44px !important;
        padding: 0.75rem 1.5rem !important;
    }
    
    /* Tablas responsive */
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Imágenes responsive */
    img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Grid adaptable a 1 columna */
    [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
    
    /* Flex adaptable a columna */
    [style*="display: flex"][style*="gap"] {
        flex-direction: column !important;
    }
}

/* CELULARES PEQUEÑOS (iPhone SE, etc.) */
@media (max-width: 480px) {
    /* Ajustes para pantallas muy pequeñas */
    .container {
        padding: 0 0.75rem !important;
    }
    
    /* Títulos aún más pequeños */
    h1 {
        font-size: 1.75rem !important;
    }
    
    h2 {
        font-size: 1.5rem !important;
    }
    
    h3 {
        font-size: 1.25rem !important;
    }
    
    /* Texto base */
    body {
        font-size: 0.95rem !important;
    }
    
    /* Botones de texto más compacto */
    button, .btn, a[class*="btn"] {
        font-size: 0.9rem !important;
    }
    
    /* Padding reducido */
    section {
        padding: 2rem 0 !important;
    }
}

/* TABLETS (iPad, Android tablets) */
@media (min-width: 769px) and (max-width: 1024px) {
    /* Ajustes para tablets */
    .container {
        max-width: 100%;
        padding: 0 2rem;
    }
    
    /* Grids de 2 columnas en tablet */
    [style*="grid-template-columns: repeat(auto-fit"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    /* Logos de equipos en 3 columnas */
    #campeones-oro-container,
    #campeones-plata-container {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* MENÚ HAMBURGUESA - Asegurar visibilidad */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex !important;
        flex-direction: column;
        gap: 4px;
        cursor: pointer;
        padding: 8px;
        z-index: 1001;
    }
    
    .nav-toggle span {
        display: block;
        width: 25px;
        height: 3px;
        background: var(--dorado-principal, #D4AF37);
        border-radius: 2px;
        transition: all 0.3s ease;
    }
    
    /* Animación del menú hamburguesa activo */
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
}

/* TARJETAS DE EQUIPOS - Responsive */
@media (max-width: 768px) {
    /* Logos de campeones */
    #campeones-oro-container,
    #campeones-plata-container {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }
    
    /* Tarjetas más compactas en móvil */
    [style*="min-height: 280px"] {
        min-height: auto !important;
    }
}

@media (max-width: 480px) {
    /* En celulares pequeños, 1 columna */
    #campeones-oro-container,
    #campeones-plata-container {
        grid-template-columns: 1fr !important;
    }
}

/* CALENDARIO - Responsive */
@media (max-width: 768px) {
    .calendario-item {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
    
    .calendario-date {
        width: 100% !important;
        text-align: left !important;
    }
}

/* ESTADÍSTICAS - Responsive */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr !important;
    }
    
    .stat-item {
        padding: 1rem !important;
    }
}

/* SPONSORS - Responsive */
@media (max-width: 768px) {
    .sponsors-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 480px) {
    .sponsors-grid {
        grid-template-columns: 1fr !important;
    }
}

/* GALERÍA - Responsive */
@media (max-width: 768px) {
    .galeria-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 480px) {
    .galeria-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Hero ya tiene responsive integrado en style.css */

/* FOOTER - Responsive */
@media (max-width: 768px) {
    footer {
        padding: 2rem 1rem !important;
    }
    
    footer .footer-content {
        flex-direction: column !important;
        text-align: center !important;
    }
    
    footer .social-links {
        justify-content: center !important;
    }
}

/* TOUCH TARGETS - Mejorar para dispositivos táctiles */
@media (hover: none) and (pointer: coarse) {
    /* Aumentar área de toque */
    a, button, .clickable {
        min-height: 48px !important;
        min-width: 48px !important;
    }
    
    /* Botones más grandes en táctil */
    .btn-primary,
    .btn-secondary {
        padding: 1rem 2rem !important;
        font-size: 1.1rem !important;
    }
}

/* ==================== LANDSCAPE MODE - NETFLIX STYLE ==================== */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: 65vh !important; /* altura natural elegante */
        background-attachment: scroll !important;
    }
    
    .hero-content {
        padding: 1.5rem 2rem !important;
    }
    
    .hero-logo-circle {
        width: 25vh !important;
        max-width: 140px !important;
        min-width: 100px !important;
        margin-bottom: 1.5rem !important;
    }
    
    .hero-title {
        font-size: 2.2rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    .hero-subtitle {
        font-size: 1.1rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .hero-description {
        font-size: 0.95rem !important;
        margin-bottom: 1.5rem !important;
    }
    
    .hero-buttons {
        flex-direction: row !important;
        gap: 1rem !important;
    }
    
    .hero-buttons .btn-large {
        padding: 0.9rem 2rem !important;
        font-size: 0.95rem !important;
    }
    
    .scroll-indicator {
        bottom: 1.5rem !important;
    }
}

/* ==================== MÓVILES PEQUEÑOS - NETFLIX STYLE ==================== */
@media (max-width: 480px) {
    .hero {
        background-attachment: scroll !important;
    }
    
    .hero-logo-circle {
        width: 50vw !important;
        max-width: 200px !important;
        min-width: 180px !important;
        padding: 1.3rem !important;
    }
    
    .hero-title {
        letter-spacing: 1px !important;
    }
    
    .hero-buttons {
        padding: 0 1.5rem !important;
    }
    
    .hero-buttons .btn-large {
        padding: 1.4rem 2rem !important;
        font-size: 1.05rem !important;
    }
}

/* OCULTAR ELEMENTOS NO ESENCIALES EN MÓVIL */
@media (max-width: 768px) {
    /* Ocultar decoraciones no esenciales */
    [class*="decoration"],
    [class*="pattern"] {
        display: none !important;
    }
    
    /* Simplificar animaciones */
    * {
        animation-duration: 0.3s !important;
        transition-duration: 0.3s !important;
    }
}

/* ACCESIBILIDAD MÓVIL */
@media (max-width: 768px) {
    /* Foco visible en elementos interactivos */
    a:focus,
    button:focus,
    input:focus {
        outline: 3px solid var(--dorado-principal, #D4AF37) !important;
        outline-offset: 2px !important;
    }
    
    /* Mejorar contraste */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* OPTIMIZACIÓN DE PERFORMANCE EN MÓVIL */
@media (max-width: 768px) {
    /* Reducir blur y sombras pesadas */
    [style*="backdrop-filter"],
    [style*="filter: blur"] {
        backdrop-filter: none !important;
        filter: none !important;
    }
    
    /* Simplificar sombras */
    [style*="box-shadow"] {
        box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important;
    }
}

/* FIX PARA SCROLL HORIZONTAL EN MÓVIL */
body, html {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

* {
    max-width: 100% !important;
}

/* VIEWPORT HEIGHT FIX PARA MÓVILES */
@media (max-width: 768px) {
    .full-height {
        min-height: 100vh !important;
        min-height: -webkit-fill-available !important;
    }
}

/* BOTÓN DE ADMIN - Visible en móvil */
@media (max-width: 768px) {
    a[href*="admin"] {
        bottom: 20px !important;
        left: 20px !important;
        width: 15px !important;
        height: 15px !important;
        opacity: 0.5 !important;
    }
    
    a[href*="admin"]:active {
        transform: scale(5) !important;
    }
}
