/* ========================================
   MIXOLOGY MASTERS - ANIMATIONS
   Advanced Animations & Effects
   ======================================== */

/* Fade In Up */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

/* Fade In Down */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-down {
    animation: fadeInDown 0.6s ease forwards;
}

/* Fade In Left */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in-left {
    animation: fadeInLeft 0.6s ease forwards;
}

/* Fade In Right */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in-right {
    animation: fadeInRight 0.6s ease forwards;
}

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

.scale-in {
    animation: scaleIn 0.4s ease forwards;
}

/* Slide In Bottom */
@keyframes slideInBottom {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in-bottom {
    animation: slideInBottom 0.4s ease forwards;
}

/* Pulse */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.pulse {
    animation: pulse 2s ease infinite;
}

/* Glow Pulse */
@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 5px var(--color-primary-glow);
    }
    50% {
        box-shadow: 0 0 20px var(--color-primary-glow), 0 0 40px var(--color-primary-glow);
    }
}

.glow-pulse {
    animation: glowPulse 2s ease infinite;
}

/* Shimmer Effect */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.shimmer {
    background: linear-gradient(
        90deg,
        var(--color-bg-card) 25%,
        var(--color-bg-hover) 50%,
        var(--color-bg-card) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Float Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

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

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

.rotate {
    animation: rotate 2s linear infinite;
}

/* Shake */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s ease;
}

/* Heart Beat */
@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    14% { transform: scale(1.1); }
    28% { transform: scale(1); }
    42% { transform: scale(1.1); }
    70% { transform: scale(1); }
}

.heartbeat {
    animation: heartbeat 1s ease;
}

/* Bounce In */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.bounce-in {
    animation: bounceIn 0.6s ease forwards;
}

/* Flip In */
@keyframes flipIn {
    from {
        opacity: 0;
        transform: perspective(400px) rotateY(90deg);
    }
    to {
        opacity: 1;
        transform: perspective(400px) rotateY(0);
    }
}

.flip-in {
    animation: flipIn 0.6s ease forwards;
}

/* Stagger Animation Delays */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }

/* Recipe Card Hover Animation */
.recipe-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.recipe-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--color-primary);
}

.recipe-card:hover .recipe-image img {
    transform: scale(1.08);
}

/* Button Hover Effects */
.btn-primary,
.btn-secondary,
.btn-outline {
    position: relative;
    overflow: hidden;
}

.btn-primary::before,
.btn-secondary::before,
.btn-outline::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.btn-primary:hover::before,
.btn-secondary:hover::before,
.btn-outline:hover::before {
    width: 300px;
    height: 300px;
}

/* Link Underline Animation */
.link-underline {
    position: relative;
}

.link-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: width 0.3s ease;
}

.link-underline:hover::after {
    width: 100%;
}

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--color-bg-card) 25%,
        var(--color-bg-hover) 50%,
        var(--color-bg-card) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-title {
    height: 1.5em;
    width: 70%;
    margin-bottom: 0.75em;
}

.skeleton-image {
    aspect-ratio: 4/3;
    width: 100%;
}

.skeleton-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

/* Parallax Effect */
.parallax {
    transform: translateZ(0);
    will-change: transform;
}

/* Smooth Scroll Behavior */
html {
    scroll-behavior: smooth;
}

/* Focus States */
*:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Custom Selection */
::selection {
    background: var(--color-primary);
    color: var(--color-bg-primary);
}

/* Scroll Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Hover Lift Effect */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* Icon Spin on Hover */
.icon-spin:hover i {
    animation: rotate 0.5s ease;
}

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

.gradient-border {
    position: relative;
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg, var(--color-primary), var(--color-secondary), var(--color-primary));
    background-size: 200% 200%;
    border-radius: var(--radius-lg);
    z-index: -1;
    animation: gradientBorder 3s ease infinite;
}

/* Neon Glow Effect */
.neon-glow {
    box-shadow: 
        0 0 5px var(--color-primary),
        0 0 10px var(--color-primary),
        0 0 20px var(--color-primary),
        0 0 40px var(--color-primary);
}

/* Liquid Animation */
@keyframes liquid {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
}

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

/* Typing Cursor */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.typing-cursor::after {
    content: '|';
    animation: blink 1s infinite;
    color: var(--color-primary);
}

/* Confetti Animation */
@keyframes confetti {
    0% {
        opacity: 1;
        transform: translateY(0) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translateY(-100px) rotate(720deg);
    }
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    animation: confetti 1s ease-out forwards;
}

/* Success Check Animation */
@keyframes checkmark {
    0% {
        stroke-dashoffset: 100;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

.checkmark-circle {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: checkmark 0.5s ease forwards;
}

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

.ripple::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.3) 10%, transparent 10.01%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10, 10);
    opacity: 0;
    transition: transform 0.5s, opacity 1s;
}

.ripple:active::after {
    transform: scale(0, 0);
    opacity: 0.3;
    transition: 0s;
}

/* Magnetic Button Effect */
.magnetic {
    transition: transform 0.2s ease;
}

/* 3D Card Flip */
.flip-card {
    perspective: 1000px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

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

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
}

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

/* Wave Animation */
@keyframes wave {
    0%, 100% {
        transform: translateY(0);
    }
    25% {
        transform: translateY(-5px);
    }
    75% {
        transform: translateY(5px);
    }
}

.wave-text span {
    display: inline-block;
    animation: wave 1s ease infinite;
}

.wave-text span:nth-child(2) { animation-delay: 0.1s; }
.wave-text span:nth-child(3) { animation-delay: 0.2s; }
.wave-text span:nth-child(4) { animation-delay: 0.3s; }
.wave-text span:nth-child(5) { animation-delay: 0.4s; }

/* Progress Bar Animation */
@keyframes progress {
    from { width: 0; }
}

.progress-animate {
    animation: progress 1s ease forwards;
}

/* Count Up Animation */
@keyframes countUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.count-up {
    animation: countUp 0.5s ease forwards;
}

/* Notification Badge Pulse */
@keyframes badgePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(212, 168, 83, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(212, 168, 83, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(212, 168, 83, 0);
    }
}

.badge-pulse {
    animation: badgePulse 2s infinite;
}

/* Glass Morphism Effect */
.glass {
    background: rgba(26, 26, 40, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Aurora Background */
@keyframes aurora {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.aurora-bg {
    background: linear-gradient(
        -45deg,
        var(--color-bg-primary),
        var(--color-bg-secondary),
        var(--color-bg-card),
        var(--color-bg-hover)
    );
    background-size: 400% 400%;
    animation: aurora 15s ease infinite;
}
