/*
=============================================
  ANIMATIONS.CSS - Premium Effects
=============================================
*/

/* ================================
   SCROLL REVEAL ANIMATIONS
   Elements with [data-animate] attribute will 
   fade in when scrolled into view
   ================================ */
[data-animate] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

[data-animate].animated {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delays for grids */
[data-animate-delay="1"] {
    transition-delay: 0.1s;
}

[data-animate-delay="2"] {
    transition-delay: 0.2s;
}

[data-animate-delay="3"] {
    transition-delay: 0.3s;
}

[data-animate-delay="4"] {
    transition-delay: 0.4s;
}

[data-animate-delay="5"] {
    transition-delay: 0.5s;
}

[data-animate-delay="6"] {
    transition-delay: 0.6s;
}

/* Different animation types */
[data-animate="fade-up"] {
    transform: translateY(40px);
}

[data-animate="fade-down"] {
    transform: translateY(-40px);
}

[data-animate="fade-left"] {
    transform: translateX(40px);
}

[data-animate="fade-right"] {
    transform: translateX(-40px);
}

[data-animate="zoom-in"] {
    transform: scale(0.9);
}

[data-animate="zoom-in"].animated {
    transform: scale(1);
}

/* ================================
   FLOATING ANIMATION
   ================================ */
@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

.float {
    animation: float 3s ease-in-out infinite;
}

/* ================================
   PULSE GLOW EFFECT
   ================================ */
@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 20px var(--primary-glow);
    }

    50% {
        box-shadow: 0 0 40px var(--primary-glow), 0 0 60px var(--primary-glow);
    }
}

.pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

/* ================================
   GRADIENT TEXT ANIMATION
   ================================ */
@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.text-gradient-animated {
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--primary));
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 4s ease infinite;
}

/* ================================
   BUTTON HOVER EFFECTS
   ================================ */
.btn-shine {
    position: relative;
    overflow: hidden;
}

.btn-shine::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;
}

.btn-shine:hover::before {
    left: 100%;
}

/* ================================
   CARD HOVER EFFECTS
   ================================ */
.card-hover-lift {
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.card-hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-2xl);
}

.card-hover-glow:hover {
    box-shadow: var(--shadow-glow);
}

/* ================================
   IMAGE HOVER ZOOM
   ================================ */
.img-zoom {
    overflow: hidden;
}

.img-zoom img {
    transition: transform 0.5s ease;
}

.img-zoom:hover img {
    transform: scale(1.1);
}

/* ================================
   PARALLAX BACKGROUND
   ================================ */
.parallax-bg {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Disable parallax on mobile for performance */
@media (max-width: 768px) {
    .parallax-bg {
        background-attachment: scroll;
    }
}

/* ================================
   GLASSMORPHISM
   ================================ */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-xl);
}

.glass-dark {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-light {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: var(--shadow-lg);
}

/* ================================
   HERO SCROLL INDICATOR
   ================================ */
@keyframes scroll-down {
    0% {
        opacity: 1;
        transform: translateY(0);
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 0;
        transform: translateY(15px);
    }
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    color: var(--white);
    opacity: 0.8;
    cursor: pointer;
    transition: opacity var(--transition-fast);
}

.scroll-indicator:hover {
    opacity: 1;
}

.scroll-indicator-icon {
    width: 30px;
    height: 50px;
    border: 2px solid currentColor;
    border-radius: 25px;
    position: relative;
}

.scroll-indicator-icon::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    width: 6px;
    height: 6px;
    margin-left: -3px;
    background: currentColor;
    border-radius: 50%;
    animation: scroll-down 1.5s ease-in-out infinite;
}

/* ================================
   LOADING SKELETON
   ================================ */
@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }

    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

/* ================================
   STAR RATING
   ================================ */
.stars {
    display: inline-flex;
    gap: 2px;
    color: var(--secondary);
}

.star {
    font-size: 1.25rem;
}

/* ================================
   COUNTER ANIMATION (for stats)
   ================================ */
.counter {
    display: inline-block;
}

/* ================================
   UNDERLINE ANIMATION
   ================================ */
.underline-hover {
    position: relative;
}

.underline-hover::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width var(--transition-base);
}

.underline-hover:hover::after {
    width: 100%;
}

/* ================================
   HAMBURGER MENU ANIMATION
   ================================ */
.hamburger {
    width: 32px;
    height: 24px;
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
    /* Reset button defaults */
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.hamburger span {
    display: block;
    height: 3px;
    width: 100%;
    background: var(--dark);
    border-radius: 3px;
    transition: all 0.3s ease;
    transform-origin: center;
}

/* Three horizontal lines for closed state */
.hamburger:not(.active) span:nth-child(1) {
    transform: none;
}

.hamburger:not(.active) span:nth-child(2) {
    opacity: 1;
    transform: none;
}

.hamburger:not(.active) span:nth-child(3) {
    transform: none;
}

/* X shape for open state */
.hamburger.active span {
    background: var(--dark);
}

.hamburger.active span:nth-child(1) {
    transform: translateY(10.5px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-10.5px) rotate(-45deg);
}

/* ================================
   MOBILE MENU SLIDE-IN
   ================================ */
.mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 80%;
    max-width: 400px;
    height: 100vh;
    background: var(--white);
    box-shadow: var(--shadow-2xl);
    transition: transform var(--transition-base);
    z-index: var(--z-modal);
    padding: var(--space-2xl);
    overflow-y: auto;
    transform: translateX(100%);
}

.mobile-menu.active {
    transform: translateX(0);
}

.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    z-index: var(--z-modal-backdrop);
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ================================
   LIGHTBOX
   ================================ */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    z-index: var(--z-modal);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox img {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius-md);
}

.lightbox-close {
    position: absolute;
    top: var(--space-xl);
    right: var(--space-xl);
    width: 50px;
    height: 50px;
    background: var(--white);
    border: none;
    border-radius: var(--radius-full);
    font-size: var(--text-2xl);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-fast);
}

.lightbox-close:hover {
    transform: rotate(90deg);
}

/* ================================
   REDUCED MOTION
   Respect user preference for reduced motion
   ================================ */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .scroll-indicator-icon::before {
        animation: none;
    }

    .parallax-bg {
        background-attachment: scroll;
    }
}