/* ============================================
   Premium GSAP Animation Styles
   Inspired by gsap.com, Apple, Stripe
   ============================================ */

/* ----------------------------------------
   Performance Optimizations
   ---------------------------------------- */

/* GPU acceleration for animated elements */
.hero-section,
.hero-logo,
.hero-badge,
.hero-title,
.hero-subtitle,
.hero-tagline,
.hero-cta,
.hero-cta a,
.parallax-bg,
.magnetic-btn,
article,
.group,
.grid > * {
    will-change: transform, opacity;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Disable will-change after animation completes */
.gsap-complete {
    will-change: auto;
}

/* ----------------------------------------
   Base Animation Styles
   ---------------------------------------- */

/* Line animation */
.line-animate {
    height: 2px;
    background: linear-gradient(90deg, #D4AF37, #FFD700);
    transform-origin: left center;
}

/* Counter animation */
.counter-number {
    display: inline-block;
}

/* ----------------------------------------
   Magnetic Button Effect
   ---------------------------------------- */

.magnetic-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
}

.magnetic-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.magnetic-btn:hover::before {
    opacity: 1;
}

/* ----------------------------------------
   Card Hover Effects
   ---------------------------------------- */

.card-hover,
article,
.group {
    transition: box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

article:hover,
.group:hover {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Image container overflow */
article .overflow-hidden,
.group .overflow-hidden {
    overflow: hidden;
}

article img,
.group img {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ----------------------------------------
   Parallax Containers
   ---------------------------------------- */

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

.parallax-bg {
    position: absolute;
    inset: -50px;
    background-size: cover;
    background-position: center;
}

/* ----------------------------------------
   Text Reveal Styles
   ---------------------------------------- */

.text-reveal {
    overflow: hidden;
    display: inline-block;
}

.text-reveal-inner {
    display: inline-block;
}

/* Split text characters */
.split-text .char {
    display: inline-block;
}

/* ----------------------------------------
   Scroll Indicator Animation
   ---------------------------------------- */

.scroll-indicator {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(-10px);
    }
}

.scroll-dot {
    animation: scroll-dot 2s ease-in-out infinite;
}

@keyframes scroll-dot {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    50% {
        transform: translateY(16px);
        opacity: 0.3;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ----------------------------------------
   Hero Section Effects
   ---------------------------------------- */

.hero-line {
    opacity: 0.3;
    animation: hero-line-move 8s ease-in-out infinite;
}

.hero-line:nth-child(2) {
    animation-delay: -2s;
}

.hero-line:nth-child(3) {
    animation-delay: -4s;
}

@keyframes hero-line-move {
    0%, 100% {
        opacity: 0.1;
        transform: translateY(0);
    }
    50% {
        opacity: 0.4;
        transform: translateY(-20px);
    }
}

/* ----------------------------------------
   Section Dividers
   ---------------------------------------- */

.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.5), transparent);
}

/* ----------------------------------------
   Loading Bar
   ---------------------------------------- */

.loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #D4AF37, #FFD700, #D4AF37);
    transform: scaleX(0);
    transform-origin: left;
    z-index: 9999;
}

/* ----------------------------------------
   Glitch Effect (Optional)
   ---------------------------------------- */

.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
}

.glitch:hover::before {
    animation: glitch-1 0.3s linear infinite;
    color: #D4AF37;
    opacity: 0.8;
}

.glitch:hover::after {
    animation: glitch-2 0.3s linear infinite;
    color: #4A5D23;
    opacity: 0.8;
}

@keyframes glitch-1 {
    0% { clip-path: inset(20% 0 60% 0); transform: translateX(-3px); }
    20% { clip-path: inset(60% 0 20% 0); transform: translateX(3px); }
    40% { clip-path: inset(40% 0 40% 0); transform: translateX(-3px); }
    60% { clip-path: inset(80% 0 10% 0); transform: translateX(3px); }
    80% { clip-path: inset(10% 0 80% 0); transform: translateX(-3px); }
    100% { clip-path: inset(20% 0 60% 0); transform: translateX(3px); }
}

@keyframes glitch-2 {
    0% { clip-path: inset(60% 0 20% 0); transform: translateX(3px); }
    20% { clip-path: inset(20% 0 60% 0); transform: translateX(-3px); }
    40% { clip-path: inset(80% 0 10% 0); transform: translateX(3px); }
    60% { clip-path: inset(40% 0 40% 0); transform: translateX(-3px); }
    80% { clip-path: inset(10% 0 80% 0); transform: translateX(3px); }
    100% { clip-path: inset(60% 0 20% 0); transform: translateX(-3px); }
}

/* ----------------------------------------
   Progress Bar
   ---------------------------------------- */

.progress-bar {
    height: 4px;
    background: rgba(212, 175, 55, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #D4AF37, #FFD700);
    width: 0;
    transition: width 1s ease-out;
}

/* ----------------------------------------
   Play Button Pulse
   ---------------------------------------- */

.play-btn-pulse {
    position: relative;
}

.play-btn-pulse::before {
    content: '';
    position: absolute;
    inset: -10px;
    border: 2px solid #D4AF37;
    border-radius: 50%;
    animation: pulse-ring 1.5s infinite;
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

/* ----------------------------------------
   Marquee Animation
   ---------------------------------------- */

.marquee {
    display: flex;
    overflow: hidden;
    white-space: nowrap;
}

.marquee-content {
    display: flex;
    animation: marquee 20s linear infinite;
}

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

/* ----------------------------------------
   Header Scroll Effects
   ---------------------------------------- */

.header-main {
    transition: background 0.3s ease;
}

.header-main.scrolled .bg-tni-green-dark\/90 {
    background: rgba(45, 59, 20, 0.98);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* ----------------------------------------
   Smooth Scroll
   ---------------------------------------- */

html {
    scroll-behavior: smooth;
}

/* Disable smooth scroll for GSAP scrollTo */
html.gsap-scroll {
    scroll-behavior: auto;
}

/* ----------------------------------------
   Custom Scrollbar
   ---------------------------------------- */

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #2D3B14;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #D4AF37, #B8960C);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #FFD700;
}

/* ----------------------------------------
   Selection Color
   ---------------------------------------- */

::selection {
    background: rgba(212, 175, 55, 0.3);
    color: #FFD700;
}

/* ----------------------------------------
   Pinned Section Styles
   ---------------------------------------- */

.pin-spacer {
    background: transparent !important;
}

/* Fix for pinned elements */
[data-scroll-trigger-pinned="true"] {
    z-index: 10;
}

/* ----------------------------------------
   ScrollTrigger Markers (Debug)
   ---------------------------------------- */

.gsap-marker-start,
.gsap-marker-end,
.gsap-marker-scroller-start,
.gsap-marker-scroller-end {
    display: none !important;
}

/* ----------------------------------------
   Reduced Motion Accessibility
   ---------------------------------------- */

@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;
    }

    .scroll-indicator,
    .scroll-dot,
    .hero-line,
    .play-btn-pulse::before,
    .marquee-content {
        animation: none !important;
    }

    /* Disable GSAP animations for reduced motion */
    .gsap-disable {
        transform: none !important;
        opacity: 1 !important;
    }
}

/* ----------------------------------------
   Mobile Optimizations
   ---------------------------------------- */

@media (max-width: 767px) {
    /* Reduce GPU-intensive effects on mobile */
    .parallax-bg {
        transform: none !important;
    }

    /* Simplify animations */
    .hero-line {
        display: none;
    }

    /* Disable magnetic effect on touch devices */
    .magnetic-btn {
        transform: none !important;
    }

    /* Reduce card hover effects */
    article:hover,
    .group:hover {
        transform: none;
        box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.4);
    }
}

/* ----------------------------------------
   High Performance Mode
   ---------------------------------------- */

@media (prefers-reduced-data: reduce) {
    /* Disable background images and heavy assets */
    .parallax-bg,
    [style*="background-image"] {
        background-image: none !important;
        background-color: #2D3B14;
    }
}

/* ----------------------------------------
   Print Styles
   ---------------------------------------- */

@media print {
    .scroll-indicator,
    .hero-line,
    .magnetic-btn::before,
    .play-btn-pulse::before {
        display: none !important;
    }

    * {
        animation: none !important;
        transition: none !important;
    }
}
