/* ============================================
   Sparkle Beauty Lounge - Animations
   ============================================ */

/* ============================================
   KEYFRAME ANIMATIONS
   ============================================ */

/* Spin Animation - For Loaders */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Pulse Animation - For Loading Text */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Bounce Animation - For Scroll Indicator */
@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0) translateX(-50%);
    }

    40% {
        transform: translateY(-20px) translateX(-50%);
    }

    60% {
        transform: translateY(-10px) translateX(-50%);
    }
}

/* Float Animation - For Badges */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale In Animation */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Slide In From Top */
@keyframes slideInFromTop {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Zoom In Animation */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Rotate In Animation */
@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-200deg) scale(0.5);
    }

    to {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

/* Shimmer Animation - For Highlights */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

/* Glow Animation - For Icons */
@keyframes glow {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(139, 95, 191, 0.5),
            0 0 10px rgba(139, 95, 191, 0.3);
    }

    50% {
        box-shadow: 0 0 20px rgba(139, 95, 191, 0.8),
            0 0 30px rgba(139, 95, 191, 0.5);
    }
}

/* Shake Animation - For Error States */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

/* Gradient Animation - For Background */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Sparkle Animation - For Special Effects */
@keyframes sparkle {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.3;
        transform: scale(0.8);
    }
}

/* Typing Animation - For Text Effects */
@keyframes typing {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

/* Blink Animation - For Cursor */
@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* ============================================
   UTILITY ANIMATION CLASSES
   ============================================ */

/* Fade In Utilities */
.fade-in {
    animation: fadeIn 0.6s ease-in-out;
}

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

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

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

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

/* Scale In */
.scale-in {
    animation: scaleIn 0.5s ease-in-out;
}

/* Zoom In */
.zoom-in {
    animation: zoomIn 0.5s ease-in-out;
}

/* Rotate In */
.rotate-in {
    animation: rotateIn 0.8s ease-in-out;
}

/* Animation 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;
}

/* ============================================
   HOVER ANIMATIONS
   ============================================ */

/* Grow on Hover */
.hover-grow {
    transition: transform 0.3s ease;
}

.hover-grow:hover {
    transform: scale(1.05);
}

/* Lift on Hover */
.hover-lift {
    transition: all 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Rotate on Hover */
.hover-rotate {
    transition: transform 0.3s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

/* Pulse on Hover */
.hover-pulse {
    transition: all 0.3s ease;
}

.hover-pulse:hover {
    animation: pulse 1s infinite;
}

/* Glow on Hover */
.hover-glow {
    transition: all 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(139, 95, 191, 0.6),
        0 0 30px rgba(139, 95, 191, 0.4);
}

/* Shine Effect on Hover */
.hover-shine {
    position: relative;
    overflow: hidden;
}

.hover-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;
}

.hover-shine:hover::before {
    left: 100%;
}

/* Underline on Hover */
.hover-underline {
    position: relative;
    text-decoration: none;
}

.hover-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, #8B5FBF 0%, #FF6B8B 100%);
    transition: width 0.3s ease;
}

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

/* ============================================
   LOADING ANIMATIONS
   ============================================ */

/* Three Dots Loading */
.loading-dots {
    display: inline-flex;
    align-items: center;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    margin: 0 3px;
    background: var(--primary);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

/* Spinner Loading */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(139, 95, 191, 0.3);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

    100% {
        width: 100%;
    }
}

.progress-animated {
    animation: progress 2s ease-in-out;
}

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */

/* Parallax Effect Class */
.parallax {
    transition: transform 0.5s ease-out;
}

/* Reveal on Scroll */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.6s ease-out;
}

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

/* ============================================
   BUTTON ANIMATIONS
   ============================================ */

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

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
}

/* Button Press Animation */
.btn-press {
    transition: all 0.1s ease;
}

.btn-press:active {
    transform: scale(0.95);
}

/* ============================================
   CARD ANIMATIONS
   ============================================ */

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

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

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

.card-front,
.card-back {
    backface-visibility: hidden;
}

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

/* Card Hover Lift */
.card-hover {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.card-hover:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

/* ============================================
   TEXT ANIMATIONS
   ============================================ */

/* Gradient Text Animation */
.text-gradient-animated {
    background: linear-gradient(270deg,
            #8B5FBF,
            #FF6B8B,
            #4ECDC4,
            #8B5FBF);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
}

/* Typewriter Effect */
.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--primary);
    white-space: nowrap;
    animation: typing 3s steps(40, end), blink 0.75s step-end infinite;
}

/* ============================================
   ENTRANCE ANIMATIONS
   ============================================ */

/* Slide In Animations */
.slide-in-top {
    animation: slideInFromTop 0.6s ease-out;
}

.slide-in-bottom {
    animation: slideInFromBottom 0.6s ease-out;
}

/* ============================================
   SPECIAL EFFECTS
   ============================================ */

/* 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 {
    animation: glitch 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
}

/* Neon Glow Effect */
.neon-glow {
    animation: glow 2s ease-in-out infinite;
}

/* Floating Animation */
.floating {
    animation: float 3s ease-in-out infinite;
}

/* ============================================
   TRANSITION UTILITIES
   ============================================ */

.transition-fast {
    transition: all 0.2s ease;
}

.transition-normal {
    transition: all 0.3s ease;
}

.transition-slow {
    transition: all 0.5s ease;
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */

/* GPU Acceleration for Smooth Animations */
.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* 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;
    }
}