/* ========================================
   Simple Head Drive - Animations
   Smooth, Performance-optimized Animations
   ======================================== */

/* ========================================
   Keyframe Animations
   ======================================== */

/* Float Animation - For Logo */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Pulse Animation - For Background Elements */
@keyframes pulse {
    0%, 100% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* Bounce Animation - For Scroll Indicator */
@keyframes bounce {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(10px);
    }
}

/* Fade In */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Fade In Up */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Down */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Left */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade In Right */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale In */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Slide In Bottom */
@keyframes slideInBottom {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Glow Pulse */
@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(220, 0, 0, 0.5);
    }
    50% {
        box-shadow: 0 0 40px rgba(220, 0, 0, 0.8);
    }
}

/* Rotate */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Shimmer */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* ========================================
   Animation Classes
   ======================================== */

/* Fade In */
.fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

/* Fade In Up */
.fade-in-up {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

/* Fade In Down */
.fade-in-down {
    opacity: 0;
    animation: fadeInDown 0.8s ease-out forwards;
}

/* Fade In Left */
.fade-in-left {
    opacity: 0;
    animation: fadeInLeft 0.8s ease-out forwards;
}

/* Fade In Right */
.fade-in-right {
    opacity: 0;
    animation: fadeInRight 0.8s ease-out forwards;
}

/* Scale In */
.scale-in {
    opacity: 0;
    animation: scaleIn 0.6s ease-out forwards;
}

/* ========================================
   Scroll-triggered Animations
   ======================================== */

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   Hover Effects
   ======================================== */

/* Lift on Hover */
.lift-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.lift-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* Scale on Hover */
.scale-hover {
    transition: transform 0.3s ease;
}

.scale-hover:hover {
    transform: scale(1.05);
}

/* Glow on Hover */
.glow-hover {
    transition: box-shadow 0.3s ease;
}

.glow-hover:hover {
    box-shadow: 0 0 20px rgba(220, 0, 0, 0.6);
}

/* ========================================
   Loading & Spinner Animations
   ======================================== */

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--ferrari-red);
    border-radius: 50%;
    animation: rotate 1s linear infinite;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 25%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 75%
    );
    background-size: 2000px 100%;
    animation: shimmer 2s infinite linear;
}

/* ========================================
   Transition Effects
   ======================================== */

/* Smooth Transitions */
.transition-all {
    transition: all 0.3s ease;
}

.transition-fast {
    transition: all 0.15s ease;
}

.transition-slow {
    transition: all 0.5s ease;
}

/* Transform Origin */
.transform-center {
    transform-origin: center;
}

/* ========================================
   Page Transitions
   ======================================== */

/* Page Load Animation */
.page-enter {
    animation: fadeIn 0.5s ease-out;
}

/* Section Reveal */
.section-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.section-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   Text Animations
   ======================================== */

/* Text Gradient Animation */
.text-gradient-animate {
    background: linear-gradient(
        90deg,
        #ffffff 0%,
        var(--ferrari-red) 25%,
        var(--accent-blue) 50%,
        var(--ferrari-red) 75%,
        #ffffff 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
}

/* Typing Effect */
.typing {
    overflow: hidden;
    border-right: 2px solid var(--ferrari-red);
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink 0.75s step-end infinite;
}

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: var(--ferrari-red);
    }
}

/* ========================================
   Particle Effects
   ======================================== */

/* Floating Particles */
.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.particle-1 {
    animation: float 6s ease-in-out infinite;
}

.particle-2 {
    animation: float 8s ease-in-out infinite reverse;
}

.particle-3 {
    animation: float 10s ease-in-out infinite;
}

/* ========================================
   Button Animations
   ======================================== */

/* Ripple Effect */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-ripple:active::after {
    width: 300px;
    height: 300px;
}

/* Button Pulse */
.btn-pulse {
    animation: glowPulse 2s ease-in-out infinite;
}

/* ========================================
   Scroll Progress Bar
   ======================================== */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--ferrari-red) 0%, var(--accent-blue) 100%);
    z-index: 9999;
    transform-origin: left;
    transition: transform 0.1s ease;
}

/* ========================================
   Performance Optimizations
   ======================================== */

/* Use will-change for better performance */
.will-animate {
    will-change: transform, opacity;
}

/* 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;
    }

    .fade-in,
    .fade-in-up,
    .fade-in-down,
    .fade-in-left,
    .fade-in-right,
    .scale-in {
        opacity: 1;
        transform: none;
    }

    .hero-logo {
        animation: none;
    }

    .scroll-indicator {
        animation: none;
    }
}

/* ========================================
   Staggered Animations
   ======================================== */

/* For use with JavaScript to stagger child animations */
.stagger-children > * {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.6s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.7s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.8s; }

/* ========================================
   Coffee Button Animation
   ======================================== */

/* Subtle pulse animation for coffee button */
@keyframes coffee-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow:
            0 8px 20px rgba(255, 107, 53, 0.4),
            0 4px 10px rgba(0, 0, 0, 0.3);
    }
    50% {
        transform: scale(1.03);
        box-shadow:
            0 10px 25px rgba(255, 107, 53, 0.5),
            0 5px 12px rgba(0, 0, 0, 0.35);
    }
}
