/* ============================================================
   SPATIAL ANIMATIONS — APEX CONSULTANCY
   Section-specific premium animations for every page section.
   ============================================================ */

/* ----------------------------------------------------------
   0. BASE REVEAL SYSTEM
   All elements start hidden; JS observer adds .is-revealed
   ---------------------------------------------------------- */
.anim-reveal {
    opacity: 0;
    transform: translateY(50px) scale(0.95);
    transition: opacity 0.85s cubic-bezier(0.45, 0.05, 0.55, 0.95),
                transform 0.85s cubic-bezier(0.45, 0.05, 0.55, 0.95);
    will-change: opacity, transform;
}
.anim-reveal.is-revealed { opacity: 1; transform: translateY(0) scale(1); }

.anim-reveal-left {
    opacity: 0;
    transform: translateX(-60px);
    transition: opacity 0.85s cubic-bezier(0.45, 0.05, 0.55, 0.95),
                transform 0.85s cubic-bezier(0.45, 0.05, 0.55, 0.95);
}
.anim-reveal-left.is-revealed { opacity: 1; transform: translateX(0); }

.anim-reveal-right {
    opacity: 0;
    transform: translateX(60px);
    transition: opacity 0.85s cubic-bezier(0.45, 0.05, 0.55, 0.95),
                transform 0.85s cubic-bezier(0.45, 0.05, 0.55, 0.95);
}
.anim-reveal-right.is-revealed { opacity: 1; transform: translateX(0); }

/* Stagger delays for grids */
.anim-stagger > *:nth-child(1) { transition-delay: 0.05s; }
.anim-stagger > *:nth-child(2) { transition-delay: 0.15s; }
.anim-stagger > *:nth-child(3) { transition-delay: 0.25s; }
.anim-stagger > *:nth-child(4) { transition-delay: 0.35s; }
.anim-stagger > *:nth-child(5) { transition-delay: 0.45s; }
.anim-stagger > *:nth-child(6) { transition-delay: 0.55s; }

/* ----------------------------------------------------------
   1. HERO SECTION — Cinematic Entrance
   ---------------------------------------------------------- */
.hero { position: relative; overflow: hidden; }

/* Animated floating particles behind hero */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 40% at 70% 20%, rgba(11,59,96,0.35) 0%, transparent 60%),
        radial-gradient(ellipse 40% 50% at 20% 80%, rgba(139,92,246,0.2) 0%, transparent 60%),
        radial-gradient(ellipse 50% 30% at 50% 50%, rgba(6,182,212,0.1) 0%, transparent 70%);
    animation: hero-bg-pulse 10s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 0;
}

@keyframes hero-bg-pulse {
    0%   { opacity: 0.6; transform: scale(1)   rotate(0deg); }
    100% { opacity: 1;   transform: scale(1.05) rotate(2deg); }
}

.hero-content { position: relative; z-index: 2; }

/* Hero badge drops in */
.hero-badge {
    animation: drop-in 0.7s cubic-bezier(0.45, 0.05, 0.55, 0.95) both;
    animation-delay: 0.1s;
}

/* Hero H1 slides up */
.hero h1 {
    animation: slide-up-fade 0.9s cubic-bezier(0.45, 0.05, 0.55, 0.95) both;
    animation-delay: 0.25s;
}

/* Hero paragraph */
.hero p {
    animation: slide-up-fade 0.9s cubic-bezier(0.45, 0.05, 0.55, 0.95) both;
    animation-delay: 0.4s;
}

/* Hero buttons */
.hero-buttons {
    animation: slide-up-fade 0.9s cubic-bezier(0.45, 0.05, 0.55, 0.95) both;
    animation-delay: 0.55s;
}

/* Hero image floats in from right */
.hero-image {
    animation: float-in-right 1.1s cubic-bezier(0.45, 0.05, 0.55, 0.95) both;
    animation-delay: 0.3s;
}

/* Speech bubble pop */
.hero-speech-bubble {
    animation: pop-in 0.6s cubic-bezier(0.45, 0.05, 0.55, 0.95) both;
    animation-delay: 1.2s;
}

@keyframes drop-in {
    from { opacity: 0; transform: translateY(-30px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes slide-up-fade {
    from { opacity: 0; transform: translateY(40px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes float-in-right {
    from { opacity: 0; transform: translateX(80px) scale(0.95); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes pop-in {
    from { opacity: 0; transform: scale(0.7); }
    to   { opacity: 1; transform: scale(1); }
}

/* Continuous hero image levitation */
.hero-image img {
    animation: gentle-levitate 7s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}
@keyframes gentle-levitate {
    0%,100% { transform: translateY(0); }
    50%      { transform: translateY(-18px); }
}

/* ----------------------------------------------------------
   2. STATS SECTION — Number Pop + Glow
   ---------------------------------------------------------- */
.stats-section { position: relative; overflow: hidden; }
.stats-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(11,59,96,0.06) 0%, rgba(6,182,212,0.04) 100%);
    pointer-events: none;
}

.stat-box {
    position: relative;
    overflow: hidden;
    transition: transform 0.5s cubic-bezier(0.45,0.05,0.55,0.95),
                box-shadow 0.5s cubic-bezier(0.45,0.05,0.55,0.95);
}
.stat-box:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 20px 60px rgba(6,182,212,0.2), var(--glass-shadow, 0 8px 32px rgba(0,0,0,0.8));
}

/* Stat icon spins on hover */
.stat-box:hover .stat-icon {
    animation: icon-spin 0.6s cubic-bezier(0.45, 0.05, 0.55, 0.95);
}
@keyframes icon-spin {
    0%   { transform: rotate(0deg) scale(1); }
    50%  { transform: rotate(15deg) scale(1.2); }
    100% { transform: rotate(0deg) scale(1); }
}

/* Gold glow on stat number */
.stat-number {
    background: linear-gradient(to bottom, #FFFFFF 30%, #D4AF37 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 8px rgba(212,175,55,0.4));
}

/* ----------------------------------------------------------
   3. CHAIRMAN SECTION — Parallax Slide
   ---------------------------------------------------------- */
.chairman-section { position: relative; overflow: hidden; }

.chairman-image {
    position: relative;
}
.chairman-image::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: inherit;
    background: conic-gradient(from 0deg, #D4AF37, #0B3B60, #06B6D4, #D4AF37);
    z-index: -1;
    animation: border-spin 6s linear infinite;
    border-radius: 50%;
    opacity: 0.6;
}
@keyframes border-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.chairman-stats .stat-item {
    transition: transform 0.4s cubic-bezier(0.45,0.05,0.55,0.95);
}
.chairman-stats .stat-item:hover { transform: translateY(-6px); }

/* ----------------------------------------------------------
   4. SERVICES SECTION — 3D Card Tilt
   ---------------------------------------------------------- */
.service-card {
    transform-origin: center;
    transition: transform 0.5s cubic-bezier(0.45,0.05,0.55,0.95),
                box-shadow 0.5s cubic-bezier(0.45,0.05,0.55,0.95);
    cursor: default;
}
.service-card:hover {
    transform: translateY(-12px) rotateX(3deg);
    box-shadow: 0 30px 80px rgba(11,59,96,0.4),
                0 0 40px rgba(6,182,212,0.15),
                inset 0 0 0 1px rgba(255,255,255,0.1);
}

/* Icon pulse on hover */
.service-icon {
    transition: transform 0.4s cubic-bezier(0.45,0.05,0.55,0.95),
                color 0.4s ease,
                filter 0.4s ease;
}
.service-card:hover .service-icon {
    transform: scale(1.2) rotate(-5deg);
    filter: drop-shadow(0 0 12px rgba(212,175,55,0.6));
    color: #D4AF37;
}

/* Gold underline on card heading */
.service-card h3 {
    position: relative;
    display: inline-block;
}
.service-card h3::after {
    content: '';
    position: absolute;
    bottom: -4px; left: 0;
    width: 0; height: 2px;
    background: linear-gradient(to right, #D4AF37, #0B3B60);
    transition: width 0.5s cubic-bezier(0.45,0.05,0.55,0.95);
}
.service-card:hover h3::after { width: 100%; }

/* ----------------------------------------------------------
   5. PROCESS SECTION — Sequential Step Reveal
   ---------------------------------------------------------- */
.process-steps { perspective: 1000px; }

.step {
    position: relative;
    transition: transform 0.5s cubic-bezier(0.45,0.05,0.55,0.95),
                box-shadow 0.5s cubic-bezier(0.45,0.05,0.55,0.95);
}
.step:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 50px rgba(11,59,96,0.3);
}

/* Step number ring animation */
.step-number {
    position: relative;
    transition: all 0.4s cubic-bezier(0.45,0.05,0.55,0.95);
}
.step:hover .step-number {
    background: linear-gradient(135deg, #D4AF37, #0B3B60);
    box-shadow: 0 0 25px rgba(212,175,55,0.5);
    transform: scale(1.15) rotate(10deg);
}

/* Connector line draw animation */
.step::after {
    content: '';
    position: absolute;
    top: 50%; right: -30px;
    width: 0; height: 2px;
    background: linear-gradient(to right, #D4AF37, transparent);
    transition: width 1s cubic-bezier(0.45,0.05,0.55,0.95) 0.3s;
}
.step.is-revealed::after { width: 30px; }

/* ----------------------------------------------------------
   6. COURSES SECTION — Glass Flip Card
   ---------------------------------------------------------- */
.course-card {
    transition: transform 0.6s cubic-bezier(0.45,0.05,0.55,0.95),
                box-shadow 0.6s cubic-bezier(0.45,0.05,0.55,0.95);
}
.course-card:hover {
    transform: translateY(-14px) scale(1.02);
    box-shadow: 0 40px 100px rgba(11,59,96,0.5),
                0 0 60px rgba(212,175,55,0.1);
}

/* Course badge shimmer */
.course-badge {
    position: relative;
    overflow: hidden;
}
.course-badge::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 60%; height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.4), transparent);
    animation: badge-shimmer 3s infinite;
}
@keyframes badge-shimmer {
    0%   { left: -100%; }
    100% { left: 200%; }
}

/* Price tag glow on hover */
.price-value {
    transition: color 0.4s ease, filter 0.4s ease;
}
.course-card:hover .price-value {
    color: #D4AF37;
    filter: drop-shadow(0 0 8px rgba(212,175,55,0.5));
}

/* Enroll button liquid fill */
.btn-enroll {
    position: relative;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.45,0.05,0.55,0.95),
                box-shadow 0.4s cubic-bezier(0.45,0.05,0.55,0.95);
    z-index: 1;
}
.btn-enroll::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #D4AF37, #0B3B60);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.45,0.05,0.55,0.95);
    z-index: -1;
}
.btn-enroll:hover::before { transform: scaleX(1); }
.btn-enroll:hover {
    color: #fff;
    box-shadow: 0 0 30px rgba(212,175,55,0.4);
}

/* ----------------------------------------------------------
   7. GALLERY SECTION — Masonry Reveal + Zoom
   ---------------------------------------------------------- */
.gallery-item {
    overflow: hidden;
    border-radius: 12px;
    transition: transform 0.5s cubic-bezier(0.45,0.05,0.55,0.95),
                box-shadow 0.5s cubic-bezier(0.45,0.05,0.55,0.95);
}
.gallery-item:hover {
    transform: scale(1.04);
    box-shadow: 0 20px 60px rgba(11,59,96,0.5);
}
.gallery-item img {
    transition: transform 0.7s cubic-bezier(0.45,0.05,0.55,0.95);
}
.gallery-item:hover img { transform: scale(1.1); }

.gallery-overlay {
    background: linear-gradient(to top, rgba(2,2,5,0.9) 0%, transparent 100%);
    transition: opacity 0.4s cubic-bezier(0.45,0.05,0.55,0.95);
}

/* Filter button gold highlight */
.gallery-filter {
    transition: all 0.35s cubic-bezier(0.45,0.05,0.55,0.95);
}
.gallery-filter.active, .gallery-filter:hover {
    background: linear-gradient(135deg, #D4AF37, #0B3B60);
    color: #fff;
    box-shadow: 0 4px 20px rgba(212,175,55,0.3);
    transform: translateY(-2px);
}

/* ----------------------------------------------------------
   8. TESTIMONIALS SECTION — Hover Lift + Quote Glow
   ---------------------------------------------------------- */
.testimonial-card {
    transition: transform 0.5s cubic-bezier(0.45,0.05,0.55,0.95),
                box-shadow 0.5s cubic-bezier(0.45,0.05,0.55,0.95);
}
.testimonial-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 30px 80px rgba(11,59,96,0.4);
}

/* Avatar ring pulse */
.testimonial-avatar {
    transition: box-shadow 0.4s ease, transform 0.4s cubic-bezier(0.45,0.05,0.55,0.95);
}
.testimonial-card:hover .testimonial-avatar {
    transform: scale(1.08);
    box-shadow: 0 0 0 4px #D4AF37, 0 0 20px rgba(212,175,55,0.4);
}

/* Star rating twinkle on hover */
.testimonial-rating i {
    transition: transform 0.3s cubic-bezier(0.45,0.05,0.55,0.95), color 0.3s ease;
}
.testimonial-card:hover .testimonial-rating i {
    animation: star-twinkle 0.6s cubic-bezier(0.45,0.05,0.55,0.95) both;
}
.testimonial-card:hover .testimonial-rating i:nth-child(1) { animation-delay: 0.00s; }
.testimonial-card:hover .testimonial-rating i:nth-child(2) { animation-delay: 0.05s; }
.testimonial-card:hover .testimonial-rating i:nth-child(3) { animation-delay: 0.10s; }
.testimonial-card:hover .testimonial-rating i:nth-child(4) { animation-delay: 0.15s; }
.testimonial-card:hover .testimonial-rating i:nth-child(5) { animation-delay: 0.20s; }
@keyframes star-twinkle {
    0%   { transform: scale(1); color: inherit; }
    50%  { transform: scale(1.4) rotate(15deg); color: #D4AF37; }
    100% { transform: scale(1); }
}

/* ----------------------------------------------------------
   9. CONSULTATION / CTA SECTION — Pulse Glow
   ---------------------------------------------------------- */
.consultation-section { position: relative; overflow: hidden; }
.consultation-section::before {
    content: '';
    position: absolute;
    inset: -50%;
    background: radial-gradient(ellipse 60% 50% at 50% 50%, rgba(212,175,55,0.07) 0%, transparent 70%);
    animation: cta-pulse 5s ease-in-out infinite;
    pointer-events: none;
}
@keyframes cta-pulse {
    0%,100% { transform: scale(1); opacity: 0.5; }
    50%      { transform: scale(1.15); opacity: 1; }
}

.consultation-icon {
    animation: icon-breathe 3s cubic-bezier(0.45,0.05,0.55,0.95) infinite;
    filter: drop-shadow(0 0 20px rgba(212,175,55,0.5));
}
@keyframes icon-breathe {
    0%,100% { transform: scale(1); }
    50%      { transform: scale(1.12); }
}

/* ----------------------------------------------------------
   10. GOAL SECTION — Highlight Text Reveal
   ---------------------------------------------------------- */
.goal-section .highlight {
    position: relative;
    display: inline;
    background: linear-gradient(to bottom, #FFFFFF 20%, #D4AF37 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ----------------------------------------------------------
   11. CONTACT / FOOTER SECTION — Links Glow
   ---------------------------------------------------------- */
.social-links a, .footer-link {
    transition: transform 0.35s cubic-bezier(0.45,0.05,0.55,0.95),
                color 0.35s ease,
                filter 0.35s ease;
}
.social-links a:hover, .footer-link:hover {
    transform: translateY(-4px) scale(1.1);
    color: #D4AF37;
    filter: drop-shadow(0 0 8px rgba(212,175,55,0.6));
}

/* ----------------------------------------------------------
   12. HEADER — Transparent → Glass on Scroll (override)
   ---------------------------------------------------------- */
.header {
    background: rgba(2, 2, 5, 0.65) !important;
    color: white !important;
    transition: background 0.5s cubic-bezier(0.45,0.05,0.55,0.95),
                box-shadow 0.5s cubic-bezier(0.45,0.05,0.55,0.95),
                border-color 0.5s cubic-bezier(0.45,0.05,0.55,0.95);
}
.header .logo-title,
.header .logo-subtitle,
.header .desktop-menu a,
.header .mobile-menu a,
.header .mobile-toggle span {
    color: white !important;
}
.header .logo-subtitle {
    color: rgba(255,255,255,0.75) !important;
}
.header.scrolled {
    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(18px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(18px) saturate(180%) !important;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12) !important;
}
.header.scrolled .desktop-menu a,
.header.scrolled .mobile-menu a {
    color: var(--neutral-800) !important;
}
.header.scrolled .desktop-menu a:hover,
.header.scrolled .mobile-menu a:hover {
    color: var(--primary) !important;
}
.header.scrolled .logo-title {
    color: var(--primary) !important;
}
.header.scrolled .logo-subtitle {
    color: var(--neutral-500) !important;
}

/* Nav link hover glow */
.desktop-menu a {
    transition: color 0.3s cubic-bezier(0.45,0.05,0.55,0.95),
                text-shadow 0.3s ease;
}
.desktop-menu a:hover {
    color: #D4AF37 !important;
    text-shadow: 0 0 12px rgba(212,175,55,0.5);
}

/* ----------------------------------------------------------
   13. PAGE-HEADER (Inner Pages) — Beam Sweep
   ---------------------------------------------------------- */
.page-header {
    position: relative;
    overflow: hidden;
}
.page-header::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.04), transparent);
    animation: page-header-sweep 6s cubic-bezier(0.45,0.05,0.55,0.95) infinite;
    transform: skewX(-20deg);
    pointer-events: none;
}
@keyframes page-header-sweep {
    0%   { left: -100%; }
    30%, 100% { left: 200%; }
}

/* ----------------------------------------------------------
   14. PROMO BANNER — Attention Pulse
   ---------------------------------------------------------- */
.promo-banner {
    animation: promo-attention 4s cubic-bezier(0.45,0.05,0.55,0.95) infinite;
}
@keyframes promo-attention {
    0%,100% { box-shadow: 0 0 0 0 rgba(212,175,55,0); }
    50%      { box-shadow: 0 0 30px 6px rgba(212,175,55,0.25); }
}

/* ----------------------------------------------------------
   15. FAQ / ACCORDION — Smooth Expand
   ---------------------------------------------------------- */
.faq-answer, .accordion-content {
    transition: max-height 0.6s cubic-bezier(0.45,0.05,0.55,0.95),
                opacity 0.5s cubic-bezier(0.45,0.05,0.55,0.95);
}

.faq-item, .accordion-item {
    transition: box-shadow 0.4s cubic-bezier(0.45,0.05,0.55,0.95),
                border-color 0.4s ease;
}
.faq-item:hover, .accordion-item:hover {
    box-shadow: 0 8px 30px rgba(11,59,96,0.3);
    border-color: rgba(212,175,55,0.3);
}

/* ----------------------------------------------------------
   16. MOBILE MENU — Slide Down with Blur
   ---------------------------------------------------------- */
.mobile-menu.active {
    background: rgba(2, 2, 5, 0.9) !important;
    backdrop-filter: blur(40px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(40px) saturate(200%) !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
}
.mobile-menu a:hover {
    background: rgba(212,175,55,0.08) !important;
    color: #D4AF37 !important;
}

/* ----------------------------------------------------------
   17. SCROLL PROGRESS BAR — Gold Thin Line at Top
   ---------------------------------------------------------- */
#scroll-progress-bar {
    position: fixed;
    top: 0; left: 0;
    height: 2px;
    width: 0%;
    background: linear-gradient(to right, #0B3B60, #D4AF37, #06B6D4);
    z-index: 9999;
    transition: width 0.1s linear;
    box-shadow: 0 0 8px rgba(212,175,55,0.6);
}

/* ----------------------------------------------------------
   18. CUSTOM CURSOR DOT
   ---------------------------------------------------------- */
#cursor-dot {
    position: fixed;
    width: 8px; height: 8px;
    background: #D4AF37;
    border-radius: 50%;
    pointer-events: none;
    z-index: 99999;
    transform: translate(-50%, -50%);
    transition: transform 0.1s linear, opacity 0.3s ease;
    box-shadow: 0 0 12px rgba(212,175,55,0.8);
}
#cursor-ring {
    position: fixed;
    width: 36px; height: 36px;
    border: 1.5px solid rgba(212,175,55,0.6);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99998;
    transform: translate(-50%, -50%);
    transition: width 0.3s cubic-bezier(0.45,0.05,0.55,0.95),
                height 0.3s cubic-bezier(0.45,0.05,0.55,0.95),
                left 0.12s cubic-bezier(0.45,0.05,0.55,0.95),
                top 0.12s cubic-bezier(0.45,0.05,0.55,0.95),
                opacity 0.3s ease;
}
body:has(a:hover) #cursor-ring,
body:has(button:hover) #cursor-ring {
    width: 56px; height: 56px;
    border-color: rgba(212,175,55,1);
}

/* ==========================================================
   19. MOBILE PERFORMANCE OPTIMIZATIONS
   ========================================================== */
@media screen and (max-width: 768px) {
    /* Hide the custom cursor completely on mobile */
    #cursor-dot, #cursor-ring {
        display: none !important;
    }

    /* Disable infinite particle animations / pulses / levitations */
    .hero::before, .consultation-section::before, .page-header::after {
        display: none !important;
        animation: none !important;
    }
    
    .hero-image img, .consultation-icon, .promo-banner {
        animation: none !important;
    }

    /* Reduce blur on header and mobile menu for better rendering */
    .header.scrolled, .mobile-menu.active {
        backdrop-filter: blur(10px) saturate(150%) !important;
        -webkit-backdrop-filter: blur(10px) saturate(150%) !important;
    }

    /* Simplify reveal animations */
    .anim-reveal, .anim-reveal-left, .anim-reveal-right {
        transition-duration: 0.5s !important;
        transform: translateY(20px) scale(0.98); /* Less movement */
    }

    /* Disable hover 3D transforms which may jitter on scroll */
    .service-card:hover, .course-card:hover, .gallery-item:hover, .testimonial-card:hover, .feature-card:hover {
        transform: none !important;
        box-shadow: var(--shadow-sm) !important;
    }

    /* Hide custom cursor on mobile */
    #cursor-dot, #cursor-ring {
        display: none !important;
    }

    /* Reduce box shadows and transforms on heavy elements */
    .service-card, .course-card, .stat-box, .testimonial-card, .feature-card {
        transition: transform 0.3s ease, box-shadow 0.3s ease !important;
        will-change: auto !important;
    }
}
