/**
 * VIP Theme Optimizations
 * Performance and visual enhancements
 * 
 * @package VIP_Theme
 */

/* ========================================
   PERFORMANCE OPTIMIZATIONS
   ======================================== */

/* GPU acceleration for animated elements */
.vip-logo-image,
.vip-cta-button,
.vip-login-button,
.vip-nav-link,
.scroll-to-top-btn,
.vip-hiw-card,
.vip-partner-item {
  will-change: transform !important;
  backface-visibility: hidden !important;
  transform: translateZ(0) !important;
}

/* Font loading optimization - using system fonts as fallback */
.font-montserrat {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

.font-manrope {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* Lazy loading images */
img.lazy {
  opacity: 0 !important;
  transition: opacity 0.3s !important;
}

img.loaded {
  opacity: 1 !important;
}

/* ========================================
   ACCESSIBILITY ENHANCEMENTS
   ======================================== */

/* Screen reader only content */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Skip to content link */
.skip-to-content:focus {
  position: absolute !important;
  top: 6px !important;
  left: 6px !important;
  background: #D6B77B !important;
  color: #0B0B0C !important;
  padding: 8px 12px !important;
  text-decoration: none !important;
  border-radius: 4px !important;
  z-index: 10000 !important;
  font-weight: 600 !important;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .vip-logo-image,
  .footer-logo-image {
    filter: contrast(1.2) !important;
  }
  
  .vip-nav-link,
  .vip-cta-button,
  .vip-login-button {
    border: 2px solid currentColor !important;
  }
}

/* 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;
  }
  
  .parallax-element {
    transform: none !important;
  }
}

/* Focus indicators for keyboard users - REMOVED PER USER REQUEST */
.keyboard-user *:focus {
  outline: none !important;
}

.keyboard-user .vip-nav-link:focus,
.keyboard-user .vip-cta-button:focus,
.keyboard-user .vip-login-button:focus {
  box-shadow: 0 0 0 3px rgba(214, 183, 123, 0.3) !important;
}

/* ========================================
   VISUAL ENHANCEMENTS
   ======================================== */

/* Smooth scrolling for modern browsers */
html {
  scroll-behavior: smooth !important;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }
}

/* Enhanced glassmorphism effects */
.glass-enhanced {
  background: rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

/* Loading states */
.loading {
  position: relative !important;
  overflow: hidden !important;
}

.loading::after {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: -100% !important;
  width: 100% !important;
  height: 100% !important;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(214, 183, 123, 0.2),
    transparent
  ) !important;
  animation: loading-shimmer 1.5s infinite !important;
}

@keyframes loading-shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* ========================================
   RESPONSIVE OPTIMIZATIONS
   ======================================== */

/* Container queries support */
@supports (container-type: inline-size) {
  .responsive-container {
    container-type: inline-size !important;
  }
  
  @container (min-width: 768px) {
    .container-responsive {
      display: grid !important;
      grid-template-columns: 1fr 1fr !important;
    }
  }
}

/* Modern CSS Grid enhancements */
.grid-modern {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
  gap: 2rem !important;
}

/* Flexbox gap fallback */
.flex-gap {
  display: flex !important;
  gap: 1rem !important;
}

@supports not (gap: 1rem) {
  .flex-gap > * + * {
    margin-left: 1rem !important;
  }
}

/* ========================================
   PRINT OPTIMIZATIONS
   ======================================== */

@media print {
  /* Hide non-essential elements */
  .vip-mobile-toggle,
  .scroll-to-top-btn,
  .vip-login-modal-overlay,
  .social-icons {
    display: none !important;
  }
  
  /* Optimize colors for print */
  .vip-nav-link,
  .vip-hiw-title {
    color: #000 !important;
    background: none !important;
    -webkit-text-fill-color: #000 !important;
  }
  
  /* Ensure logos print well */
  .vip-logo-image,
  .footer-logo-image {
    filter: none !important;
    opacity: 1 !important;
  }
  
  /* Page breaks */
  .vip-hiw-card,
  .vip-partner-item {
    break-inside: avoid !important;
  }
}

/* ========================================
   DARK MODE ENHANCEMENTS
   ======================================== */

@media (prefers-color-scheme: dark) {
  /* Enhanced dark mode support */
  .glass-surface {
    background: rgba(255, 255, 255, 0.04) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
  }
  
  .vip-form-input {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
  }
  
  .vip-form-input:focus {
    background: rgba(255, 255, 255, 0.12) !important;
  }
}

/* ========================================
   BROWSER COMPATIBILITY
   ======================================== */

/* Safari specific fixes */
@supports (-webkit-appearance: none) {
  .vip-logo-image,
  .footer-logo-image {
    -webkit-transform: translateZ(0) !important;
  }
}

/* Firefox specific fixes */
@-moz-document url-prefix() {
  .glass-surface {
    background: rgba(255, 255, 255, 0.06) !important;
  }
}

/* Edge specific fixes */
@supports (-ms-ime-align: auto) {
  .vip-nav-link {
    display: -ms-flexbox !important;
    -ms-flex-align: center !important;
  }
}