/**
 * Browser Fallbacks CSS
 * Provides fallbacks for older browsers and better cross-browser compatibility
 */

/* ===== IE FALLBACKS ===== */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    /* IE 10+ specific styles */
    .glass-effect {
        background: rgba(255, 255, 255, 0.9) !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
    }
    
    .text-gradient {
        background: none !important;
        color: inherit !important;
    }
    
    .backdrop-blur {
        background: rgba(255, 255, 255, 0.95) !important;
    }
}

/* ===== MOBILE OPTIMIZATIONS ===== */
@media screen and (max-width: 768px) {
    .glass-effect {
        background: rgba(255, 255, 255, 0.95) !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
    
    .backdrop-blur {
        background: rgba(255, 255, 255, 0.98) !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
}

/* ===== SAFARI SPECIFIC FIXES ===== */
@supports (-webkit-appearance: none) {
    .glass-effect {
        -webkit-backdrop-filter: blur(20px);
        backdrop-filter: blur(20px);
    }
}

/* ===== FIREFOX SPECIFIC FIXES ===== */
@-moz-document url-prefix() {
    .glass-effect {
        background: rgba(255, 255, 255, 0.9) !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
    }
}

/* ===== CHROME/EDGE SPECIFIC FIXES ===== */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    .text-gradient {
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
.browser-ie *,
.browser-ie *::before,
.browser-ie *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
}

.browser-mobile .glass-effect {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ===== HIGH CONTRAST MODE SUPPORT ===== */
@media (prefers-contrast: high) {
    .glass-effect {
        background: rgba(255, 255, 255, 0.98) !important;
        border: 2px solid #000 !important;
    }
    
    .text-gradient {
        background: none !important;
        color: #000 !important;
    }
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    .glass-effect {
        background: rgba(0, 0, 0, 0.8) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
    }
    
    .text-gradient {
        background: linear-gradient(45deg, #fff, #ccc) !important;
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .glass-effect {
        background: white !important;
        border: 1px solid #000 !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
    
    .text-gradient {
        background: none !important;
        color: #000 !important;
    }
    
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* ===== FOCUS IMPROVEMENTS ===== */
.glass-effect:focus,
.glass-effect:focus-visible {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* ===== LOADING STATES ===== */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== ERROR STATES ===== */
.error-state {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #dc3545;
}

.error-state .glass-effect {
    background: rgba(220, 53, 69, 0.1) !important;
    border: 1px solid rgba(220, 53, 69, 0.3) !important;
}

/* ===== SUCCESS STATES ===== */
.success-state {
    background: rgba(25, 135, 84, 0.1);
    border: 1px solid rgba(25, 135, 84, 0.3);
    color: #198754;
}

.success-state .glass-effect {
    background: rgba(25, 135, 84, 0.1) !important;
    border: 1px solid rgba(25, 135, 84, 0.3) !important;
}
