/* ARCHIVO DE OPTIMIZACIÓN DE RENDIMIENTO */
/* ================================================ */

/* 1. DESACTIVAR ANIMACIONES EN DISPOSITIVOS CON BAJA POTENCIA */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 2. OPTIMIZACIÓN PARA DISPOSITIVOS MÓVILES */
@media (max-width: 768px) {
    /* Reducir número de partículas en móviles */
    .particle {
        display: none;
    }
    
    /* Simplificar animaciones en móviles */
    .phone-mockup {
        animation: none !important;
        transform: none !important;
    }
    
    /* Reducir efectos visuales pesados */
    body::before,
    body::after {
        animation-duration: 60s !important;
    }
    
    /* Simplificar transiciones */
    .pdf-card,
    .enhanced-result-card {
        transition: none !important;
    }
    
    /* Desactivar backdrop-filter en móviles para mejor rendimiento */
    .pdf-card,
    .enhanced-result-card,
    .search-container,
    .results-section,
    .video-card {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
}

/* 3. OPTIMIZACIÓN PARA DISPOSITIVOS DE BAJA POTENCIA */
@media (max-width: 480px) {
    /* Eliminar completamente efectos 3D */
    body {
        perspective: none !important;
    }
    
    .three-d-particles,
    .particles-container {
        display: none !important;
    }
    
    /* Simplificar aún más las animaciones */
    .header-content h1,
    .subtitle {
        animation: none !important;
    }
    
    /* Reducir sombras para mejor rendimiento */
    .pdf-card,
    .enhanced-result-card,
    .video-card {
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    }
}

/* 4. OPTIMIZACIÓN PARA NAVEGADORES WEBKIT (Safari, Chrome) */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    /* Forzar aceleración por hardware */
    .phone-mockup,
    .video-card,
    .pdf-card {
        -webkit-transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        -webkit-perspective: 1000;
    }
}

/* 5. DESACTIVAR EFECTOS PESADOS EN MODO AHORRO DE ENERGÍA */
@media (prefers-color-scheme: dark) and (prefers-contrast: high) {
    /* Simplificar efectos visuales */
    body::before,
    body::after {
        display: none !important;
    }
}

/* 6. OPTIMIZACIÓN GENERAL DE RENDIMIENTO */
* {
    /* Mejorar rendimiento de scroll */
    -webkit-overflow-scrolling: touch;
    
    /* Forzar aceleración por hardware cuando sea posible */
    will-change: auto;
}

/* 7. LIMITAR ALTURA DE SECCIONES PARA MEJORAR SCROLL */
.results-grid {
    max-height: none !important;
}

.video-section {
    /* Limitar altura para evitar problemas de scroll */
    max-height: 100vh !important;
}

/* 8. OPTIMIZACIÓN DE FUENTES */
body {
    /* Forzar renderizado optimizado */
    text-rendering: optimizeSpeed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 9. DESACTIVAR EFECTOS EN MODO DE ALTO CONTRASTE */
@media (prefers-contrast: high) {
    .header-content h1,
    .subtitle,
    .elegant-title {
        animation: none !important;
        text-shadow: none !important;
    }
    
    body::before,
    body::after {
        display: none !important;
    }
}

/* 10. OPTIMIZACIÓN PARA IMPRIMIR (en caso de ser necesario) */
@media print {
    /* Eliminar todos los efectos visuales */
    body::before,
    body::after,
    .three-d-particles,
    .particles-container {
        display: none !important;
    }
    
    /* Simplificar diseño */
    .pdf-card,
    .enhanced-result-card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
}