/* Production Optimized Public Styles */

/* ===== CSS Custom Properties ===== */
:root {
  /* Keep only font variables - colors are in Tailwind config */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Poppins', 'Inter', system-ui, sans-serif;
}

/* ===== Base Styles ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== Custom Scrollbar (Desktop Only) ===== */
@media (min-width: 768px) {
  ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }

  ::-webkit-scrollbar-track {
    background: transparent; /* softDark */
  }

  ::-webkit-scrollbar-thumb {
    background: #4338ca; /* brandIndigo */
    border-radius: 5px;
    border: 2px solid transparent; /* softDark */
  }

  ::-webkit-scrollbar-thumb:hover {
    background: #d4af37; /* brandGold */
  }
  
  /* Firefox */
  * {
    scrollbar-width: thin;
    scrollbar-color: #4338ca transparent; /* brandIndigo softDark */
  }
}

/* ===== Utility Classes ===== */

/* Hide mobile bottom nav on desktop */
@media (min-width: 768px) {
  .mobile-bottom-nav {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }
}

/* Hero background gradient */
.hero-gradient {
  background: linear-gradient(
    135deg,
    #0f102f 0%, /* softDark */
    #1a1b3a 50%,
    #0a0a1a 100% /* brandDark */
  );
  position: relative;
  overflow: hidden;
}

.hero-gradient::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    circle at 20% 50%,
    rgba(67, 56, 202, 0.15) 0%, /* brandIndigo with opacity */
    transparent 50%
  );
  pointer-events: none;
  z-index: 0;
}

.hero-gradient > * {
  position: relative;
  z-index: 1;
}

/* ===== Accessibility Enhancements ===== */

/* Focus styles for keyboard navigation */
:focus-visible {
  outline: 3px solid #d4af37; /* brandGold */
  outline-offset: 2px;
  border-radius: 0.25rem;
}

/* Remove focus for mouse users (optional) */
.focus-visible:focus:not(:focus-visible) {
  outline: none;
}

/* Screen reader only content */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sr-only:focus,
.sr-only:active {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* ===== Performance Optimizations ===== */

/* Content-visibility for images */
img[loading="lazy"] {
  content-visibility: auto;
  contain-intrinsic-size: 1px 1000px;
}

/* Reduce motion for users who prefer it */
@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;
  }
}

/* ===== Animation Keyframes ===== */

/* Floating animation */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Pulse gold animation */
@keyframes pulse-gold {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.1);
  }
}

/* Slow spin animation */
@keyframes spin-slow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Fade in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Pulse slow animation */
@keyframes pulse-slow {
  0%, 100% {
    opacity: 0.4;
  }
  50% {
    opacity: 0.7;
  }
}

/* Loading skeleton animation */
@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ===== Animation Utility Classes ===== */
.floating {
  animation: float 6s ease-in-out infinite;
  will-change: transform;
  backface-visibility: hidden;
}

.animate-pulse-gold {
  animation: pulse-gold 2s ease-in-out infinite;
  will-change: transform, opacity;
  backface-visibility: hidden;
}

.animate-spin-slow {
  animation: spin-slow 20s linear infinite;
  will-change: transform;
}

.animate-fade-in {
  animation: fadeIn 0.8s ease-out forwards;
  opacity: 0;
  will-change: transform, opacity;
}

.animate-pulse-slow {
  animation: pulse-slow 4s ease-in-out infinite;
  will-change: opacity;
}

.delay-1 {
  animation-delay: 1s;
}

.delay-2 {
  animation-delay: 2s;
}

/* ===== Visual Effects ===== */

/* Target rings for shooting theme */
.target-ring {
  border: 2px solid rgba(212, 175, 55, 0.3); /* brandGold with opacity */
  border-radius: 50%;
  position: absolute;
  pointer-events: none;
  z-index: 0;
  will-change: transform;
  backface-visibility: hidden;
}

/* Shot dots */
.shot-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d4af37; /* brandGold */
  opacity: 0.8;
  pointer-events: none;
  z-index: 0;
  will-change: transform;
  backface-visibility: hidden;
}

/* Skeleton loading state */
.skeleton {
  background: linear-gradient(
    90deg,
    #f0f0f0 25%,
    #e0e0e0 50%,
    #f0f0f0 75%
  );
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 0.25rem;
}

/* Feature card hover effects */
.feature-card {
  transition: all 0.3s ease;
  will-change: transform, box-shadow;
  backface-visibility: hidden;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Workflow step hover effects */
.workflow-step {
  transition: all 0.3s ease;
  will-change: transform, box-shadow;
  backface-visibility: hidden;
}

.workflow-step:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Left and right card animations */
.left-card,
.right-card {
  transition: transform 0.3s ease;
  will-change: transform;
  backface-visibility: hidden;
}

.left-card:hover,
.right-card:hover {
  transform: translateY(-2px);
}

/* ===== Responsive Adjustments ===== */

@media (max-width: 768px) {
  /* Target rings - reduce size on mobile */
  .target-ring {
    opacity: 0.1;
  }
  
  /* Shot dots - hide on mobile */
  .shot-dot {
    display: none;
  }
  
  /* Improve mobile touch targets */
  button,
  a {
    min-height: 44px;
    min-width: 44px;
  }
}

/* ===== Print Styles ===== */
@media print {
  .no-print,
  .mobile-bottom-nav,
  .target-ring,
  .shot-dot {
    display: none;
  }
  
  body {
    color: #000;
    background: #fff;
    font-size: 12pt;
  }
  
  a {
    color: #000;
    text-decoration: underline;
  }
  
  a[href]::after {
    content: " (" attr(href) ")";
  }
  
  .hero-gradient {
    background: #fff !important;
    color: #000 !important;
  }
  
  .hero-gradient::before {
    display: none;
  }
}

/* ===== Form and Input Enhancements ===== */

/* Improve button accessibility */
button:disabled,
a[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ===== Selection Color ===== */
::selection {
  background-color: rgba(212, 175, 55, 0.3); /* brandGold with opacity */
  color: #000;
}

::-moz-selection {
  background-color: rgba(212, 175, 55, 0.3); /* brandGold with opacity */
  color: #000;
}

/* ===== Loading States ===== */

/* Spinner for async operations */
.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin-slow 0.75s linear infinite;
  will-change: transform;
}

.spinner-lg {
  width: 2rem;
  height: 2rem;
  border-width: 3px;
}

/* ===== Custom Utilities ===== */

/* Athlete image fade mask */
.athlete-mask {
  mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
}

/* Glass morphism effect */
.glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, #4338ca, #d4af37); /* brandIndigo to brandGold */
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ===== Dark Mode Support ===== */
@media (prefers-color-scheme: dark) {
  /* Add dark mode overrides if needed */
  .skeleton {
    background: linear-gradient(
      90deg,
      #2d3748 25%,
      #4a5568 50%,
      #2d3748 75%
    );
  }
}

/* ===== High Contrast Mode Support ===== */
@media (prefers-contrast: high) {
  :focus-visible {
    outline: 3px solid #000;
    outline-offset: 2px;
  }
  
  .target-ring {
    border-color: #000;
  }
  
  .shot-dot {
    background: #000;
  }
}

/* ===== Pixel Density Optimizations ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* High DPI optimizations */
  .target-ring,
  .shot-dot {
    transform: translateZ(0);
    backface-visibility: hidden;
  }
}

/* ===== Fallback for Older Browsers ===== */

/* Hide from IE11 */
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
  .hero-gradient::before,
  .glass,
  .gradient-text,
  .athlete-mask {
    display: none;
  }
}

/* ===== Performance Critical CSS ===== */

/* Above-the-fold styles that should not be deferred */
.critical-css {
  /* These styles will be inlined in production */
}

/* ===== Custom Component Styles ===== */

/* Pricing toggle active state */
.pricing-toggle button[aria-selected="true"] {
  background-color: #4338ca; /* brandIndigo */
  color: white;
}

/* Testimonial rating stars */
.star-rating svg {
  fill: currentColor;
}

/* FAQ details/summary styling */
details[open] summary {
  color: #4338ca; /* brandIndigo */
}

/* Progress bar styling */
.progress-bar {
  height: 0.5rem;
  background-color: #e5e7eb;
  border-radius: 9999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.3s ease;
}

/* ===== Scroll Snap (Optional) ===== */
@media (min-width: 1024px) {
  .scroll-snap-x {
    scroll-snap-type: x mandatory;
    overflow-x: auto;
  }
  
  .scroll-snap-item {
    scroll-snap-align: start;
    flex-shrink: 0;
  }
}

/* ===== Utility Classes Not in Tailwind ===== */

/* Text stroke effect */
.text-stroke {
  -webkit-text-stroke: 1px currentColor;
  text-stroke: 1px currentColor;
  color: transparent;
}

/* Gradient border */
.gradient-border {
  border: 2px solid transparent;
  background: 
    linear-gradient(white, white) padding-box,
    linear-gradient(135deg, #4338ca, #d4af37) border-box; /* brandIndigo to brandGold */
}

/* Clip path effects */
.clip-hexagon {
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
}

.clip-diamond {
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

/* ===== Performance Hints ===== */
.content-visibility-auto {
  content-visibility: auto;
  contain-intrinsic-size: 1px 5000px;
}

.will-change-transform {
  will-change: transform;
}

/* ===== Print Optimization ===== */
@media print {
  @page {
    margin: 0.5in;
  }
  
  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
    page-break-inside: avoid;
  }
  
  img {
    page-break-inside: avoid;
    page-break-after: avoid;
  }
  
  ul, ol, dl {
    page-break-before: avoid;
  }
}

/* ===== Responsive Utilities ===== */
/* Add these if you need responsive variants not in Tailwind */

/* For modal/dialog focus trapping */
.focus-trap:focus {
  outline: 3px solid #d4af37; /* brandGold */
  outline-offset: 2px;
}