/* ============================================
   MARICURE.EE - Animations Stylesheet
   3D Effects, Keyframes & Transitions
   ============================================ */

/* ============================================
   LOGO ASSEMBLY ANIMATION
   ============================================ */
@keyframes logoAssemble {
    0% {
        opacity: 0;
        transform: translate(var(--start-x, 0), var(--start-y, 0)) rotate(var(--start-rotate, 0deg));
    }
    100% {
        opacity: 1;
        transform: translate(0, 0) rotate(0deg);
    }
}

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

.logo-assembled {
    animation: logoFloat 3s ease-in-out infinite;
}

/* ============================================
   3D ABSTRACT NAIL ANIMATIONS
   ============================================ */
@keyframes nailFloat {
    0%, 100% {
        transform: translate3d(0, 0, 0) rotateX(0deg) rotateY(0deg);
    }
    25% {
        transform: translate3d(10px, -15px, 0) rotateX(5deg) rotateY(5deg);
    }
    50% {
        transform: translate3d(-5px, 10px, 0) rotateX(-5deg) rotateY(-5deg);
    }
    75% {
        transform: translate3d(15px, 5px, 0) rotateX(3deg) rotateY(-3deg);
    }
}

@keyframes nailGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(212, 175, 55, 0.2),
                    inset 0 0 20px rgba(212, 175, 55, 0.1);
    }
    50% {
        box-shadow: 0 0 40px rgba(212, 175, 55, 0.4),
                    inset 0 0 30px rgba(212, 175, 55, 0.2);
    }
}

.abstract-nail {
    animation: nailFloat 8s ease-in-out infinite,
               nailGlow 4s ease-in-out infinite;
}

.abstract-nail:nth-child(1) { animation-delay: 0s, 0s; }
.abstract-nail:nth-child(2) { animation-delay: 0.5s, 0.3s; }
.abstract-nail:nth-child(3) { animation-delay: 1s, 0.6s; }
.abstract-nail:nth-child(4) { animation-delay: 1.5s, 0.9s; }
.abstract-nail:nth-child(5) { animation-delay: 2s, 1.2s; }
.abstract-nail:nth-child(6) { animation-delay: 2.5s, 1.5s; }
.abstract-nail:nth-child(7) { animation-delay: 3s, 1.8s; }

/* Mouse-based 3D rotation */
.abstract-nail[data-depth="1"] {
    transition: transform 0.3s ease-out;
}

.abstract-nail[data-depth="2"] {
    transition: transform 0.4s ease-out;
}

.abstract-nail[data-depth="3"] {
    transition: transform 0.5s ease-out;
}

/* Scroll-based rotation */
.abstract-nail.scrolled {
    transform: rotateZ(180deg) rotateX(360deg);
}

/* ============================================
   FADE IN ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }
    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 fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animation classes for scroll trigger */
.animate-fade-in-up {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

.animate-fade-in-down {
    opacity: 0;
    animation: fadeInDown 0.8s ease-out forwards;
}

.animate-fade-in-left {
    opacity: 0;
    animation: fadeInLeft 0.8s ease-out forwards;
}

.animate-fade-in-right {
    opacity: 0;
    animation: fadeInRight 0.8s ease-out forwards;
}

.animate-fade-in-scale {
    opacity: 0;
    animation: fadeInScale 0.8s ease-out forwards;
}

/* Staggered delays */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }
.delay-1000 { animation-delay: 1s; }

/* ============================================
   GLOW EFFECTS
   ============================================ */
@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(212, 175, 55, 0.3),
                    0 0 40px rgba(212, 175, 55, 0.1),
                    0 0 60px rgba(212, 175, 55, 0.05);
    }
    50% {
        box-shadow: 0 0 40px rgba(212, 175, 55, 0.5),
                    0 0 80px rgba(212, 175, 55, 0.3),
                    0 0 120px rgba(212, 175, 55, 0.15);
    }
}

@keyframes textGlow {
    0%, 100% {
        text-shadow: 0 0 10px rgba(212, 175, 55, 0.5),
                     0 0 20px rgba(212, 175, 55, 0.3),
                     0 0 30px rgba(212, 175, 55, 0.1);
    }
    50% {
        text-shadow: 0 0 20px rgba(212, 175, 55, 0.8),
                     0 0 40px rgba(212, 175, 55, 0.5),
                     0 0 60px rgba(212, 175, 55, 0.3);
    }
}

.glow-effect {
    animation: glowPulse 3s ease-in-out infinite;
}

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

/* ============================================
   SHIMMER EFFECT
   ============================================ */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.shimmer {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

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

@keyframes rotateY360 {
    from {
        transform: perspective(1000px) rotateY(0deg);
    }
    to {
        transform: perspective(1000px) rotateY(360deg);
    }
}

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

.rotate-y-360 {
    animation: rotateY360 10s ease-in-out infinite;
}

/* ============================================
   SCALE ANIMATIONS
   ============================================ */
@keyframes scalePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes scaleBounce {
    0%, 100% {
        transform: scale(1);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }
    50% {
        transform: scale(1.1);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

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

.scale-bounce {
    animation: scaleBounce 1s ease-in-out infinite;
}

/* ============================================
   SLIDE ANIMATIONS
   ============================================ */
@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideLeft {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

.slide-up {
    animation: slideUp 0.6s ease-out forwards;
}

.slide-down {
    animation: slideDown 0.6s ease-out forwards;
}

.slide-left {
    animation: slideLeft 0.6s ease-out forwards;
}

.slide-right {
    animation: slideRight 0.6s ease-out forwards;
}

/* ============================================
   BOUNCE ANIMATIONS
   ============================================ */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }
    50% {
        transform: translateY(-20px);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
    100% {
        transform: scale(1);
    }
}

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

.bounce-in {
    animation: bounceIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

/* ============================================
   FLIP ANIMATIONS
   ============================================ */
@keyframes flipX {
    from {
        transform: perspective(1000px) rotateX(90deg);
        opacity: 0;
    }
    to {
        transform: perspective(1000px) rotateX(0deg);
        opacity: 1;
    }
}

@keyframes flipY {
    from {
        transform: perspective(1000px) rotateY(90deg);
        opacity: 0;
    }
    to {
        transform: perspective(1000px) rotateY(0deg);
        opacity: 1;
    }
}

.flip-x {
    animation: flipX 0.8s ease-out forwards;
}

.flip-y {
    animation: flipY 0.8s ease-out forwards;
}

/* Card flip on hover */
.flip-card {
    perspective: 1000px;
}

.flip-card-inner {
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

/* ============================================
   TILT EFFECT (3D Card)
   ============================================ */
.tilt-card {
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
}

.tilt-card__content {
    transform: translateZ(20px);
}

/* ============================================
   PARTICLE ANIMATIONS
   ============================================ */
@keyframes particleFloat {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx, 100px), var(--ty, -100px)) rotate(360deg);
        opacity: 0;
    }
}

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

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

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-bg-tertiary);
    border-top-color: var(--color-gold-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ============================================
   RIPPLE EFFECT
   ============================================ */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.6);
    animation: ripple 0.6s ease-out;
    pointer-events: none;
}

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

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

.typing-effect {
    overflow: hidden;
    border-right: 2px solid var(--color-gold-primary);
    white-space: nowrap;
    animation: typing 3s steps(30) forwards,
               blink 0.8s step-end infinite;
}

/* ============================================
   GRADIENT ANIMATIONS
   ============================================ */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.gradient-animated {
    background: linear-gradient(
        -45deg,
        var(--color-gold-dark),
        var(--color-gold-primary),
        var(--color-gold-light),
        var(--color-gold-primary)
    );
    background-size: 400% 400%;
    animation: gradientShift 3s ease infinite;
}

/* ============================================
   FLOATING LABELS
   ============================================ */
@keyframes floatLabel {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.float-label {
    animation: floatLabel 3s ease-in-out infinite;
}

/* ============================================
   PROGRESS BAR
   ============================================ */
@keyframes progressFill {
    from {
        width: 0;
    }
}

.progress-bar {
    height: 4px;
    background: var(--gradient-gold);
    animation: progressFill 2s ease-out forwards;
}

/* ============================================
   MODAL ANIMATIONS
   ============================================ */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-slide-in {
    animation: modalSlideIn 0.3s ease-out forwards;
}

@keyframes modalFadeOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
}

.modal-fade-out {
    animation: modalFadeOut 0.3s ease-in forwards;
}

/* ============================================
   SCROLL REVEAL ANIMATIONS
   ============================================ */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease-out;
}

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

.reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s ease-out;
}

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

.reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s ease-out;
}

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

/* ============================================
   HOVER LIFT EFFECT
   ============================================ */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-gold);
}

/* ============================================
   BORDER ANIMATIONS
   ============================================ */
@keyframes borderDraw {
    from {
        clip-path: inset(0 100% 0 0);
    }
    to {
        clip-path: inset(0 0 0 0);
    }
}

.border-draw {
    position: relative;
}

.border-draw::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid var(--color-gold-primary);
    clip-path: inset(0 100% 0 0);
    animation: borderDraw 0.5s ease-out forwards;
}

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

.counter {
    display: inline-block;
    animation: countUp 1s ease-out forwards;
}

/* ============================================
   IMAGE REVEAL
   ============================================ */
@keyframes imageReveal {
    from {
        clip-path: inset(0 100% 0 0);
    }
    to {
        clip-path: inset(0 0 0 0);
    }
}

.image-reveal {
    animation: imageReveal 1s ease-out forwards;
}

/* ============================================
   GLITCH EFFECT
   ============================================ */
@keyframes glitch {
    0% {
        transform: translate(0);
    }
    20% {
        transform: translate(-2px, 2px);
    }
    40% {
        transform: translate(-2px, -2px);
    }
    60% {
        transform: translate(2px, 2px);
    }
    80% {
        transform: translate(2px, -2px);
    }
    100% {
        transform: translate(0);
    }
}

.glitch:hover {
    animation: glitch 0.3s ease-in-out;
}

/* ============================================
   PARALLAX LAYERS
   ============================================ */
.parallax-layer {
    transition: transform 0.1s ease-out;
}

.parallax-layer[data-speed="0.2"] {
    transform: translateZ(-50px) scale(1.5);
}

.parallax-layer[data-speed="0.5"] {
    transform: translateZ(-25px) scale(1.25);
}

.parallax-layer[data-speed="1"] {
    transform: translateZ(0);
}

/* ============================================
   SKELETON LOADING
   ============================================ */
@keyframes skeleton-loading {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton {
    background: linear-gradient(
        90deg,
        var(--color-bg-tertiary) 0px,
        var(--color-bg-glass) 40px,
        var(--color-bg-tertiary) 80px
    );
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

/* ============================================
   TRANSITION UTILITIES
   ============================================ */
.transition-all {
    transition: all var(--transition-base);
}

.transition-transform {
    transition: transform var(--transition-base);
}

.transition-opacity {
    transition: opacity var(--transition-base);
}

.transition-colors {
    transition: color var(--transition-base),
                background-color var(--transition-base),
                border-color var(--transition-base);
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */
.will-animate {
    will-change: transform, opacity;
}

.no-animation {
    animation: none !important;
    transition: none !important;
}

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