/* Cross-browser CSS fallbacks for IE11 and older browsers */

/* CSS Custom Properties (Variables) Fallbacks */
:root {
  /* Primary colors */
  /* --primary-color: #2563eb;
  --primary-hover: #1d4ed8; */
  --primary-light: #dbeafe;
  
  /* Secondary colors */
  --secondary-color: #64748b;
  --secondary-hover: #475569;
  
  /* Text colors */
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  
  /* Background colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-accent: #f1f5f9;
  
  /* Border colors */
  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;
  
  /* Shadow colors */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Backdrop-filter fallbacks */
.backdrop-blur {
  /* Fallback for browsers without backdrop-filter support */
  background-color: rgba(255, 255, 255, 0.8);
  background-color: var(--bg-primary, rgba(255, 255, 255, 0.8));
  
  /* Modern browsers with backdrop-filter */
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.backdrop-blur-dark {
  background-color: rgba(0, 0, 0, 0.8);
  background-color: var(--bg-dark, rgba(0, 0, 0, 0.8));
  
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* CSS Grid fallbacks using Flexbox */
.grid-fallback {
  /* IE11 fallback */
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;
  -ms-flex-wrap: wrap;
  -webkit-flex-wrap: wrap;
  flex-wrap: wrap;
  
  /* Modern browsers */
  display: grid;
}

.grid-cols-1 {
  /* IE11 fallback */
  -ms-flex-direction: column;
  -webkit-flex-direction: column;
  flex-direction: column;
  
  /* Modern browsers */
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
  /* IE11 fallback - children need width: 50% */
}

.grid-cols-2 > * {
  /* IE11 fallback */
  -ms-flex: 0 0 50%;
  -webkit-flex: 0 0 50%;
  flex: 0 0 50%;
  max-width: 50%;
}

.grid-cols-3 > * {
  /* IE11 fallback */
  -ms-flex: 0 0 33.333333%;
  -webkit-flex: 0 0 33.333333%;
  flex: 0 0 33.333333%;
  max-width: 33.333333%;
}

.grid-cols-4 > * {
  /* IE11 fallback */
  -ms-flex: 0 0 25%;
  -webkit-flex: 0 0 25%;
  flex: 0 0 25%;
  max-width: 25%;
}

/* Flexbox vendor prefixes */
.flex {
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;
}

.flex-col {
  -ms-flex-direction: column;
  -webkit-flex-direction: column;
  flex-direction: column;
}

.flex-row {
  -ms-flex-direction: row;
  -webkit-flex-direction: row;
  flex-direction: row;
}

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

.justify-between {
  -ms-flex-pack: justify;
  -webkit-justify-content: space-between;
  justify-content: space-between;
}

.items-center {
  -ms-flex-align: center;
  -webkit-align-items: center;
  align-items: center;
}

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

/* Transform vendor prefixes */
.transform {
  -webkit-transform: translateZ(0);
  -moz-transform: translateZ(0);
  -ms-transform: translateZ(0);
  transform: translateZ(0);
}

.translate-x-full {
  -webkit-transform: translateX(100%);
  -moz-transform: translateX(100%);
  -ms-transform: translateX(100%);
  transform: translateX(100%);
}

.translate-y-full {
  -webkit-transform: translateY(100%);
  -moz-transform: translateY(100%);
  -ms-transform: translateY(100%);
  transform: translateY(100%);
}

.scale-105 {
  -webkit-transform: scale(1.05);
  -moz-transform: scale(1.05);
  -ms-transform: scale(1.05);
  transform: scale(1.05);
}

.rotate-180 {
  -webkit-transform: rotate(180deg);
  -moz-transform: rotate(180deg);
  -ms-transform: rotate(180deg);
  transform: rotate(180deg);
}

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

.transition-transform {
  -webkit-transition: -webkit-transform 0.3s ease;
  -moz-transition: -moz-transform 0.3s ease;
  -ms-transition: -ms-transform 0.3s ease;
  transition: transform 0.3s ease;
}

.transition-opacity {
  -webkit-transition: opacity 0.3s ease;
  -moz-transition: opacity 0.3s ease;
  -ms-transition: opacity 0.3s ease;
  transition: opacity 0.3s ease;
}

/* Box-shadow vendor prefixes */
.shadow-sm {
  -webkit-box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  -moz-box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.shadow-md {
  -webkit-box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  -moz-box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.shadow-lg {
  -webkit-box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  -moz-box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Border-radius vendor prefixes */
.rounded {
  -webkit-border-radius: 0.25rem;
  -moz-border-radius: 0.25rem;
  border-radius: 0.25rem;
}

.rounded-md {
  -webkit-border-radius: 0.375rem;
  -moz-border-radius: 0.375rem;
  border-radius: 0.375rem;
}

.rounded-lg {
  -webkit-border-radius: 0.5rem;
  -moz-border-radius: 0.5rem;
  border-radius: 0.5rem;
}

.rounded-full {
  -webkit-border-radius: 9999px;
  -moz-border-radius: 9999px;
  border-radius: 9999px;
}

/* Appearance vendor prefixes */
.appearance-none {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

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

.select-text {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* Filter vendor prefixes */
.blur {
  -webkit-filter: blur(8px);
  filter: blur(8px);
}

.brightness-50 {
  -webkit-filter: brightness(0.5);
  filter: brightness(0.5);
}

.grayscale {
  -webkit-filter: grayscale(100%);
  filter: grayscale(100%);
}

/* Animation vendor prefixes */
@-webkit-keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@-moz-keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.animate-fadeIn {
  -webkit-animation: fadeIn 0.3s ease-in-out;
  -moz-animation: fadeIn 0.3s ease-in-out;
  animation: fadeIn 0.3s ease-in-out;
}

@-webkit-keyframes slideInUp {
  from {
    -webkit-transform: translateY(100%);
    opacity: 0;
  }
  to {
    -webkit-transform: translateY(0);
    opacity: 1;
  }
}

@-moz-keyframes slideInUp {
  from {
    -moz-transform: translateY(100%);
    opacity: 0;
  }
  to {
    -moz-transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideInUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.animate-slideInUp {
  -webkit-animation: slideInUp 0.3s ease-out;
  -moz-animation: slideInUp 0.3s ease-out;
  animation: slideInUp 0.3s ease-out;
}

/* Touch action for better mobile support */
.touch-pan-x {
  -ms-touch-action: pan-x;
  touch-action: pan-x;
}

.touch-pan-y {
  -ms-touch-action: pan-y;
  touch-action: pan-y;
}

.touch-manipulation {
  -ms-touch-action: manipulation;
  touch-action: manipulation;
}

/* Scroll behavior fallback */
.scroll-smooth {
  scroll-behavior: smooth;
}

/* IE11 specific fixes */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
  /* IE11 Grid fallbacks */
  .grid-fallback {
    display: -ms-flexbox !important;
  }
  
  /* IE11 Flexbox fixes */
  .flex {
    display: -ms-flexbox !important;
  }
  
  /* IE11 doesn't support CSS custom properties */
  .bg-primary {
    background-color: #ffffff !important;
  }
  
  .text-primary {
    color: #1e293b !important;
  }
  
  .border-color {
    border-color: #e2e8f0 !important;
  }
}

/* Safari-specific fixes */
@supports (-webkit-appearance: none) {
    .backdrop-blur {
        -webkit-backdrop-filter: blur(10px);
    }
    
    /* Safari form background fixes */
    input, textarea, select {
        -webkit-appearance: none;
        -webkit-border-radius: 0;
        background-clip: padding-box;
    }
    
    /* Force background colors in Safari */
    .footer-form-field-container,
    .form3-field input,
    .footer-form-field {
        background-color: #FFFFFF !important;
        -webkit-appearance: none !important;
        -webkit-background-clip: padding-box !important;
        background-clip: padding-box !important;
    }
    
    /* Safari checkbox fixes */
    .checkbox-custom {
        background-color: #FFFFFF !important;
        -webkit-appearance: none !important;
    }
    
    /* Safari button background fixes */
    .footer-submit-button,
    .form3-submit-btn {
        -webkit-appearance: none !important;
        background-color: #3E7B51 !important;
    }
    
    /* Safari statistics background fixes */
    .statistics-container {
        -webkit-background-clip: padding-box !important;
        background-clip: padding-box !important;
    }
    
    .footer-stats-number {
        -webkit-background-clip: padding-box !important;
        background-clip: padding-box !important;
    }
}

/* Mobile Safari specific fixes */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    /* iOS Safari form input fixes */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    textarea {
        -webkit-appearance: none;
        -webkit-border-radius: 0;
        background-color: #FFFFFF !important;
        background-clip: padding-box;
    }
    
    /* Force white background on form containers */
    .footer-form-field-container {
        background-color: #FFFFFF !important;
        background-image: none !important;
    }
    
    .form3-field input {
        background-color: #FFFFFF !important;
        background-image: none !important;
    }
}

/* Firefox-specific fixes */
@-moz-document url-prefix() {
    .backdrop-blur {
        background-color: rgba(255, 255, 255, 0.95);
    }
}

/* Print styles */
@media print {
  .no-print {
    display: none !important;
  }
  
  .print-block {
    display: block !important;
  }
  
  * {
    -webkit-print-color-adjust: exact !important;
    color-adjust: exact !important;
  }
}