/* ================================
   NEUROFISSION - CROSS-BROWSER COMPATIBILITY
   ================================ */

/* CSS Reset for Cross-Browser Consistency */
*, *::before, *::after {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

/* Browser-specific prefixes for gradients */
.gradient-bg {
    background: -webkit-linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background: -moz-linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background: -o-linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.glass-bg {
    background: rgba(255, 255, 255, 0.1);
    /* Fallback for older browsers */
    background: -webkit-linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
}

/* Backdrop Filter Support */
.backdrop-blur {
    /* Modern browsers */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    
    /* Fallback for unsupported browsers */
    background: rgba(0, 0, 0, 0.8);
}

/* Support for backdrop-filter */
@supports (backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px)) {
    .backdrop-blur {
        background: rgba(0, 0, 0, 0.3);
    }
}

/* Transform prefixes */
.transform-element {
    -webkit-transform: translateY(0);
    -moz-transform: translateY(0);
    -ms-transform: translateY(0);
    -o-transform: translateY(0);
    transform: translateY(0);
}

/* Transition prefixes */
.transition-element {
    -webkit-transition: all 0.3s ease;
    -moz-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
}

/* Border radius for older browsers */
.rounded {
    -webkit-border-radius: 20px;
    -moz-border-radius: 20px;
    border-radius: 20px;
}

/* Box shadow prefixes */
.shadow {
    -webkit-box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    -moz-box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Flex fallbacks for IE */
.flex-container {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
}

.flex-center {
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
}

.flex-column {
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
}

.flex-row {
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -ms-flex-direction: row;
    flex-direction: row;
}

.flex-wrap {
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
}

.flex-1 {
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
}

/* Grid fallbacks for older browsers */
.grid-container {
    display: grid;
    display: -ms-grid;
}

/* Fallback for browsers without grid support */
@supports not (display: grid) {
    .grid-container {
        display: flex;
        flex-wrap: wrap;
    }
    
    .grid-item {
        flex: 1 1 300px;
        margin: 10px;
    }
    
    .stats-grid .grid-item {
        flex: 1 1 250px;
    }
    
    .services-grid .grid-item {
        flex: 1 1 350px;
    }
}

/* Text gradient fallbacks */
.text-gradient {
    background: -webkit-linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    
    /* Fallback for browsers that don't support background-clip: text */
    color: #667eea;
}

@supports (-webkit-background-clip: text) or (background-clip: text) {
    .text-gradient {
        color: transparent;
    }
}

/* Animation prefixes */
@-webkit-keyframes fadeInUp {
    from {
        opacity: 0;
        -webkit-transform: translateY(30px);
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        -webkit-transform: translateY(0);
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        -webkit-transform: translateY(30px);
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        -webkit-transform: translateY(0);
        transform: translateY(0);
    }
}

.animate-fadeInUp {
    -webkit-animation: fadeInUp 0.8s ease-out;
    animation: fadeInUp 0.8s ease-out;
}

/* Filter effects with fallbacks */
.blur-effect {
    -webkit-filter: blur(10px);
    filter: blur(10px);
}

.brightness-effect {
    -webkit-filter: brightness(1.2);
    filter: brightness(1.2);
}

/* User select prefixes */
.no-select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Appearance reset for form elements */
.form-control,
.btn {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Scrollbar styling for webkit browsers */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--accent-secondary);
}

/* Firefox scrollbar styling */
.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) rgba(255, 255, 255, 0.1);
}

/* IE/Edge specific styles */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    .flex-container {
        display: -ms-flexbox;
    }
    
    .backdrop-blur {
        background: rgba(0, 0, 0, 0.8);
        backdrop-filter: none;
    }
    
    .text-gradient {
        color: #667eea;
        background: none;
    }
}

/* Safari specific fixes */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    .input-field {
        -webkit-appearance: none;
        border-radius: 0;
    }
}

/* Firefox specific fixes */
@-moz-document url-prefix() {
    .backdrop-blur {
        background: rgba(0, 0, 0, 0.8);
    }
    
    .form-control {
        -moz-appearance: none;
    }
}

/* Chrome/Safari input styling */
.form-control::-webkit-input-placeholder {
    color: var(--text-muted);
    opacity: 1;
}

.form-control::-moz-placeholder {
    color: var(--text-muted);
    opacity: 1;
}

.form-control:-ms-input-placeholder {
    color: var(--text-muted);
    opacity: 1;
}

.form-control::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

/* Focus styles for accessibility */
.btn:focus,
.form-control:focus,
.nav-link:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .glass-effect {
        background: rgba(0, 0, 0, 0.9);
        border: 2px solid white;
    }
    
    .text-gradient {
        color: white;
        background: none;
    }
}

/* Reduced motion support */
@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;
    }
    
    .floating-element {
        animation: none;
    }
    
    .particles-bg {
        animation: none;
    }
}

/* Print styles */
@media print {
    .glass-effect {
        background: white;
        border: 1px solid black;
        backdrop-filter: none;
    }
    
    .text-gradient {
        color: black;
        background: none;
    }
    
    .shadow {
        box-shadow: none;
    }
}
