/**
 * Public Site UI Enhancements
 * Modern animations, interactions, and visual polish
 *
 * To revert: Remove the <link> tag from HTML files
 */

/* ========================================
   CSS Variables
   ======================================== */
:root {
  /* Brand redesign 2026-06: glows neutralized to navy-tinted shadows; bounce
     easing replaced with the spec's ease-out (no overshoot) — every animation
     referencing these tokens calms down without touching each rule. */
  --glow-red: rgba(42, 59, 107, 0.10);
  --glow-red-strong: rgba(42, 59, 107, 0.14);
  --transition-bounce: cubic-bezier(0.22, 0.61, 0.36, 1);
  --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --transition-snap: cubic-bezier(0.2, 0, 0, 1);
}

/* ========================================
   Smooth Scroll & Selection
   ======================================== */
html {
  scroll-behavior: smooth;
}

::selection {
  background: rgba(171, 23, 33, 0.18);
  color: inherit;
}

/* ========================================
   Page Load Animation
   ======================================== */
@keyframes pageReveal {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

body {
  animation: pageReveal 0.5s ease-out;
}

/* ========================================
   Header Enhancements
   ======================================== */
header {
  transition: all 0.3s var(--transition-smooth);
}

/* On scroll the header stays pressed against the top and sides of the window —
   no inset padding (the old floating-pill behavior). Only the shadow deepens. */
header.scrolled {
  box-shadow: 0 2px 8px rgba(42, 59, 107, 0.10);
}

/* Nav link underline animation */
nav a {
  position: relative;
}

/* ========================================
   Button Enhancements
   ======================================== */
.btn {
  position: relative;
  overflow: hidden;
  transition: all 0.3s var(--transition-bounce) !important;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:active::before {
  width: 300px;
  height: 300px;
}

/* Flat brand red — the animated gradient is gone per the redesign. Hover
   darkens (page CSS) with a subtle lift; no scale, no glow. */
.btn-primary:hover {
  box-shadow: 0 2px 8px rgba(42, 59, 107, 0.12);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary:hover {
  background: var(--cooper-red);
  color: white;
  box-shadow: 0 4px 15px var(--glow-red);
}

/* ========================================
   Event Card Enhancements
   ======================================== */
.event-card {
  transition: all 0.4s var(--transition-smooth) !important;
  transform-style: preserve-3d;
}

.event-card:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 6px 16px rgba(42, 59, 107, 0.10) !important;
}

.event-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.4s;
  background: linear-gradient(
    135deg,
    rgba(198, 9, 59, 0.05) 0%,
    transparent 50%,
    rgba(198, 9, 59, 0.03) 100%
  );
  pointer-events: none;
}

.event-card:hover::after {
  opacity: 1;
}

/* Card image zoom */
.event-image img {
  transition: transform 0.6s var(--transition-smooth) !important;
}

.event-card:hover .event-image img {
  transform: scale(1.08) !important;
}

/* Badge float animation on card hover */
.event-type-badge {
  transition: all 0.3s var(--transition-bounce);
}

.event-card:hover .event-type-badge {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(42, 59, 107, 0.2);
}

/* ========================================
   Featured Event Carousel
   ======================================== */
.featured-card {
  transition: all 0.4s var(--transition-smooth) !important;
}

.featured-image img {
  transition: transform 0.8s var(--transition-smooth);
}

.featured-card:hover .featured-image img {
  transform: scale(1.05);
}

/* Navigation dots */
.featured-nav-dot,
.testimonial-dot {
  transition: all 0.3s var(--transition-bounce) !important;
}

.featured-nav-dot:hover,
.testimonial-dot:hover {
  transform: scale(1.3);
}

.featured-nav-dot.active,
.testimonial-dot.active {
  transform: scale(1.4);
}

/* Arrows */
.featured-arrow,
.testimonial-arrow {
  transition: all 0.3s var(--transition-bounce) !important;
}

.featured-arrow:hover,
.testimonial-arrow:hover {
  transform: scale(1.15) !important;
  box-shadow: 0 8px 20px rgba(42, 59, 107, 0.15) !important;
}

/* ========================================
   Stats Section
   ======================================== */
.stats-section {
  background:
    linear-gradient(135deg, var(--cooper-red) 0%, var(--cooper-dark) 100%),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.stat-item {
  transition: transform 0.3s var(--transition-bounce);
}

.stat-item:hover {
  transform: scale(1.05);
}

.stat-number {
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* ========================================
   Testimonials
   ======================================== */
.testimonial-card {
  transition: all 0.3s var(--transition-smooth) !important;
}

.testimonial-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(42, 59, 107, 0.1) !important;
}

.testimonial-avatar {
  transition: all 0.3s var(--transition-bounce);
}

.testimonial-card:hover .testimonial-avatar {
  transform: scale(1.1);
  box-shadow: 0 8px 25px rgba(42, 59, 107, 0.15);
}

.testimonial-quote::before {
  transition: all 0.3s var(--transition-smooth);
}

.testimonial-card:hover .testimonial-quote::before {
  transform: scale(1.2);
  color: var(--cooper-red);
  opacity: 0.5;
}

/* ========================================
   Video Section
   ======================================== */
.video-main,
.video-thumb {
  transition: all 0.4s var(--transition-smooth) !important;
}

.video-main:hover {
  transform: scale(1.02);
}

.video-thumb:hover {
  transform: scale(1.05);
}

.video-play-btn {
  transition: all 0.3s var(--transition-bounce) !important;
}

.video-main:hover .video-play-btn,
.video-thumb:hover .video-play-btn {
  transform: translate(-50%, -50%) scale(1.2) !important;
}

/* ========================================
   Form Inputs
   ======================================== */
.form-input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="date"],
textarea,
select {
  transition: all 0.3s var(--transition-smooth) !important;
}

.form-input:focus,
input:focus,
textarea:focus,
select:focus {
  border-color: var(--cooper-red) !important;
  box-shadow: 0 0 0 4px var(--glow-red),
              0 2px 8px rgba(42, 59, 107, 0.08) !important;
  transform: translateY(-2px);
}

/* Floating label effect */
.form-group {
  position: relative;
}

.form-input::placeholder {
  transition: all 0.3s var(--transition-smooth);
}

.form-input:focus::placeholder {
  opacity: 0;
  transform: translateY(-10px);
}

/* ========================================
   Filter Buttons
   ======================================== */
.filter-btn {
  transition: all 0.3s var(--transition-bounce) !important;
}

.filter-btn:hover:not(.active) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(42, 59, 107, 0.1);
}

.filter-btn.active {
  animation: filterActivate 0.3s var(--transition-bounce);
}

@keyframes filterActivate {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* ========================================
   Loading States
   ======================================== */
.loading-events {
  position: relative;
}

.loading-events::after {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-left: 10px;
  border: 2px solid var(--cooper-red);
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}

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

/* ========================================
   Footer
   ======================================== */
footer {
  position: relative;
  overflow: hidden;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--cooper-red),
    transparent
  );
}

footer .footer-logo img {
  transition: all 0.3s var(--transition-bounce);
}

footer:hover .footer-logo img {
  transform: scale(1.05);
}

/* ========================================
   Scroll Reveal Enhancements
   ======================================== */
.reveal {
  transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1) !important;
}

.reveal.active {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* ========================================
   Mobile Menu
   ======================================== */
.mobile-menu {
  transition: transform 0.4s var(--transition-smooth) !important;
}

.mobile-menu.active {
  box-shadow: -10px 0 40px rgba(42, 59, 107, 0.2);
}

.mobile-menu-nav a {
  transition: all 0.2s var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

/* ========================================
   Registration Page Specifics
   ======================================== */
.progress-step {
  transition: all 0.3s var(--transition-smooth);
}

.progress-step.active {
  transform: scale(1.1);
}

.progress-step.completed {
  animation: stepComplete 0.5s var(--transition-bounce);
}

@keyframes stepComplete {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* ========================================
   Alert Messages
   ======================================== */
.alert {
  animation: alertSlide 0.4s var(--transition-bounce);
}

@keyframes alertSlide {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert-success {
  position: relative;
  overflow: hidden;
}

.alert-success::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: alertShine 2s ease-in-out;
}

@keyframes alertShine {
  to { left: 100%; }
}

/* ========================================
   Cursor Effects
   ======================================== */
a, button, .btn, .event-card, .filter-btn {
  cursor: pointer;
}

/* ========================================
   Focus States for Accessibility
   ======================================== */
:focus-visible {
  outline: 3px solid var(--cooper-red);
  outline-offset: 3px;
}

/* ========================================
   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;
  }
}

/* ========================================
   Public-site header nav — frosted glass pill + icons
   Uses `header nav` for higher specificity than the per-page `nav` rules
   already embedded in each public HTML page (no !important needed).
   ======================================== */
/* Clean nav — the frosted-glass pill is gone per the brand redesign. */
header nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  background: transparent;
  padding: 0.5rem 0;
  border-radius: 0;
  border: none;
  box-shadow: none;
}

header nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

header nav a svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

header nav a:hover,
header nav a.active {
  color: var(--cooper-red);
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ========================================
   Accessibility — sr-only + skip-link
   ======================================== */
.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;
}

.skip-link {
  position: absolute;
  top: -48px;
  left: 0;
  background: var(--cooper-red);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 10000;
  text-decoration: none;
  font-weight: 600;
  border-radius: 0 0 6px 0;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
  outline: 2px solid #fff;
  outline-offset: -4px;
}
