/* =============================================
   APEX STERLING — Custom Styles
   Tailwind handles utility classes via CDN.
   This file covers animations, transitions,
   and component styles that need @keyframes
   or custom selectors.
   ============================================= */

/* ---------- CSS Variables ---------- */
:root {
  --blue: #0066FF;
  --blue-hover: #0052CC;
  --bg-primary: #0A0A0A;
  --bg-secondary: #111111;
  --bg-card: #141414;
  --border: #222222;
  --text-primary: #FFFFFF;
  --text-body: #F5F5F5;
  --text-muted: #A0A0A0;
  --text-dim: #666666;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background-color: var(--blue);
  color: #fff;
}

/* ---------- Announcement Bar ---------- */
.announcement-bar {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.announcement-bar.is-hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

.announcement-dot {
  width: 6px;
  height: 6px;
  background-color: var(--blue);
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.5); }
}

/* ---------- Navigation ---------- */
.nav-transparent {
  background-color: transparent;
  backdrop-filter: none;
  transition: background-color 0.3s ease, backdrop-filter 0.3s ease, box-shadow 0.3s ease, top 0.3s ease;
}

.nav-solid {
  background-color: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: background-color 0.3s ease, backdrop-filter 0.3s ease, box-shadow 0.3s ease, top 0.3s ease;
}

/* Nav CTA pulse */
.nav-cta-pulse {
  animation: nav-pulse 2s ease-in-out 3s 3;
}

@keyframes nav-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 102, 255, 0); }
  50% { box-shadow: 0 0 20px 4px rgba(0, 102, 255, 0.3); }
}

/* ---------- Nav Programs Dropdown ---------- */
.nav-dropdown-menu {
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.is-open .nav-dropdown-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.nav-dropdown-menu a {
  border-radius: 2px;
}

.mobile-programs-list {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.mobile-programs-list.is-open {
  max-height: 600px;
}

/* ---------- Hero Parallax ---------- */
.parallax-bg {
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

@supports (-webkit-touch-callout: none) {
  .parallax-bg {
    background-attachment: scroll;
  }
}

@media (max-width: 1023px) {
  .parallax-bg {
    background-attachment: scroll;
  }
}

/* ---------- Scroll Animations ---------- */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays via data attribute */
[data-animate-delay="1"] { transition-delay: 0.1s; }
[data-animate-delay="2"] { transition-delay: 0.2s; }
[data-animate-delay="3"] { transition-delay: 0.3s; }
[data-animate-delay="4"] { transition-delay: 0.4s; }
[data-animate-delay="5"] { transition-delay: 0.5s; }
[data-animate-delay="6"] { transition-delay: 0.6s; }

/* ---------- Blue Line Draw ---------- */
.blue-line {
  display: block;
  width: 48px;
  height: 3px;
  background-color: var(--blue);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s ease-out;
}

.blue-line.is-visible,
.is-visible .blue-line {
  transform: scaleX(1);
}

/* ---------- CTA Button Glow ---------- */
.btn-glow {
  transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.btn-glow:hover {
  box-shadow: 0 0 30px rgba(0, 102, 255, 0.3);
}

.btn-glow .btn-arrow {
  transition: transform 0.3s ease;
}

.btn-glow:hover .btn-arrow {
  transform: translateX(4px);
}

/* ---------- Ghost Button ---------- */
.btn-ghost {
  border: 2px solid rgba(255, 255, 255, 0.3);
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

.btn-ghost:hover {
  border-color: #fff;
  background-color: rgba(255, 255, 255, 0.05);
}

/* ---------- Card Hover Effects ---------- */
.card-hover {
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.card-hover:hover {
  border-color: var(--blue);
  box-shadow: 0 0 20px rgba(0, 102, 255, 0.15);
}

.card-hover .card-img {
  transition: transform 0.7s ease;
}

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

/* ---------- Program Card CTA Overlay ---------- */
.program-card .card-cta-overlay {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.program-card:hover .card-cta-overlay {
  opacity: 1;
}

/* ---------- Badge / Pill ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 2px;
}

.badge-blue {
  background-color: rgba(0, 102, 255, 0.15);
  color: var(--blue);
  border: 1px solid rgba(0, 102, 255, 0.3);
}

.badge-green {
  background-color: rgba(34, 197, 94, 0.15);
  color: #22C55E;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

/* ---------- Testimonial Card ---------- */
.testimonial-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  position: relative;
  transition: border-color 0.4s ease;
}

.testimonial-card:hover {
  border-color: rgba(0, 102, 255, 0.3);
}

.testimonial-card::before {
  content: "\201C";
  position: absolute;
  top: 16px;
  left: 20px;
  font-size: 4rem;
  line-height: 1;
  color: rgba(0, 102, 255, 0.15);
  font-family: 'Oswald', sans-serif;
}

/* ---------- How It Works Step ---------- */
.step-number {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(0, 102, 255, 0.2), rgba(0, 102, 255, 0.05));
  border: 1px solid rgba(0, 102, 255, 0.3);
  font-family: 'Oswald', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--blue);
}

.step-connector {
  position: absolute;
  top: 28px;
  left: calc(50% + 36px);
  width: calc(100% - 72px);
  height: 1px;
  background: linear-gradient(90deg, rgba(0, 102, 255, 0.3), rgba(0, 102, 255, 0.05));
}

/* ---------- Schedule Enhancements ---------- */
.schedule-block {
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.schedule-block:hover {
  background-color: #1a1a1a;
  transform: translateX(4px);
}

.time-group-label {
  font-family: 'Oswald', sans-serif;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 8px 0 4px;
}

/* ---------- FAQ Accordion ---------- */
.faq-answer {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
  padding-top: 0;
  padding-bottom: 0;
}

.faq-item.is-open .faq-answer {
  opacity: 1;
  padding-top: 1rem;
  padding-bottom: 0.5rem;
}

.faq-icon {
  transition: transform 0.3s ease;
}

.faq-item.is-open .faq-icon {
  transform: rotate(45deg);
}

/* ---------- Counter Animation ---------- */
.counter-value {
  font-variant-numeric: tabular-nums;
}

/* ---------- Mobile Menu ---------- */
.mobile-menu {
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.mobile-menu.is-open {
  transform: translateX(0);
}

/* ---------- Hamburger Icon ---------- */
.hamburger-line {
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger.is-active .hamburger-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.hamburger.is-active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger.is-active .hamburger-line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.hamburger.is-active {
  z-index: 71;
  position: relative;
}

/* ---------- Image Grayscale Hover ---------- */
.img-grayscale {
  filter: grayscale(100%);
  transition: filter 0.7s ease;
}

.group:hover .img-grayscale,
.img-grayscale:hover {
  filter: grayscale(0%);
}

/* ---------- Form Styles ---------- */
.form-input {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.15);
  outline: none;
}

.form-input::placeholder {
  color: var(--text-dim);
}

.form-input.is-error {
  border-color: #EF4444;
}

.form-error {
  color: #EF4444;
  font-size: 0.8125rem;
  margin-top: 0.25rem;
  display: none;
}

.form-input.is-error + .form-error,
.form-input.is-error ~ .form-error {
  display: block;
}

/* ---------- Success State ---------- */
.form-success {
  animation: fadeInUp 0.5s ease-out;
}

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

/* ---------- Stars ---------- */
.star {
  color: #FBBF24;
}

/* ---------- Schedule Color Codes ---------- */
.schedule-bjj {
  border-left-color: var(--blue);
}

.schedule-wrestling {
  border-left-color: #FFFFFF;
}

.schedule-kickboxing {
  border-left-color: var(--text-muted);
}

/* ---------- Day Filter Tab ---------- */
.day-tab {
  transition: color 0.3s ease, border-color 0.3s ease;
}

.day-tab.is-active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

/* ---------- Sticky Mobile CTA ---------- */
.sticky-mobile-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background-color: rgba(10, 10, 10, 0.97);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.sticky-mobile-cta.is-visible {
  transform: translateY(0);
}

/* Add bottom padding to body on mobile when sticky CTA is present */
body.has-sticky-cta {
  padding-bottom: 72px;
}

@media (min-width: 1024px) {
  .sticky-mobile-cta {
    display: none !important;
  }
  body.has-sticky-cta {
    padding-bottom: 0;
  }
}

/* ---------- Gradient Accent Border ---------- */
.gradient-border-left {
  position: relative;
}

.gradient-border-left::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, var(--blue), transparent);
  border-radius: 2px;
}

/* ---------- Credential Card Accent ---------- */
.credential-card {
  border-top: 2px solid rgba(0, 102, 255, 0.3);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.credential-card:hover {
  border-top-color: var(--blue);
  box-shadow: 0 4px 20px rgba(0, 102, 255, 0.1);
}

/* ---------- Inline CTA Card ---------- */
.inline-cta {
  background: linear-gradient(135deg, rgba(0, 102, 255, 0.08), rgba(0, 102, 255, 0.02));
  border: 1px solid rgba(0, 102, 255, 0.2);
  transition: border-color 0.3s ease;
}

.inline-cta:hover {
  border-color: rgba(0, 102, 255, 0.4);
}

/* ---------- Google Badge ---------- */
.google-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 4px;
  transition: border-color 0.3s ease;
}

.google-badge:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

/* ---------- Page Transition ---------- */
main {
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 8px;
}

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

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

::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

/* ---------- Neutralize GHL form embed overlay ---------- */
body > .ep-overlay {
  pointer-events: none !important;
  z-index: -1 !important;
}

[data-open-modal] {
  position: relative;
  z-index: 2;
}

/* ---------- Free Class Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal-panel {
  position: relative;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 500px;
  margin: 1rem;
  padding: 2.5rem 2rem 2rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.modal-backdrop.is-open .modal-panel {
  animation: fadeInUp 0.4s ease-out forwards;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  background: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
  font-size: 1.5rem;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-primary);
  border-color: var(--border);
}

.modal-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  margin-top: 1.5rem;
}

/* ---------- Stats Section Enhanced ---------- */
.stat-item {
  position: relative;
  padding: 2rem 1rem;
}

.stat-item::after {
  content: '';
  position: absolute;
  right: 0;
  top: 25%;
  height: 50%;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--border), transparent);
}

.stat-item:last-child::after {
  display: none;
}

@media (max-width: 767px) {
  .stat-item:nth-child(2)::after {
    display: none;
  }
}

.stat-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(0, 102, 255, 0.15), rgba(0, 102, 255, 0.05));
  border: 1px solid rgba(0, 102, 255, 0.2);
  margin: 0 auto 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.stat-item:hover .stat-icon {
  border-color: rgba(0, 102, 255, 0.4);
  box-shadow: 0 0 20px rgba(0, 102, 255, 0.15);
}

/* ---------- Program Cards: Mobile CTA Visibility ---------- */
@media (max-width: 1023px) {
  .program-card .card-cta-overlay {
    opacity: 1;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 1rem;
  }

  .program-card .card-cta-overlay span {
    font-size: 0.875rem;
  }
}

/* ---------- Benefit Item Hover ---------- */
.benefit-item {
  transition: transform 0.3s ease, background-color 0.3s ease;
  padding: 0.75rem;
  margin: -0.75rem;
  border-radius: 4px;
}

.benefit-item:hover {
  background-color: rgba(0, 102, 255, 0.03);
  transform: translateX(4px);
}

.benefit-item:hover .benefit-icon {
  border-color: rgba(0, 102, 255, 0.4);
  box-shadow: 0 0 15px rgba(0, 102, 255, 0.15);
}

.benefit-icon {
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* ---------- Schedule Inline CTA ---------- */
.schedule-day-cta {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.3s ease, max-height 0.3s ease, margin 0.3s ease;
  margin-top: 0;
}

[data-day]:hover .schedule-day-cta,
[data-day]:focus-within .schedule-day-cta {
  opacity: 1;
  max-height: 60px;
  margin-top: 0.75rem;
}

@media (max-width: 1023px) {
  .schedule-day-cta {
    opacity: 1;
    max-height: 60px;
    margin-top: 0.75rem;
  }
}

/* ---------- Testimonial Card Enhancement ---------- */
.testimonial-card {
  transform: translateY(0);
}

.testimonial-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

/* ---------- Responsive Utilities ---------- */
@media (max-width: 767px) {
  .hero-h1 {
    font-size: 3rem;
    line-height: 1;
  }
}

@media (min-width: 768px) {
  .hero-h1 {
    font-size: 5rem;
    line-height: 1;
  }
}
