/* Gambla AI Responsive Design & Mobile Optimizations */

/* --- Mobile Performance Fixes (CRITICAL) --- */
@media (max-width: 768px) {
    /* Rimuovi blur pesanti su mobile per evitare crash GPU */
    .header, .match-card, .card, .modal-content, .tooltip, .popover, .glass-effect {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: rgba(30, 30, 30, 0.95) !important; /* Fallback solido */
    }
    
    /* Rimuovi ombre pesanti */
    .shadow-lg, .shadow-xl, .card, .btn {
        box-shadow: 0 1px 3px rgba(0,0,0,0.2) !important;
    }

    /* Semplifica animazioni */
    .animate-fade-in, .animate-slide-up, .match-card, .team-logo {
        animation: none !important;
        transition: opacity 0.1s linear !important;
    }
    
    /* Forza rendering hardware su container scrollabili */
    .standings-container, .table-responsive, .matches-list, body, html {
        transform: translateZ(0);
        -webkit-overflow-scrolling: touch;
        will-change: scroll-position;
    }
    
    /* Nascondi elementi decorativi pesanti */
    .decoration-bg, .particle, .glow-effect {
        display: none !important;
    }
    
    /* Ottimizza immagini */
    img {
        loading: lazy;
        decoding: async;
    }
}

/* --- Touch Support --- */
@media (hover: none) and (pointer: coarse) {
    /* Aumenta area touch */
    .btn, .nav-link, .page-link, .sortable {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Rimuovi hover effects su touch */
    .match-card:hover {
        transform: none !important;
    }
}

/* --- Layout Adjustments --- */
@media (max-width: 576px) {
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* Font size reduction */
    html {
        font-size: 14px;
    }
    
    h1 { font-size: 1.5rem !important; }
    h2 { font-size: 1.3rem !important; }
    h3 { font-size: 1.15rem !important; }
    
    /* Table adjustments */
    .table-responsive td, .table-responsive th {
        padding: 0.5rem 0.25rem !important;
        font-size: 0.85rem;
    }
    
    .hide-mobile {
        display: none !important;
    }
}

/* iPhone X Safe Areas */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    body {
        padding-bottom: env(safe-area-inset-bottom);
    }
    .navbar-bottom {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
