/* Browser Compatibility CSS
 * Provides fallbacks and vendor prefixes for cross-browser support
 */

/* CSS Grid fallback for older browsers */
@supports not (display: grid) {
  .grid {
    display: flex;
    flex-wrap: wrap;
  }
  
  .grid > * {
    flex: 1 1 auto;
  }
}

/* Flexbox fallback for very old browsers */
@supports not (display: flex) {
  .flex {
    display: table;
  }
  
  .flex > * {
    display: table-cell;
  }
}

/* CSS Custom Properties fallback */
:root {
  /* Fallback values for browsers without custom property support */
  --glow-opacity: 0.5;
  --glow-blur: 12px;
}

/* Backdrop filter fallback */
.glass {
  background: rgba(7, 18, 40, 0.8);
}

@supports (backdrop-filter: blur(10px)) {
  .glass {
    backdrop-filter: blur(10px);
    background: rgba(7, 18, 40, 0.5);
  }
}

/* Smooth scroll behavior fallback */
html {
  scroll-behavior: smooth;
}

@supports not (scroll-behavior: smooth) {
  html {
    scroll-behavior: auto;
  }
  
  /* Use JavaScript smooth scroll as fallback */
  [data-smooth-scroll] {
    cursor: pointer;
  }
}

/* Focus visible fallback */
*:focus {
  outline: 2px solid #bfc8cc;
  outline-offset: 2px;
}

@supports selector(:focus-visible) {
  *:focus:not(:focus-visible) {
    outline: none;
  }
  
  *:focus-visible {
    outline: 2px solid #bfc8cc;
    outline-offset: 2px;
  }
}

/* CSS Grid with fallback */
.grid {
  display: -ms-grid; /* IE10/11 */
  display: grid;
}

/* Flexbox with vendor prefixes for older browsers */
.flex {
  display: -webkit-box; /* Old Safari */
  display: -moz-box; /* Old Firefox */
  display: -ms-flexbox; /* IE10 */
  display: -webkit-flex; /* Safari 6.1+ */
  display: flex;
}

/* Transform with vendor prefixes */
.transform {
  -webkit-transform: translateZ(0);
  -moz-transform: translateZ(0);
  -ms-transform: translateZ(0);
  transform: translateZ(0);
}

/* Transition with 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;
}

/* Animation with vendor prefixes */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.animate-fade-in {
  -webkit-animation: fadeIn 0.3s ease;
  -moz-animation: fadeIn 0.3s ease;
  -ms-animation: fadeIn 0.3s ease;
  animation: fadeIn 0.3s ease;
}

/* Border radius fallback */
.rounded {
  -webkit-border-radius: 0.25rem;
  -moz-border-radius: 0.25rem;
  border-radius: 0.25rem;
}

/* Box shadow fallback */
.shadow {
  -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Opacity fallback for IE8 */
.opacity-50 {
  filter: alpha(opacity=50); /* IE8 */
  opacity: 0.5;
}

/* Gradient fallback */
.bg-gradient {
  background-color: #071228; /* Fallback */
  background-image: -webkit-linear-gradient(to bottom, #071228, #04121a);
  background-image: -moz-linear-gradient(to bottom, #071228, #04121a);
  background-image: -ms-linear-gradient(to bottom, #071228, #04121a);
  background-image: linear-gradient(to bottom, #071228, #04121a);
}

/* Text selection */
::selection {
  background: rgba(191, 200, 204, 0.3);
  color: #fff;
}

::-moz-selection {
  background: rgba(191, 200, 204, 0.3);
  color: #fff;
}

/* Scrollbar styling (Webkit browsers) */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #04121a;
}

::-webkit-scrollbar-thumb {
  background: rgba(191, 200, 204, 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(191, 200, 204, 0.5);
}

/* Print styles */
@media print {
  .no-print {
    display: none !important;
  }
  
  * {
    background: white !important;
    color: black !important;
  }
}

