/* ========================================================
   OPTIMIZACIONES MÓVILES ADICIONALES
   Mejoras específicas para iPhone y dispositivos móviles
   ======================================================== */

/* ==================== PREVENIR ZOOM EN INPUTS (iOS) ==================== */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
select,
textarea {
    font-size: 16px !important;
}

/* ==================== SMOOTH SCROLLING MEJORADO ==================== */
html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==================== OPTIMIZACIÓN DE RENDIMIENTO ==================== */
@media (max-width: 768px) {
    /* Usar transform en lugar de position para mejor rendimiento */
    .floating-icon,
    .parallax-element {
        will-change: transform;
    }
    
    /* Reducir complejidad de sombras */
    * {
        box-shadow: none !important;
    }
    
    .info-card,
    .value-card,
    .contact-card,
    .hero-content {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    }
    
    /* Simplificar blur para mejor rendimiento */
    .hero-content,
    .login-card {
        backdrop-filter: blur(8px) !important;
        -webkit-backdrop-filter: blur(8px) !important;
    }
}

/* ==================== MEJORAS DE TÁCTIL ==================== */
@media (hover: none) and (pointer: coarse) {
    /* Áreas táctiles más grandes */
    button,
    a,
    .chip,
    select {
        min-height: 48px;
        padding: 12px 20px;
    }
    
    /* Feedback visual al tocar */
    button:active,
    a:active,
    .chip:active {
        opacity: 0.8;
        transform: scale(0.97);
        transition: all 0.1s ease;
    }
    
    /* Eliminar delay de tap en iOS */
    a, button, input, select, textarea {
        -webkit-tap-highlight-color: rgba(212, 175, 55, 0.2);
        touch-action: manipulation;
    }
}

/* ==================== TABLAS RESPONSIVE MEJORADAS ==================== */
@media (max-width: 768px) {
    .schedule-container {
        position: relative;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        border-radius: 12px;
        box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
    }
    
    /* Indicador de scroll */
    .schedule-container::after {
        content: '← Desliza →';
        position: absolute;
        bottom: 10px;
        right: 10px;
        background: rgba(212, 175, 55, 0.9);
        color: white;
        padding: 5px 12px;
        border-radius: 20px;
        font-size: 0.7rem;
        font-weight: 600;
        pointer-events: none;
        animation: pulseIndicator 2s ease-in-out infinite;
    }
    
    @keyframes pulseIndicator {
        0%, 100% { opacity: 0.7; }
        50% { opacity: 1; }
    }
    
    table {
        min-width: 650px;
    }
    
    th, td {
        white-space: nowrap;
    }
}

/* ==================== MODALES OPTIMIZADOS PARA MÓVIL ==================== */
@media (max-width: 768px) {
    .modal-overlay {
        padding: 20px;
        align-items: flex-end;
    }
    
    .modal-overlay .login-card,
    .modal-overlay .modal-content {
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 20px 20px 0 0;
        animation: slideUp 0.3s ease-out;
    }
    
    @keyframes slideUp {
        from {
            transform: translateY(100%);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }
    
    .custom-modal-content {
        max-height: 80vh;
        overflow-y: auto;
    }
}

/* ==================== NAVEGACIÓN STICKY MEJORADA ==================== */
@media (max-width: 768px) {
    .neon-nav {
        position: sticky;
        top: 0;
        z-index: 1000;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
}

/* ==================== BOTONES FLOTANTES PARA MÓVIL ==================== */
@media (max-width: 768px) {
    .btn-group {
        position: sticky;
        bottom: 20px;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        padding: 15px;
        border-radius: 16px;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
        z-index: 100;
    }
}

/* ==================== CHAT OPTIMIZADO PARA MÓVIL ==================== */
@media (max-width: 768px) {
    .chat-container {
        height: 400px;
        max-height: 50vh;
        border-radius: 16px;
    }
    
    .chat-messages {
        padding: 15px;
        scroll-behavior: smooth;
    }
    
    .user-message,
    .bot-message {
        max-width: 85%;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .chat-input-container {
        padding: 12px;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
    
    .chat-input-container input {
        font-size: 16px;
        padding: 12px 15px;
        border-radius: 12px;
    }
    
    .chat-input-container button {
        min-width: 50px;
        height: 50px;
        border-radius: 12px;
    }
}

/* ==================== TARJETAS EXPANDIBLES MÓVIL ==================== */
@media (max-width: 768px) {
    .value-card {
        cursor: pointer;
        transition: all 0.3s ease;
    }
    
    .value-card.expanded {
        position: relative;
        z-index: 10;
        transform: scale(1.02);
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2) !important;
    }
    
    .value-content {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease;
    }
    
    .value-card.expanded .value-content {
        max-height: 500px;
    }
}

/* ==================== IMÁGENES Y MEDIA RESPONSIVE ==================== */
@media (max-width: 768px) {
    img {
        max-width: 100%;
        height: auto;
    }
    
    .photo-placeholder {
        width: 150px !important;
        height: 150px !important;
        margin: 0 auto;
    }
}

/* ==================== FORMULARIOS MEJORADOS PARA MÓVIL ==================== */
@media (max-width: 768px) {
    .input-wrapper {
        margin-bottom: 15px;
    }
    
    .input-wrapper input,
    .input-wrapper select {
        width: 100%;
        padding: 14px 16px;
        font-size: 16px;
        border-radius: 12px;
        border: 2px solid var(--border-light);
        transition: all 0.3s ease;
    }
    
    .input-wrapper input:focus,
    .input-wrapper select:focus {
        border-color: var(--color-secondary);
        outline: none;
        box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
    }
}

/* ==================== ESTADÍSTICAS RESPONSIVE ==================== */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    .stat-card {
        padding: 20px;
        border-radius: 12px;
    }
    
    .stat-number {
        font-size: 2.5rem !important;
    }
    
    .stat-label {
        font-size: 0.9rem !important;
    }
}

/* ==================== LOADING STATES PARA MÓVIL ==================== */
@media (max-width: 768px) {
    .loading {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 9999;
    }
    
    .loading::after {
        content: '';
        width: 50px;
        height: 50px;
        border: 4px solid rgba(212, 175, 55, 0.2);
        border-top-color: var(--color-secondary);
        border-radius: 50%;
        animation: spin 0.8s linear infinite;
    }
    
    @keyframes spin {
        to { transform: rotate(360deg); }
    }
}

/* ==================== NOTIFICACIONES MÓVIL ==================== */
@media (max-width: 768px) {
    #toast-container {
        bottom: 80px;
        left: 10px;
        right: 10px;
        width: auto;
    }
    
    .toast {
        width: 100%;
        padding: 15px 20px;
        font-size: 0.9rem;
        border-radius: 12px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    }
}

/* ==================== ACCESIBILIDAD MÓVIL ==================== */
@media (max-width: 768px) {
    /* Mejorar contraste */
    .neon-nav a {
        color: var(--text-primary);
        background: rgba(0, 0, 0, 0.05);
    }
    
    .neon-nav a:active {
        background: rgba(212, 175, 55, 0.2);
    }
    
    /* Espaciado entre elementos interactivos */
    button + button,
    a + a {
        margin-left: 10px;
    }
    
    /* Mejorar legibilidad */
    p, li, span {
        line-height: 1.7;
        letter-spacing: 0.3px;
    }
}

/* ==================== ORIENTACIÓN LANDSCAPE ==================== */
@media (max-width: 768px) and (orientation: landscape) {
    .nike-hero {
        min-height: 100vh;
    }
    
    .hero-content {
        padding: 30px 40px !important;
    }
    
    .hero-content h1 {
        font-size: 2.5rem !important;
    }
    
    .hero-btns {
        flex-direction: row !important;
    }
    
    .hero-btns button {
        width: auto !important;
    }
    
    .chat-container {
        height: 300px;
    }
}

/* ==================== PREVENIR SELECCIÓN ACCIDENTAL ==================== */
@media (max-width: 768px) {
    .neon-nav .logo,
    .section-title,
    .stat-number {
        -webkit-user-select: none;
        user-select: none;
    }
}

/* ==================== ANIMACIONES REDUCIDAS PARA AHORRO DE BATERÍA ==================== */
@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


/* ==================== AJUSTES PARA TARJETAS DEL EQUIPO EN MÓVIL ==================== */
@media (max-width: 768px) {
    /* Grid de desarrolladores responsive */
    #contact > div > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 25px !important;
        padding: 20px !important;
    }
    
    /* Tarjetas de perfil más compactas */
    .tilt-3d {
        padding: 25px !important;
    }
    
    /* Avatar más pequeño en móvil */
    .tilt-3d > div[style*="width: 120px"] {
        width: 100px !important;
        height: 100px !important;
    }
    
    .tilt-3d > div[style*="width: 120px"] i {
        font-size: 3rem !important;
    }
    
    /* Títulos más pequeños */
    .tilt-3d h3 {
        font-size: 1.3rem !important;
    }
    
    /* Descripción más compacta */
    .tilt-3d p {
        font-size: 0.85rem !important;
        line-height: 1.5 !important;
    }
    
    /* Botones de redes sociales */
    .tilt-3d .social-links,
    .tilt-3d > div[style*="display: flex"] {
        gap: 8px !important;
    }
    
    .tilt-3d a[style*="width: 40px"] {
        width: 36px !important;
        height: 36px !important;
    }
    
    .tilt-3d a[style*="width: 40px"] i {
        font-size: 1.1rem !important;
    }
}

/* ==================== EASTER EGGS OPTIMIZADOS PARA MÓVIL ==================== */
@media (max-width: 768px) {
    /* Confeti más pequeño en móvil */
    .confetti,
    div[style*="fallDown"] {
        font-size: 16px !important;
    }
    
    /* Notificaciones más pequeñas */
    .toast {
        font-size: 0.85rem !important;
        padding: 12px 16px !important;
        max-width: 90% !important;
    }
    
    /* Desactivar efectos de paralaje en móvil (mejor rendimiento) */
    .parallax-element {
        transform: none !important;
    }
    
    /* Simplificar animaciones en móvil */
    * {
        animation-duration: 0.3s !important;
    }
}

/* ==================== MODALES EN MÓVIL ==================== */
@media (max-width: 768px) {
    /* Modal de confirmación personalizado */
    .custom-modal-content {
        width: 90% !important;
        max-width: 350px !important;
        padding: 25px 20px !important;
    }
    
    .custom-modal-icon {
        font-size: 3rem !important;
    }
    
    .custom-modal-content h3 {
        font-size: 1.3rem !important;
    }
    
    .custom-modal-buttons {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    .custom-modal-btn {
        width: 100% !important;
    }
    
    /* Modal de noticias */
    #news-modal .login-card {
        width: 95% !important;
        max-width: 95% !important;
        padding: 25px 20px !important;
    }
    
    /* Modal de reportes */
    #report-detail-modal .login-card,
    #report-success-modal .login-card {
        width: 95% !important;
        max-width: 95% !important;
        padding: 25px 20px !important;
    }
}

/* ==================== NAVEGACIÓN MEJORADA PARA MÓVIL ==================== */
@media (max-width: 768px) {
    /* Asegurar que la navegación sea scrolleable */
    .neon-nav ul {
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
    }
    
    .neon-nav ul::-webkit-scrollbar {
        display: none !important;
    }
    
    /* Indicador de más contenido */
    .neon-nav ul::after {
        content: '' !important;
        position: absolute !important;
        right: 0 !important;
        top: 0 !important;
        bottom: 0 !important;
        width: 30px !important;
        background: linear-gradient(to left, var(--bg-secondary), transparent) !important;
        pointer-events: none !important;
    }
}

/* ==================== SECCIÓN DE NOTICIAS EN MÓVIL ==================== */
@media (max-width: 768px) {
    .news-feed {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    .news-card {
        margin: 0 !important;
    }
    
    .news-card-image {
        height: 180px !important;
    }
    
    .news-card-content {
        padding: 20px !important;
    }
    
    .news-card-title {
        font-size: 1.1rem !important;
    }
    
    .news-card-description {
        font-size: 0.9rem !important;
    }
    
    /* Filtros de noticias */
    .filter-btn {
        padding: 8px 14px !important;
        font-size: 0.8rem !important;
        flex: 1 1 calc(50% - 5px) !important;
    }
}

/* ==================== SECCIÓN DE REPORTES EN MÓVIL ==================== */
@media (max-width: 768px) {
    .report-form-container {
        padding: 30px 20px !important;
    }
    
    .report-card {
        padding: 20px !important;
    }
    
    .report-card-header {
        flex-direction: column !important;
        gap: 15px !important;
    }
    
    .report-card-footer {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 15px !important;
    }
    
    .report-actions {
        width: 100% !important;
        flex-direction: column !important;
    }
    
    .report-action-btn {
        width: 100% !important;
        justify-content: center !important;
    }
    
    /* Filtros de estado */
    .status-filter-btn {
        flex: 1 1 calc(50% - 5px) !important;
        padding: 8px 14px !important;
        font-size: 0.8rem !important;
    }
}

/* ==================== HERO SECTION EN MÓVIL ==================== */
@media (max-width: 768px) {
    .nike-hero {
        min-height: 70vh !important;
        padding: 30px 15px !important;
    }
    
    .hero-content {
        padding: 30px 20px !important;
        border-radius: 20px !important;
    }
    
    .hero-content h1 {
        font-size: 2.5rem !important;
        line-height: 1.2 !important;
    }
    
    .hero-content p {
        font-size: 0.95rem !important;
    }
    
    .hero-btns {
        flex-direction: column !important;
        gap: 12px !important;
        width: 100% !important;
    }
    
    .hero-btns button {
        width: 100% !important;
    }
}

/* ==================== VALORES Y MISIÓN EN MÓVIL ==================== */
@media (max-width: 768px) {
    .values-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    .value-card {
        padding: 25px 20px !important;
    }
    
    .value-icon {
        font-size: 2rem !important;
        width: 70px !important;
        height: 70px !important;
    }
    
    .value-card h3 {
        font-size: 1.3rem !important;
    }
}

/* ==================== ESTADÍSTICAS EN MÓVIL ==================== */
@media (max-width: 768px) {
    .stats-grid,
    .quick-stats > div {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    .stat-card {
        padding: 18px !important;
    }
    
    .stat-number {
        font-size: 2.2rem !important;
    }
}

/* ==================== CHAT DE SOPORTE EN MÓVIL ==================== */
@media (max-width: 768px) {
    .chat-container {
        height: 400px !important;
        max-height: 50vh !important;
    }
    
    .chat-messages {
        padding: 15px !important;
    }
    
    .message-content {
        font-size: 0.9rem !important;
    }
    
    .chat-input-container {
        padding: 12px !important;
    }
    
    .chat-input-container input {
        font-size: 16px !important;
        padding: 12px !important;
    }
}

/* ==================== CONTACTO EN MÓVIL ==================== */
@media (max-width: 768px) {
    .contact-card {
        padding: 30px 20px !important;
    }
    
    .contact-card h3 {
        font-size: 1.4rem !important;
    }
    
    .contact-card a {
        font-size: 1rem !important;
        padding: 12px 20px !important;
    }
}

/* ==================== FIX PARA LANDSCAPE EN MÓVIL ==================== */
@media (max-width: 768px) and (orientation: landscape) {
    .nike-hero {
        min-height: 100vh !important;
    }
    
    .hero-content {
        padding: 25px 30px !important;
    }
    
    .hero-content h1 {
        font-size: 2rem !important;
        margin-bottom: 10px !important;
    }
    
    .hero-content p {
        margin-bottom: 15px !important;
    }
    
    .hero-btns {
        flex-direction: row !important;
        gap: 10px !important;
    }
    
    .hero-btns button {
        width: auto !important;
        padding: 12px 24px !important;
    }
}

/* ==================== PREVENIR PROBLEMAS DE OVERFLOW ==================== */
@media (max-width: 768px) {
    body {
        overflow-x: hidden !important;
    }
    
    section {
        overflow-x: hidden !important;
    }
    
    /* Asegurar que nada se salga del viewport */
    * {
        max-width: 100%;
    }
    
    /* Imágenes responsive */
    img {
        max-width: 100% !important;
        height: auto !important;
    }
}

/* ==================== MEJORAS DE ACCESIBILIDAD EN MÓVIL ==================== */
@media (max-width: 768px) {
    /* Mejorar contraste */
    .neon-nav a {
        background: rgba(255, 255, 255, 0.08) !important;
        border: 1px solid rgba(255, 255, 255, 0.15) !important;
    }
    
    /* Espaciado entre elementos interactivos */
    button + button,
    a + a {
        margin-left: 8px;
    }
    
    /* Mejorar legibilidad */
    p, li, span {
        line-height: 1.7 !important;
    }
}

/* ==================== ANIMACIONES REDUCIDAS PARA AHORRO DE BATERÍA ==================== */
@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    /* Desactivar efectos de paralaje */
    .parallax-element {
        transform: none !important;
    }
    
    /* Desactivar animaciones de fondo */
    .floating-particles,
    .hero-particles {
        display: none !important;
    }
}

/* ==================== FIN DE OPTIMIZACIONES MÓVILES ==================== */
