/**
 * Kelowna Scripts - Engagement & Animation Styles
 *
 * This file contains all interactive visual enhancements including:
 * - Feature cards with orange borders and overlays
 * - Glass morphism effects
 * - 3D tilt transformations
 * - Parallax scrolling
 * - Scroll-triggered animations
 * - Cinema-inspired button effects
 * - Spotlight effects
 * - Film frame styling
 * - Micro-interactions and loading states
 *
 * Color System:
 * - Primary Orange: #fe5001
 * - Dark Background: #1a1a1a, #0d0d0d
 * - Text Light: rgba(255, 255, 255, 0.9)
 * - Border Accent: rgba(255, 120, 0, 0.3-0.8)
 */

/* ============================================================================
   1. CSS VARIABLES & ROOT CONFIGURATION
   ============================================================================ */

:root {
  --primary-orange: #fe5001;
  --dark-bg: #1a1a1a;
  --darker-bg: #0d0d0d;
  --text-light: rgba(255, 255, 255, 0.9);
  --text-lighter: rgba(255, 255, 255, 0.7);
  --border-accent: rgba(255, 120, 0, 0.3);
  --border-accent-hover: rgba(255, 120, 0, 0.8);
  --overlay-light: rgba(255, 255, 255, 0.08);
  --overlay-medium: rgba(255, 255, 255, 0.15);
  --glow-orange: rgba(255, 120, 0, 0.4);

  --timing-fast: 0.3s;
  --timing-standard: 0.5s;
  --timing-slow: 0.8s;
  --cubic-smooth: cubic-bezier(0.23, 1, 0.32, 1);
  --cubic-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================================================
   2. FEATURE CARDS WITH ORANGE BORDERS & OVERLAYS
   ============================================================================ */

.feature-card {
  position: relative;
  background: rgba(20, 20, 20, 0.95);
  border: 2px solid var(--border-accent);
  border-radius: 12px;
  padding: 2rem;
  overflow: hidden;
  transition: all var(--timing-standard) var(--cubic-smooth);
  backdrop-filter: blur(8px);
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg,
    rgba(255, 120, 0, 0.25) 0%,
    rgba(255, 90, 0, 0.12) 50%,
    transparent 100%);
  opacity: 0;
  transform: translateY(100%);
  transition: all 0.6s ease;
  pointer-events: none;
  z-index: 1;
}

.feature-card:hover {
  transform: scale(1.05) translateY(-8px);
  border-color: var(--border-accent-hover);
  box-shadow:
    0 0 20px var(--glow-orange),
    0 20px 40px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 var(--overlay-light);
}

.feature-card:hover::before {
  opacity: 1;
  transform: translateY(0);
}

.feature-card h3 {
  position: relative;
  z-index: 2;
  color: var(--primary-orange);
  margin: 0 0 1rem 0;
  font-size: 1.3rem;
  font-weight: 700;
  transition: color var(--timing-fast);
}

.feature-card p {
  position: relative;
  z-index: 2;
  color: var(--text-light);
  margin: 0;
  line-height: 1.6;
  font-size: 0.95rem;
}

/* ============================================================================
   3. GLASS MORPHISM CARDS
   ============================================================================ */

.glass-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 2.5rem;
  transition: all var(--timing-standard) var(--cubic-smooth);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255, 140, 0, 0.1) 0%, transparent 70%);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--timing-standard);
}

.glass-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 120, 0, 0.5);
  transform: translateY(-4px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.glass-card:hover::before {
  opacity: 1;
}

/* ============================================================================
   4. 3D TILT CARDS (Uses CSS Variables for JS Control)
   ============================================================================ */

.tilt-card {
  --rotateX: 0deg;
  --rotateY: 0deg;
  perspective: 1200px;
  transform-style: preserve-3d;
  transition: transform var(--timing-fast) ease-out;
}

.tilt-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform:
    rotateX(var(--rotateX))
    rotateY(var(--rotateY));
  transform-style: preserve-3d;
  transition: transform var(--timing-fast) ease-out;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(20, 20, 20, 0.95);
  border: 2px solid var(--border-accent);
}

.tilt-card:hover .tilt-card-inner {
  border-color: var(--border-accent-hover);
  box-shadow: 0 0 30px var(--glow-orange);
}

.tilt-card-content {
  position: relative;
  z-index: 10;
  transform-style: preserve-3d;
  padding: 2rem;
}

/* ============================================================================
   5. PARALLAX SCROLLING CONTAINERS
   ============================================================================ */

.parallax-container {
  position: relative;
  overflow: hidden;
  perspective: 1000px;
}

.parallax-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 120%;
  background-size: cover;
  background-position: center;
  z-index: 1;
  will-change: transform;
}

.parallax-content {
  position: relative;
  z-index: 10;
}

/* ============================================================================
   6. SCROLL-TRIGGERED ANIMATIONS
   ============================================================================ */

.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.scroll-reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.scroll-reveal-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.scroll-reveal-left.active {
  opacity: 1;
  transform: translateX(0);
}

.scroll-reveal-right {
  opacity: 0;
  transform: translateX(50px);
  transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.scroll-reveal-right.active {
  opacity: 1;
  transform: translateX(0);
}

.scroll-reveal-scale {
  opacity: 0;
  transform: scale(0.85);
  transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.scroll-reveal-scale.active {
  opacity: 1;
  transform: scale(1);
}

.scroll-reveal-stagger-1 { transition-delay: 0.1s; }
.scroll-reveal-stagger-2 { transition-delay: 0.2s; }
.scroll-reveal-stagger-3 { transition-delay: 0.3s; }
.scroll-reveal-stagger-4 { transition-delay: 0.4s; }
.scroll-reveal-stagger-5 { transition-delay: 0.5s; }
.scroll-reveal-stagger-6 { transition-delay: 0.6s; }

/* ============================================================================
   7. CINEMA BUTTON EFFECTS
   ============================================================================ */

.cinema-button {
  position: relative;
  padding: 0.75rem 2rem;
  background: transparent;
  border: 2px solid var(--primary-orange);
  color: var(--primary-orange);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  cursor: pointer;
  border-radius: 4px;
  transition: all var(--timing-standard) var(--cubic-smooth);
  overflow: hidden;
  text-decoration: none;
  display: inline-block;
}

.cinema-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--primary-orange);
  z-index: -1;
  transition: left var(--timing-standard) var(--cubic-smooth);
}

.cinema-button:hover {
  color: #1a1a1a;
  box-shadow: 0 0 20px var(--glow-orange);
  border-color: var(--primary-orange);
}

.cinema-button:hover::before {
  left: 0;
}

/* Curtain Effect Variant */
.cinema-button-curtain {
  position: relative;
  padding: 0.75rem 2rem;
  background: var(--primary-orange);
  border: 2px solid var(--primary-orange);
  color: #1a1a1a;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  cursor: pointer;
  border-radius: 4px;
  transition: all var(--timing-fast);
  overflow: hidden;
  text-decoration: none;
  display: inline-block;
}

.cinema-button-curtain::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--primary-orange);
  clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%);
  transform: translateX(-100%);
  transition: transform var(--timing-standard) var(--cubic-smooth);
  z-index: 0;
}

.cinema-button-curtain span {
  position: relative;
  z-index: 1;
}

.cinema-button-curtain:hover::after {
  transform: translateX(100%);
}

/* ============================================================================
   8. SPOTLIGHT EFFECTS
   ============================================================================ */

.spotlight-container {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
}

.spotlight {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at var(--x, 50%) var(--y, 50%),
    rgba(255, 120, 0, 0.3) 0%,
    rgba(255, 120, 0, 0.1) 30%,
    transparent 70%);
  pointer-events: none;
  z-index: 10;
  transition: background 0.05s linear;
}

/* ============================================================================
   9. FILM FRAME STYLING
   ============================================================================ */

.film-frame {
  position: relative;
  background: #0d0d0d;
  border: 12px solid #1a1a1a;
  box-shadow:
    inset 0 0 20px rgba(0, 0, 0, 0.8),
    0 0 30px rgba(255, 120, 0, 0.2);
  border-radius: 2px;
  overflow: hidden;
}

.film-frame::before,
.film-frame::after {
  content: '';
  position: absolute;
  left: 0;
  width: 100%;
  height: 8px;
  background: repeating-linear-gradient(
    90deg,
    #0d0d0d 0px,
    #0d0d0d 6px,
    #1a1a1a 6px,
    #1a1a1a 12px
  );
  z-index: 5;
}

.film-frame::before {
  top: 0;
  border-bottom: 2px solid rgba(255, 120, 0, 0.2);
}

.film-frame::after {
  bottom: 0;
  border-top: 2px solid rgba(255, 120, 0, 0.2);
}

.film-frame-image {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.6s var(--cubic-smooth);
}

.film-frame:hover .film-frame-image {
  transform: scale(1.05);
}

/* ============================================================================
   10. CLAPPERBOARD DESIGN
   ============================================================================ */

.clapperboard {
  position: relative;
  display: inline-block;
  padding: 1.5rem;
  background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
  border: 3px solid var(--primary-orange);
  border-radius: 4px;
  transform: perspective(1000px) rotateY(-15deg) rotateX(5deg);
  transition: all var(--timing-standard) var(--cubic-smooth);
  box-shadow:
    -10px 10px 30px rgba(0, 0, 0, 0.7),
    0 0 20px rgba(255, 120, 0, 0.3);
}

.clapperboard:hover {
  transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
  box-shadow:
    0 10px 40px rgba(255, 120, 0, 0.4),
    0 0 30px rgba(255, 120, 0, 0.3);
}

.clapperboard-stripes {
  position: absolute;
  top: 0;
  left: 0;
  width: 60px;
  height: 30px;
  background: repeating-linear-gradient(
    45deg,
    var(--primary-orange) 0px,
    var(--primary-orange) 10px,
    #0d0d0d 10px,
    #0d0d0d 20px
  );
  border: 2px solid #1a1a1a;
  border-radius: 2px;
}

.clapperboard-text {
  position: relative;
  z-index: 2;
  color: var(--text-light);
  font-weight: 700;
  font-size: 0.9rem;
  font-family: 'Courier New', monospace;
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* ============================================================================
   11. MICRO-INTERACTIONS & BADGE ANIMATIONS
   ============================================================================ */

.badge-pulse {
  animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

.checkmark-animate {
  animation: checkmarkScale 0.6s var(--cubic-bounce) forwards;
  transform-origin: center;
}

@keyframes checkmarkScale {
  0% {
    transform: scale(0) rotate(-45deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

.text-shimmer {
  background: linear-gradient(
    90deg,
    var(--text-light) 0%,
    var(--primary-orange) 50%,
    var(--text-light) 100%
  );
  background-size: 200% auto;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
  0% {
    background-position: 0% center;
  }
  100% {
    background-position: 200% center;
  }
}

/* ============================================================================
   12. LOADING ANIMATIONS
   ============================================================================ */

/* Film Reel Spinner */
.film-reel-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid var(--border-accent);
  border-top-color: var(--primary-orange);
  border-radius: 50%;
  animation: filmReelSpin 1.2s linear infinite;
}

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

/* Spotlight Loader */
.spotlight-loader {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(255, 120, 0, 0.4) 0%,
    rgba(255, 120, 0, 0.1) 70%,
    transparent 100%);
  animation: spotlightPulse 2s ease-in-out infinite;
}

@keyframes spotlightPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.3);
    opacity: 0.8;
  }
}

/* ============================================================================
   13. CARD GRID ANIMATIONS
   ============================================================================ */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.card-grid-item {
  animation: cardGridEntry 0.6s var(--cubic-bounce) forwards;
  opacity: 0;
}

.card-grid-item:nth-child(1) { animation-delay: 0.1s; }
.card-grid-item:nth-child(2) { animation-delay: 0.2s; }
.card-grid-item:nth-child(3) { animation-delay: 0.3s; }
.card-grid-item:nth-child(4) { animation-delay: 0.4s; }
.card-grid-item:nth-child(5) { animation-delay: 0.5s; }
.card-grid-item:nth-child(6) { animation-delay: 0.6s; }

@keyframes cardGridEntry {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================================
   14. COMPARISON TABLE ANIMATIONS
   ============================================================================ */

.comparison-row {
  animation: tableRowSlide 0.6s ease-out forwards;
  opacity: 0;
}

.comparison-row:nth-child(1) { animation-delay: 0.1s; }
.comparison-row:nth-child(2) { animation-delay: 0.2s; }
.comparison-row:nth-child(3) { animation-delay: 0.3s; }
.comparison-row:nth-child(4) { animation-delay: 0.4s; }
.comparison-row:nth-child(5) { animation-delay: 0.5s; }
.comparison-row:nth-child(6) { animation-delay: 0.6s; }

@keyframes tableRowSlide {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ============================================================================
   15. RESPONSIVE DESIGN BREAKPOINTS
   ============================================================================ */

/* Mobile: 480px and below */
@media (max-width: 480px) {
  :root {
    --timing-fast: 0.25s;
    --timing-standard: 0.4s;
  }

  .feature-card {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
  }

  .feature-card:hover {
    transform: scale(1.02) translateY(-4px);
  }

  .cinema-button {
    padding: 0.65rem 1.5rem;
    font-size: 0.85rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .tilt-card {
    perspective: 600px;
  }
}

/* Tablet: 481px - 1024px */
@media (min-width: 481px) and (max-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .feature-card {
    padding: 1.75rem;
  }
}

/* Desktop: 1025px and above */
@media (min-width: 1025px) {
  .card-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }

  .feature-card:hover {
    transform: scale(1.08) translateY(-10px);
  }

  /* Enable full 3D tilt only on desktop */
  .tilt-card {
    perspective: 1200px;
  }
}

/* ============================================================================
   16. ACCESSIBILITY & PERFORMANCE
   ============================================================================ */

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .parallax-bg {
    transform: none !important;
  }
}

/* Will-change for performance optimization */
.scroll-reveal.active,
.feature-card:hover,
.parallax-bg {
  will-change: transform;
}

/* GPU acceleration */
.film-frame-image,
.cinema-button::before,
.spotlight {
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* ============================================================================
   17. UTILITY CLASSES
   ============================================================================ */

.overflow-hidden {
  overflow: hidden;
}

.relative {
  position: relative;
}

.absolute {
  position: absolute;
}

.z-10 {
  z-index: 10;
}

.z-20 {
  z-index: 20;
}

.pointer-events-none {
  pointer-events: none;
}
