/* Premium Animations & Scroll Effects for Bastuku Investments */

/* ============================================
   KEYFRAME ANIMATIONS - EXTRAS
   (fadeIn, fadeInUp, fadeInDown, slideInLeft,
    slideInRight, scaleIn are defined in
    tailwind-config.js — not duplicated here)
   ============================================ */

@keyframes glow {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes slideDown {
    from {
        max-height: 0;
        opacity: 0;
    }
    to {
        max-height: 500px;
        opacity: 1;
    }
}

/* ============================================
   ANIMATION CLASSES (extras only)
   animate-fade-in, animate-fade-in-up, etc.
   are generated by Tailwind via tailwind-config.js
   ============================================ */

.animate-glow {
    animation: glow 2s ease-in-out infinite;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* ============================================
   KEN BURNS — Hero Background Zoom + Pan
   ============================================ */

@keyframes kenBurns {
    0% {
        transform: scale(1) translate3d(0, 0, 0);
    }
    100% {
        transform: scale(1.12) translate3d(-2%, -1%, 0);
    }
}

.hero-ken-burns {
    animation: kenBurns 20s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
    will-change: transform;
}

/* ============================================
   HERO STAGGERED ENTRANCE — Horizontal Pan
   ============================================ */

@keyframes heroPanIn {
    0% {
        opacity: 0;
        transform: translate3d(-60px, 0, 0);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes heroPanUp {
    0% {
        opacity: 0;
        transform: translate3d(-30px, 15px, 0);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes heroFadeIn {
    0% {
        opacity: 0;
        transform: translate3d(0, 20px, 0);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.hero-stagger-badge {
    opacity: 0;
    animation: heroPanIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
}

.hero-stagger-heading {
    opacity: 0;
    animation: heroPanIn 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.6s forwards;
}

.hero-stagger-text {
    opacity: 0;
    animation: heroPanUp 1s cubic-bezier(0.16, 1, 0.3, 1) 1s forwards;
}

.hero-stagger-buttons {
    opacity: 0;
    animation: heroPanUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) 1.3s forwards;
}

.hero-stagger-scroll {
    opacity: 0;
    animation: heroFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) 1.8s forwards;
}

/* Subtle continuous glow pulse on hero CTA */
@keyframes heroCTAPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.02);
        opacity: 0.95;
    }
}

.hero-cta-pulse {
    animation: heroCTAPulse 2.5s cubic-bezier(0.16, 1, 0.3, 1) 2.5s infinite;
}

/* ============================================
   PREMIUM BUTTON HOVER EFFECTS
   ============================================ */

button {
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

button:hover::before {
    left: 100%;
}

/* Elevated button effect */
.btn-elevated {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-elevated:hover {
    transform: translateY(-4px);
    opacity: 0.95;
}

.btn-elevated:active {
    transform: translateY(-1px);
    opacity: 1;
}

/* ============================================
   CARD HOVER PREMIUM EFFECTS
   ============================================ */

.card-premium-hover {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-color: transparent;
}

.card-premium-hover:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: #0d7ff2;
    opacity: 0.98;
}

.card-premium-hover:hover .group-hover:enabled {
    color: white;
    background-color: #0d7ff2;
}

/* ============================================
   SCROLL REVEAL ANIMATIONS — Premium Smooth
   Easing: cubic-bezier(0.16, 1, 0.3, 1) = expo ease-out
   GPU-accelerated via will-change + translate3d
   ============================================ */

.reveal-up,
.reveal-left,
.reveal-right,
.reveal-scale {
    will-change: transform, opacity;
    backface-visibility: hidden;
}

.reveal-up {
    opacity: 0;
    transform: translate3d(0, 40px, 0);
    transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-up.revealed {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.reveal-left {
    opacity: 0;
    transform: translate3d(-50px, 0, 0);
    transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left.revealed {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.reveal-right {
    opacity: 0;
    transform: translate3d(50px, 0, 0);
    transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-right.revealed {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Section-level reveal — subtle fade + rise for entire sections */
.section-reveal {
    opacity: 0;
    transform: translate3d(0, 50px, 0);
    transition: opacity 1.1s cubic-bezier(0.16, 1, 0.3, 1),
                transform 1.1s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, opacity;
}

.section-reveal.revealed {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

/* ============================================
   STAGGER ANIMATIONS FOR LISTS
   ============================================ */

.stagger-item {
    opacity: 0;
    animation: fadeInUp 0.7s ease-out forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }
.stagger-item:nth-child(6) { animation-delay: 0.6s; }

/* ============================================
   PARALLAX EFFECTS
   ============================================ */

.parallax-bg {
    background-attachment: fixed;
    background-position: center;
    background-size: cover;
}

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

.parallax-image {
    transform: translateZ(0);
    will-change: transform;
}

/* ============================================
   GRADIENT ANIMATIONS
   ============================================ */

@keyframes gradientShift {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.85;
    }
}

.gradient-animated {
    background: linear-gradient(90deg, #0d7ff2, #1e88f5, #0d7ff2);
    animation: gradientShift 3s ease infinite;
}

/* ============================================
   LINK HOVER EFFECTS - PREMIUM
   ============================================ */

.link-underline {
    position: relative;
    color: inherit;
    text-decoration: none;
}

.link-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #0d7ff2, #1e88f5);
    transition: width 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.link-underline:hover::after {
    width: 100%;
}

.link-underline--thick::after {
    height: 3px;
    bottom: -4px;
}

/* ============================================
   ICON ANIMATIONS
   ============================================ */

.icon-bounce {
    animation: bounce 2s ease-in-out infinite;
}

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

.icon-rotate {
    animation: rotate 20s linear infinite;
}

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

/* ============================================
   SECTION TRANSITIONS
   (handled by .scroll-animate + IntersectionObserver
    in script.js — no blanket section animation)
   ============================================ */

/* ============================================
   FORM INPUT ANIMATIONS
   ============================================ */

input:focus,
textarea:focus,
select:focus {
    animation: scaleIn 0.3s ease-out;
    opacity: 0.98;
}

/* ============================================
   LOADING STATES
   ============================================ */

.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #0d7ff2;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* ============================================
   FLOATING DECORATIVE ELEMENTS
   ============================================ */

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

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

.floating {
    animation: float 6s ease-in-out infinite;
}

.floating-reverse {
    animation: floatReverse 7s ease-in-out infinite;
}

.floating-slow {
    animation: float 10s ease-in-out infinite;
}

/* ============================================
   COUNTER / STATS ANIMATION
   ============================================ */

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

.stat-number {
    animation: countUp 0.6s ease-out forwards;
}

/* ============================================
   RESPONSIVE ANIMATIONS
   ============================================ */

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

    .reveal-up, .reveal-left, .reveal-right, .reveal-scale,
    .section-reveal,
    .hero-stagger-badge, .hero-stagger-heading,
    .hero-stagger-text, .hero-stagger-buttons,
    .hero-stagger-scroll, .hero-ken-burns {
        opacity: 1 !important;
        transform: none !important;
    }
}