/* ============================================
   ANIMATION LIBRARY - UzTravels
   All animations can be disabled from admin panel
   ============================================ */

/* --- Scroll Reveal Base --- */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.animate-on-scroll.animate-fade-in {
    transform: translateY(0);
    opacity: 0;
    transition: opacity 1s ease-out;
}

.animate-on-scroll.animate-fade-in.animate-visible {
    opacity: 1;
}

.animate-on-scroll.animate-slide-left {
    transform: translateX(60px);
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.animate-on-scroll.animate-slide-left.animate-visible {
    opacity: 1;
    transform: translateX(0);
}

.animate-on-scroll.animate-slide-right {
    transform: translateX(-60px);
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.animate-on-scroll.animate-slide-right.animate-visible {
    opacity: 1;
    transform: translateX(0);
}

.animate-on-scroll.animate-zoom-in {
    transform: scale(0.9);
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.animate-on-scroll.animate-zoom-in.animate-visible {
    opacity: 1;
    transform: scale(1);
}

.animate-on-scroll.animate-flip-up {
    transform: perspective(600px) rotateX(15deg) translateY(30px);
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.animate-on-scroll.animate-flip-up.animate-visible {
    opacity: 1;
    transform: perspective(600px) rotateX(0) translateY(0);
}

/* --- Staggered delays for grid items --- */
.animate-on-scroll[data-delay="100"] { transition-delay: 0.1s; }
.animate-on-scroll[data-delay="200"] { transition-delay: 0.2s; }
.animate-on-scroll[data-delay="300"] { transition-delay: 0.3s; }
.animate-on-scroll[data-delay="400"] { transition-delay: 0.4s; }
.animate-on-scroll[data-delay="500"] { transition-delay: 0.5s; }
.animate-on-scroll[data-delay="600"] { transition-delay: 0.6s; }
.animate-on-scroll[data-delay="700"] { transition-delay: 0.7s; }
.animate-on-scroll[data-delay="800"] { transition-delay: 0.8s; }

/* --- Continuous Animations (always active, not scroll-triggered) --- */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-12px); }
}

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

@keyframes pulse-soft {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px rgba(4, 120, 87, 0.3); }
    50% { box-shadow: 0 0 20px rgba(4, 120, 87, 0.6), 0 0 40px rgba(4, 120, 87, 0.2); }
}

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

@keyframes icon-spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes icon-pulse-glow {
    0%, 100% { filter: drop-shadow(0 0 2px rgba(4, 120, 87, 0.3)); }
    50% { filter: drop-shadow(0 0 8px rgba(4, 120, 87, 0.6)); }
}

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

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

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes border-dance {
    0% { background-position: 0% 0%, 100% 0%, 100% 100%, 0% 100%; }
    100% { background-position: 100% 0%, 100% 100%, 0% 100%, 0% 0%; }
}

@keyframes icon-bounce-in {
    0% { transform: scale(0) rotate(-180deg); opacity: 0; }
    60% { transform: scale(1.2) rotate(10deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); }
}

@keyframes slide-in-right {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-3deg); }
    75% { transform: rotate(3deg); }
}

/* --- Utility Animation Classes --- */
.animate-float { animation: float 4s ease-in-out infinite; }
.animate-float-slow { animation: float-slow 6s ease-in-out infinite; }
.animate-pulse-soft { animation: pulse-soft 3s ease-in-out infinite; }
.animate-shimmer {
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}
.animate-glow { animation: glow 2s ease-in-out infinite; }
.animate-gentle-bounce { animation: gentle-bounce 2s ease-in-out infinite; }
.animate-icon-spin { animation: icon-spin-slow 8s linear infinite; }
.animate-icon-pulse { animation: icon-pulse-glow 2s ease-in-out infinite; }
.animate-wiggle { animation: wiggle 1s ease-in-out infinite; }
.animate-gradient {
    background-size: 200% 200%;
    animation: gradient-shift 4s ease infinite;
}

/* --- Staggered continuous delays --- */
.animate-float:nth-child(1) { animation-delay: 0s; }
.animate-float:nth-child(2) { animation-delay: 0.5s; }
.animate-float:nth-child(3) { animation-delay: 1s; }
.animate-float:nth-child(4) { animation-delay: 1.5s; }

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    .animate-on-scroll {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    .animate-float,
    .animate-float-slow,
    .animate-pulse-soft,
    .animate-shimmer,
    .animate-glow,
    .animate-gentle-bounce,
    .animate-icon-spin,
    .animate-icon-pulse,
    .animate-wiggle,
    .animate-gradient {
        animation: none !important;
    }
}

/* --- Animations Disabled by Admin --- */
.animations-disabled .animate-on-scroll {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
}

.animations-disabled .animate-float,
.animations-disabled .animate-float-slow,
.animations-disabled .animate-pulse-soft,
.animations-disabled .animate-shimmer,
.animations-disabled .animate-glow,
.animations-disabled .animate-gentle-bounce,
.animations-disabled .animate-icon-spin,
.animations-disabled .animate-icon-pulse,
.animations-disabled .animate-wiggle,
.animations-disabled .animate-gradient {
    animation: none !important;
}

/* --- Decorative Icon Wrapper --- */
.icon-decorative {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.icon-decorative::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: inherit;
    background: inherit;
    opacity: 0.15;
    filter: blur(8px);
    z-index: -1;
}

.icon-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-rounded {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* --- Counter Animation --- */
.counter-animated {
    display: inline-block;
}

/* --- Section Divider --- */
.section-divider {
    position: relative;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--primary-color, #047857), transparent);
    border-radius: 2px;
    margin: 2rem 0;
}

/* --- Scroll Indicator --- */
.scroll-indicator {
    animation: gentle-bounce 2s ease-in-out infinite;
}

/* --- Badge Pulse --- */
.badge-pulse {
    position: relative;
}

.badge-pulse::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    animation: pulse-soft 2s ease-in-out infinite;
    z-index: -1;
}

/* --- Text Gradient Animation --- */
.text-gradient-animated {
    background: linear-gradient(270deg, var(--primary-color, #047857), var(--secondary-color, #B8860B), var(--primary-color, #047857));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-shift 4s ease infinite;
}
