/* ============================================
   TILDA PARFUMS BAMENDA — Animations & Transitions
   ============================================ */

/* === Page Entrance Animations === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

/* === Reveal Animation Classes === */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-right.visible {
    opacity: 1;
    transform: translateX(0);
}

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

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

/* Stagger children */
.stagger-children > * {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.stagger-children.visible > *:nth-child(1) { transition-delay: 0s; }
.stagger-children.visible > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-children.visible > *:nth-child(3) { transition-delay: 0.2s; }
.stagger-children.visible > *:nth-child(4) { transition-delay: 0.3s; }
.stagger-children.visible > *:nth-child(5) { transition-delay: 0.4s; }
.stagger-children.visible > *:nth-child(6) { transition-delay: 0.5s; }
.stagger-children.visible > *:nth-child(7) { transition-delay: 0.6s; }
.stagger-children.visible > *:nth-child(8) { transition-delay: 0.7s; }

.stagger-children.visible > * {
    opacity: 1;
    transform: translateY(0);
}

/* === Hero Animations === */
.hero-animate .hero-label {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

.hero-animate .hero-title {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.4s both;
}

.hero-animate .hero-desc {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.6s both;
}

.hero-animate .hero-actions {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.8s both;
}

.hero-animate .hero-float {
    animation: fadeInRight 1s cubic-bezier(0.16, 1, 0.3, 1) 0.5s both;
}

.hero-animate .scroll-indicator {
    animation: fadeIn 1s ease 1.5s both;
}

/* === Floating / Hovering === */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}

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

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

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

/* === Pulse Effects === */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes pulseGold {
    0%, 100% { box-shadow: 0 0 0 0 rgba(201, 169, 110, 0.4); }
    50% { box-shadow: 0 0 0 15px rgba(201, 169, 110, 0); }
}

@keyframes pulseRing {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

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

/* === Rotate === */
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

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

/* === Shimmer / Glitter Effect === */
@keyframes goldShimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.gold-shimmer {
    background: var(--gold-shimmer);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: goldShimmer 4s ease-in-out infinite;
}

/* === Particle / Sparkle Effects === */
@keyframes sparkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: scale(1) rotate(180deg);
    }
}

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

.sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--gold);
    border-radius: 50%;
    animation: sparkle 2s ease-in-out infinite;
    pointer-events: none;
}

/* === Gradient Border Animation === */
@keyframes gradientBorder {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.animated-border {
    position: relative;
}

.animated-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(
        45deg,
        var(--gold-dark),
        var(--gold),
        var(--gold-bright),
        var(--gold),
        var(--gold-dark)
    );
    background-size: 300% 300%;
    animation: gradientBorder 4s ease infinite;
    z-index: -1;
}

/* === Marquee / Ticker === */
@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.marquee {
    display: flex;
    overflow: hidden;
    white-space: nowrap;
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
    padding: var(--space-lg) 0;
}

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

.marquee-item {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
    padding: 0 var(--space-2xl);
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.marquee-item .dot {
    width: 6px;
    height: 6px;
    background: var(--gold);
    border-radius: 50%;
    flex-shrink: 0;
}

/* === Page Transition === */
.page-transition {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    z-index: 9998;
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.6s cubic-bezier(0.77, 0, 0.175, 1);
}

.page-transition.active {
    transform: scaleY(1);
    transform-origin: top;
}

/* === Counter Animation === */
.counter {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 600;
    color: var(--gold);
}

/* === Image Reveal === */
.image-reveal {
    position: relative;
    overflow: hidden;
}

.image-reveal::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--bg-primary);
    z-index: 1;
    transform: scaleX(1);
    transform-origin: right;
    transition: transform 1s cubic-bezier(0.77, 0, 0.175, 1);
}

.image-reveal.visible::before {
    transform: scaleX(0);
    transform-origin: left;
}

/* === Text Split Animation === */
.text-reveal {
    overflow: hidden;
    display: inline-block;
}

.text-reveal-inner {
    display: inline-block;
    transform: translateY(100%);
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.text-reveal.visible .text-reveal-inner {
    transform: translateY(0);
}

/* === Magnetic Button Effect (via JS) === */
.magnetic-btn {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* === Parallax Layers === */
.parallax-container {
    position: relative;
    overflow: hidden;
}

.parallax-layer {
    will-change: transform;
    transition: transform 0.1s linear;
}

/* === Cursor Trail (CSS part) === */
.cursor-dot {
    position: fixed;
    width: 8px;
    height: 8px;
    background: var(--gold);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.15s ease, width 0.3s ease, height 0.3s ease;
    mix-blend-mode: difference;
}

.cursor-dot.expanded {
    width: 40px;
    height: 40px;
    background: rgba(201, 169, 110, 0.2);
    border: 1px solid var(--gold);
}

/* === Scroll Progress Bar === */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    background: var(--gold-gradient);
    z-index: 1001;
    transition: width 0.1s linear;
    width: 0%;
}

/* === Hover Underline Animation === */
.hover-underline {
    position: relative;
    display: inline-block;
}

.hover-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.hover-underline:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* === Card Tilt (placeholder for JS) === */
.tilt-card {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transform-style: preserve-3d;
    perspective: 1000px;
}

/* === Ripple Effect === */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(201, 169, 110, 0.3);
    transform: scale(0);
    animation: rippleAnim 0.6s ease-out;
    pointer-events: none;
}

@keyframes rippleAnim {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* === Glow Effect === */
.glow-on-hover {
    transition: box-shadow var(--transition-base);
}

.glow-on-hover:hover {
    box-shadow: 0 0 30px rgba(201, 169, 110, 0.2),
                0 0 60px rgba(201, 169, 110, 0.1);
}

/* === Noise Texture Overlay === */
.noise-overlay::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9990;
    opacity: 0.4;
}

/* === Loading Dots === */
.loading-dots {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
}

.loading-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gold);
    animation: loadingDot 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(1) { animation-delay: 0s; }
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes loadingDot {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* === Number Ticker === */
@keyframes countUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === Accordion Animations === */
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                padding 0.3s ease;
}

.accordion-item.active .accordion-content {
    max-height: 500px;
}

.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) 0;
    cursor: pointer;
    border-bottom: 1px solid var(--border-subtle);
    transition: color var(--transition-fast);
}

.accordion-header:hover {
    color: var(--gold);
}

.accordion-icon {
    width: 24px;
    height: 24px;
    transition: transform var(--transition-base);
    color: var(--gold);
}

.accordion-item.active .accordion-icon {
    transform: rotate(45deg);
}

/* === Smooth Image Loading === */
.lazy-image {
    opacity: 0;
    transition: opacity 0.6s ease;
}

.lazy-image.loaded {
    opacity: 1;
}

/* === Notification Bell === */
@keyframes bellShake {
    0%, 100% { transform: rotate(0); }
    15% { transform: rotate(15deg); }
    30% { transform: rotate(-10deg); }
    45% { transform: rotate(10deg); }
    60% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

.bell-animation {
    animation: bellShake 0.8s ease-in-out;
}

/* === Typing Animation === */
@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    from, to { border-color: transparent; }
    50% { border-color: var(--gold); }
}

.typing-text {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--gold);
    animation: typing 3.5s steps(40, end),
               blink 0.75s step-end infinite;
}

/* === Morphing background === */
@keyframes morphBg {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
}

.morph-bg {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(201, 169, 110, 0.15), transparent);
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    animation: morphBg 8s ease-in-out infinite;
    position: absolute;
    filter: blur(40px);
    pointer-events: none;
}

/* === Stacking Cards Effect === */
.stack-cards {
    position: relative;
}

.stack-cards > * {
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* === Smooth scroll snap sections === */
.snap-container {
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
    height: 100vh;
}

.snap-section {
    scroll-snap-align: start;
    min-height: 100vh;
}

/* === Reduced motion === */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reveal,
    .reveal-left,
    .reveal-right,
    .reveal-scale,
    .stagger-children > * {
        opacity: 1;
        transform: none;
    }
}
