/* ========================================
   Professional Animations & Effects
   Horizontal ScrollTrigger + School Theme
   ======================================== */

/* ========== SCROLL PROGRESS ========== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--color-navy);
  z-index: 9999;
  width: 0%;
  transition: width 0.1s;
}

/* ========== REVEAL ANIMATIONS ========== */
.reveal {
  opacity: 1;
  transform: translateY(0);
  transition: all 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal.animate-ready {
  opacity: 0;
  transform: translateY(80px);
}

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

/* Fade Only */
.fade-in {
  opacity: 1;
  transition: opacity 1.2s ease;
}

.fade-in.animate-ready {
  opacity: 0;
}

.fade-in.active {
  opacity: 1;
}

/* Scale Reveal */
.reveal-scale {
  opacity: 1;
  transform: scale(1);
  transition: all 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal-scale.animate-ready {
  opacity: 0;
  transform: scale(0.9);
}

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

/* ========== STAGGER ANIMATIONS ========== */
.stagger-children > * {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.stagger-children.animate-ready > * {
  opacity: 0;
  transform: translateY(60px);
}

.stagger-children.active > *:nth-child(1) { transition-delay: 0s; }
.stagger-children.active > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-children.active > *:nth-child(3) { transition-delay: 0.2s; }
.stagger-children.active > *:nth-child(4) { transition-delay: 0.3s; }
.stagger-children.active > *:nth-child(5) { transition-delay: 0.4s; }
.stagger-children.active > *:nth-child(6) { transition-delay: 0.5s; }

.stagger-children.active > * {
  opacity: 1;
  transform: translateY(0);
}

/* ========== HORIZONTAL SCROLL SECTION ========== */
.horizontal-scroll-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.horizontal-scroll-container {
  position: relative;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}

.horizontal-scroll-track {
  display: flex;
  height: 100%;
  width: fit-content;
  will-change: transform;
}

.horizontal-panel {
  flex-shrink: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.horizontal-panel-content {
  max-width: 1200px;
  padding: 4rem;
  text-align: center;
}

/* Panel Variants */
.panel-intro {
  background: var(--color-white);
}

.panel-dark {
  background: var(--color-charcoal);
  color: var(--color-white);
}

.panel-image {
  background-size: cover;
  background-position: center;
}

.panel-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 100%);
}

.panel-image .horizontal-panel-content {
  position: relative;
  z-index: 2;
  text-align: left;
  color: white;
}

/* ========== SCHOOL-THEMED BACKGROUND ELEMENTS ========== */
.school-bg-elements {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

/* Subtle geometric patterns */
.school-pattern {
  position: absolute;
  opacity: 0.03;
}

/* Graduation cap icon pattern */
.pattern-cap {
  width: 60px;
  height: 60px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath fill='%231A365E' d='M32 8L4 22l28 14 28-14L32 8zM8 26v16l24 12 24-12V26L32 40 8 26z'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 60px;
}

/* Book pattern */
.pattern-book {
  width: 50px;
  height: 50px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath fill='%231A365E' d='M8 8v48h48V8H8zm44 44H12V12h40v40zM16 20h32v4H16v-4zm0 8h32v4H16v-4zm0 8h24v4H16v-4z'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 50px;
}

/* Pencil lines pattern */
.pattern-lines {
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 40px,
    rgba(26, 54, 94, 0.02) 40px,
    rgba(26, 54, 94, 0.02) 41px
  );
}

/* Grid paper pattern */
.pattern-grid {
  background-image:
    linear-gradient(rgba(26, 54, 94, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26, 54, 94, 0.02) 1px, transparent 1px);
  background-size: 30px 30px;
}

/* Floating elements */
.floating-element {
  position: absolute;
  opacity: 0.04;
  animation: float-gentle 20s ease-in-out infinite;
}

.floating-element:nth-child(odd) {
  animation-duration: 25s;
  animation-direction: reverse;
}

@keyframes float-gentle {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-30px) rotate(3deg); }
}

/* Circle decorations */
.deco-circle {
  border-radius: 50%;
  border: 1px solid rgba(26, 54, 94, 0.08);
}

.deco-circle-lg {
  width: 400px;
  height: 400px;
}

.deco-circle-md {
  width: 250px;
  height: 250px;
}

.deco-circle-sm {
  width: 120px;
  height: 120px;
}

/* Line decorations */
.deco-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(26, 54, 94, 0.1), transparent);
}

.deco-line-vertical {
  width: 1px;
  height: 200px;
  background: linear-gradient(180deg, transparent, rgba(26, 54, 94, 0.1), transparent);
}

/* ========== PARALLAX SYSTEM ========== */
.parallax-container {
  position: relative;
  overflow: hidden;
}

[data-speed] {
  will-change: transform;
}

/* ========== IMAGE REVEAL ========== */
.img-reveal {
  position: relative;
  overflow: hidden;
}

.img-reveal::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--color-white);
  transform-origin: right;
  transition: transform 1.2s cubic-bezier(0.77, 0, 0.175, 1);
}

.img-reveal.revealed::after {
  transform: scaleX(0);
}

.img-reveal img {
  transform: scale(1.3);
  transition: transform 1.5s cubic-bezier(0.77, 0, 0.175, 1);
}

.img-reveal.revealed img {
  transform: scale(1);
}

/* ========== TEXT ANIMATIONS ========== */
.split-lines .line {
  display: block;
  overflow: hidden;
}

.split-lines .line-inner {
  display: block;
  transform: translateY(100%);
  transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
}

.split-lines.active .line-inner {
  transform: translateY(0);
}

.split-lines .line:nth-child(1) .line-inner { transition-delay: 0s; }
.split-lines .line:nth-child(2) .line-inner { transition-delay: 0.1s; }
.split-lines .line:nth-child(3) .line-inner { transition-delay: 0.2s; }

/* Big headline animation */
.headline-reveal {
  overflow: hidden;
}

.headline-reveal span {
  display: inline-block;
  transform: translateY(100%);
  opacity: 0;
  transition: all 1s cubic-bezier(0.77, 0, 0.175, 1);
}

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

/* ========== COUNTER ANIMATION ========== */
.counter {
  font-variant-numeric: tabular-nums;
}

/* ========== CARD HOVER EFFECTS ========== */
.card-hover {
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.5s ease;
}

.card-hover:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

/* Image zoom on hover */
.img-zoom {
  overflow: hidden;
}

.img-zoom img {
  transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.img-zoom:hover img {
  transform: scale(1.08);
}

/* ========== MARQUEE ========== */
.marquee {
  display: flex;
  overflow: hidden;
  user-select: none;
}

.marquee-content {
  display: flex;
  flex-shrink: 0;
  gap: 4rem;
  animation: marquee 30s linear infinite;
}

.marquee:hover .marquee-content {
  animation-play-state: paused;
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

.marquee-content.reverse {
  animation-direction: reverse;
}

@media (max-width: 768px) {
  .marquee-content {
    gap: 1.5rem;
    animation-duration: 20s;
  }

  .marquee .gallery-item {
    width: 250px !important;
    height: 180px !important;
    flex-shrink: 0;
  }
}

@media (max-width: 480px) {
  .marquee-content {
    gap: 1rem;
    animation-duration: 15s;
  }

  .marquee .gallery-item {
    width: 200px !important;
    height: 150px !important;
  }
}

/* ========== FLIP CARDS ========== */
.flip-card {
  perspective: 1000px;
  cursor: pointer;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.flip-card-front {
  background: var(--color-white);
}

.flip-card-back {
  transform: rotateY(180deg);
  background: var(--color-navy);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  text-align: center;
}

/* ========== SCROLL INDICATOR ========== */
.scroll-indicator {
  position: absolute;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
}

.scroll-indicator-line {
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, var(--color-white), transparent);
  position: relative;
  overflow: hidden;
}

.scroll-indicator-line::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 30px;
  background: var(--color-white);
  animation: scroll-line 2s ease-in-out infinite;
}

@keyframes scroll-line {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(200%); }
}

/* ========== CURSOR ========== */
.custom-cursor {
  position: fixed;
  width: 20px;
  height: 20px;
  border: 1px solid var(--color-navy);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transition: transform 0.15s ease, opacity 0.15s ease;
  transform: translate(-50%, -50%);
}

.custom-cursor.hovering {
  transform: translate(-50%, -50%) scale(2);
  background: rgba(26, 54, 94, 0.1);
}

/* ========== SMOOTH SECTION TRANSITIONS ========== */
.section-transition {
  position: relative;
}

.section-transition::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 150px;
  background: linear-gradient(to bottom, var(--color-white), transparent);
  pointer-events: none;
  z-index: 1;
}

/* ========== GSAP FADE UP ANIMATIONS ========== */
/* Individual element fade-up with customizable timing */

/* Base fade-up class - elements start hidden */
.fade-up {
  opacity: 0;
  transform: translateY(60px);
  will-change: opacity, transform;
}

.fade-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Fade up from left */
.fade-left {
  opacity: 0;
  transform: translateX(-60px);
  will-change: opacity, transform;
}

.fade-left.is-visible {
  opacity: 1;
  transform: translateX(0);
}

/* Fade up from right */
.fade-right {
  opacity: 0;
  transform: translateX(60px);
  will-change: opacity, transform;
}

.fade-right.is-visible {
  opacity: 1;
  transform: translateX(0);
}

/* Fade with scale */
.fade-scale {
  opacity: 0;
  transform: scale(0.9);
  will-change: opacity, transform;
}

.fade-scale.is-visible {
  opacity: 1;
  transform: scale(1);
}

/* Fade with rotation */
.fade-rotate {
  opacity: 0;
  transform: translateY(40px) rotate(-3deg);
  will-change: opacity, transform;
}

.fade-rotate.is-visible {
  opacity: 1;
  transform: translateY(0) rotate(0);
}

/* Speed modifiers - applied via data attributes or additional classes */
.fade-speed-fast { --fade-duration: 0.4s; --fade-delay: 0s; }
.fade-speed-normal { --fade-duration: 0.6s; --fade-delay: 0s; }
.fade-speed-slow { --fade-duration: 1s; --fade-delay: 0s; }
.fade-speed-very-slow { --fade-duration: 1.4s; --fade-delay: 0s; }

/* Stagger delay classes for sequential animations */
.fade-delay-1 { --fade-delay: 0.1s; }
.fade-delay-2 { --fade-delay: 0.2s; }
.fade-delay-3 { --fade-delay: 0.3s; }
.fade-delay-4 { --fade-delay: 0.4s; }
.fade-delay-5 { --fade-delay: 0.5s; }
.fade-delay-6 { --fade-delay: 0.6s; }
.fade-delay-7 { --fade-delay: 0.7s; }
.fade-delay-8 { --fade-delay: 0.8s; }

/* ========== SECTION ANIMATION CONTAINERS ========== */
/* Mark sections for animation triggering */
[data-animate-section] {
  position: relative;
}

/* Section label animations */
.section-label-animate,
.tas-section-label {
  opacity: 0;
  transform: translateY(30px);
}

.section-label-animate.is-visible,
.tas-section-label.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Section title animations */
.section-title-animate,
.tas-values-title,
.tas-divisions-title {
  opacity: 0;
  transform: translateY(40px);
}

.section-title-animate.is-visible,
.tas-values-title.is-visible,
.tas-divisions-title.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Section subtitle/description animations */
.section-desc-animate,
.tas-divisions-subtitle {
  opacity: 0;
  transform: translateY(30px);
}

.section-desc-animate.is-visible,
.tas-divisions-subtitle.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========== CARD ANIMATIONS ========== */
.card-animate {
  opacity: 0;
  transform: translateY(50px);
}

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

/* Division cards specific */
.tas-division-card {
  opacity: 0;
  transform: translateY(60px);
}

.tas-division-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========== ACCORDION ITEM ANIMATIONS ========== */
.tas-value-item {
  opacity: 0;
  transform: translateX(-40px);
}

.tas-value-item.is-visible {
  opacity: 1;
  transform: translateX(0);
}

/* ========== PILLAR SLIDES ========== */
.pillar-slide {
  opacity: 0;
  transform: scale(0.95);
}

.pillar-slide.is-visible {
  opacity: 1;
  transform: scale(1);
}

/* ========== HERO CONTENT ANIMATIONS ========== */
.tas-hero-logo {
  opacity: 0;
  transform: translateY(-30px) scale(0.8);
}

.tas-hero-logo.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.tas-hero-tagline {
  opacity: 0;
  transform: translateY(30px);
}

.tas-hero-tagline.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.tas-hero-title {
  opacity: 0;
  transform: translateY(50px);
}

.tas-hero-title.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.tas-hero-subtitle {
  opacity: 0;
  transform: translateY(40px);
}

.tas-hero-subtitle.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.tas-hero-cta {
  opacity: 0;
  transform: translateY(30px);
}

.tas-hero-cta.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========== IMAGINE SECTION ========== */
.imagine-content .question-bubble {
  opacity: 0;
  transform: translateX(-40px) rotate(-5deg);
}

.imagine-content .question-bubble.is-visible {
  opacity: 1;
  transform: translateX(0) rotate(0);
}

.imagine-content .imagine-title {
  opacity: 0;
  transform: translateY(40px);
}

.imagine-content .imagine-title.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.imagine-content .imagine-headline {
  opacity: 0;
  transform: translateY(40px);
}

.imagine-content .imagine-headline.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.imagine-content .imagine-btn {
  opacity: 0;
  transform: translateY(30px);
}

.imagine-content .imagine-btn.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.student-card {
  opacity: 0;
  transform: translateY(50px) scale(0.95);
}

.student-card.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ========== FAST FACTS ========== */
.fast-fact-card {
  opacity: 0;
  transform: translateY(60px) rotateX(10deg);
  transform-origin: center bottom;
}

.fast-fact-card.is-visible {
  opacity: 1;
  transform: translateY(0) rotateX(0);
}

/* ========== HORIZONTAL PANELS ========== */
.horizontal-panel .panel-label {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.horizontal-panel .panel-label.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.horizontal-panel .panel-title {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.6s ease 0.1s, transform 0.6s ease 0.1s;
}

.horizontal-panel .panel-title.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.horizontal-panel .panel-description {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s ease 0.2s, transform 0.6s ease 0.2s;
}

.horizontal-panel .panel-description.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.horizontal-panel .panel-cta {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease 0.3s, transform 0.6s ease 0.3s;
}

.horizontal-panel .panel-cta.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.horizontal-panel .panel-stats {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s ease 0.25s, transform 0.6s ease 0.25s;
}

.horizontal-panel .panel-stats.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========== FOOTER ANIMATIONS ========== */
.footer-column {
  opacity: 0;
  transform: translateY(40px);
}

.footer-column.is-visible {
  opacity: 1;
  transform: translateY(0);
}

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

@media (max-width: 768px) {
  .horizontal-scroll-container {
    height: auto;
  }

  .horizontal-scroll-track {
    flex-direction: column;
  }

  .horizontal-panel {
    width: 100%;
    height: auto;
    min-height: 100vh;
  }

  .horizontal-panel-content {
    padding: 2rem;
  }

  .custom-cursor {
    display: none;
  }
}
