/* Custom CSS variables for SOU[TV.] theme */
:root {
  --background: hsl(210, 40%, 98%);
  --foreground: hsl(222.2, 84%, 4.9%);
  --card: hsl(0, 0%, 100%);
  --card-foreground: hsl(222.2, 84%, 4.9%);
  --popover: hsl(0, 0%, 100%);
  --popover-foreground: hsl(222.2, 84%, 4.9%);
  --primary: hsl(82, 84%, 60%);
  --primary-foreground: hsl(210, 40%, 2%);
  --secondary: hsl(210, 40%, 18%);
  --secondary-foreground: hsl(210, 40%, 98%);
  --muted: hsl(210, 40%, 96%);
  --muted-foreground: hsl(215.4, 16.3%, 46.9%);
  --accent: hsl(82, 84%, 60%);
  --accent-foreground: hsl(210, 40%, 2%);
  --destructive: hsl(0, 84.2%, 60.2%);
  --destructive-foreground: hsl(210, 40%, 98%);
  --border: hsl(214.3, 31.8%, 91.4%);
  --input: hsl(214.3, 31.8%, 91.4%);
  --ring: hsl(82, 84%, 60%);
  --radius: 0.5rem;
  
  --soutv-green: hsl(82, 84%, 60%);
  --soutv-dark: hsl(210, 40%, 18%);
  --soutv-light: hsl(210, 40%, 98%);
}

.dark {
  --background: hsl(222.2, 84%, 4.9%);
  --foreground: hsl(210, 40%, 98%);
  --card: hsl(222.2, 84%, 4.9%);
  --card-foreground: hsl(210, 40%, 98%);
  --popover: hsl(222.2, 84%, 4.9%);
  --popover-foreground: hsl(210, 40%, 98%);
  --primary: hsl(82, 84%, 60%);
  --primary-foreground: hsl(210, 40%, 2%);
  --secondary: hsl(217.2, 32.6%, 17.5%);
  --secondary-foreground: hsl(210, 40%, 98%);
  --muted: hsl(217.2, 32.6%, 17.5%);
  --muted-foreground: hsl(215, 20.2%, 65.1%);
  --accent: hsl(217.2, 32.6%, 17.5%);
  --accent-foreground: hsl(210, 40%, 98%);
  --destructive: hsl(0, 62.8%, 30.6%);
  --destructive-foreground: hsl(210, 40%, 98%);
  --border: hsl(217.2, 32.6%, 17.5%);
  --input: hsl(217.2, 32.6%, 17.5%);
  --ring: hsl(82, 84%, 60%);
}

/* Base styles */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Hero gradient */
.hero-gradient {
  background: linear-gradient(135deg, var(--soutv-dark) 0%, hsl(217.2, 32.6%, 17.5%) 100%);
}

/* Video player container */
.video-player-container {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  overflow: hidden;
  border-radius: var(--radius);
}

.video-player-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Program card hover effects */
.program-card {
  transition: all 0.3s ease;
  cursor: pointer;
}

.program-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Button animations */
button {
  transition: all 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

/* Form styles */
input, textarea, select {
  transition: all 0.2s ease;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--primary);
  border-color: var(--primary);
}

/* Loading spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Pulse animation for live indicator */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Toast notification styles */
#toast {
  transition: transform 0.3s ease-in-out;
  max-width: 400px;
  word-wrap: break-word;
}

#toast.show {
  transform: translateX(0);
}

/* Mobile menu transition */
#mobile-menu {
  transition: all 0.3s ease;
}

/* Smooth scroll offset for fixed header */
section {
  scroll-margin-top: 4rem;
}

/* Custom container max-width */
.container {
  max-width: 1200px;
}

/* Responsive video embedding */
@media (max-width: 768px) {
  .video-player-container {
    padding-bottom: 60%; /* Slightly taller on mobile for better visibility */
  }
}

/* Print styles */
@media print {
  .no-print {
    display: none;
  }
  
  body {
    background: white;
    color: black;
  }
  
  .hero-gradient {
    background: white;
    color: black;
  }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  
  .program-card {
    transition: none;
  }
  
  .animate-pulse {
    animation: none;
  }
  
  button {
    transition: none;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --border: hsl(0, 0%, 20%);
    --primary: hsl(82, 100%, 40%);
  }
}

/* Focus styles for keyboard navigation */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Remove default outline for mouse users */
button:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
  outline: none;
}

/* Utility classes for additional styling */
.text-shadow {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.backdrop-blur {
  backdrop-filter: blur(8px);
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--muted);
}

::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: hsl(82, 84%, 50%);
}

/* Form validation styles */
input:invalid,
textarea:invalid {
  border-color: var(--destructive);
}

input:valid,
textarea:valid {
  border-color: var(--border);
}

/* Loading state for form submission */
.form-loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Grid auto-fit utility */
.grid-auto-fit {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-auto-fill {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

/* Gradient text utility */
.gradient-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Card hover glow effect */
.card-glow:hover {
  box-shadow: 0 0 30px rgba(167, 243, 108, 0.3);
}