/* ===== MICRO-INTERACTIONS AND ANIMATIONS STYLES ===== */

/* Scroll Animations */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animations for children elements */
.scroll-animate.visible .stagger-item {
    opacity: 0;
    transform: translateY(20px);
    animation: staggerFadeIn 0.5s ease-out forwards;
}

.scroll-animate.visible .stagger-item:nth-child(1) { animation-delay: 0.1s; }
.scroll-animate.visible .stagger-item:nth-child(2) { animation-delay: 0.2s; }
.scroll-animate.visible .stagger-item:nth-child(3) { animation-delay: 0.3s; }
.scroll-animate.visible .stagger-item:nth-child(4) { animation-delay: 0.4s; }
.scroll-animate.visible .stagger-item:nth-child(5) { animation-delay: 0.5s; }
.scroll-animate.visible .stagger-item:nth-child(6) { animation-delay: 0.6s; }
.scroll-animate.visible .stagger-item:nth-child(7) { animation-delay: 0.7s; }
.scroll-animate.visible .stagger-item:nth-child(8) { animation-delay: 0.8s; }

@keyframes staggerFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Button Hover Effects */
.btn-hover-effect {
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.btn-hover-effect::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.7s;
}

.btn-hover-effect:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.btn-hover-effect:hover::before {
    left: 100%;
}

.btn-hover-effect:active {
    transform: translateY(-1px);
}

/* Pulse Animation */
.pulse {
    animation: pulse 2s infinite;
}

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

/* Shake Animation */
.shake {
    animation: shake 0.82s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% {
        transform: translate3d(-1px, 0, 0);
    }
    
    20%, 80% {
        transform: translate3d(2px, 0, 0);
    }
    
    30%, 50%, 70% {
        transform: translate3d(-4px, 0, 0);
    }
    
    40%, 60% {
        transform: translate3d(4px, 0, 0);
    }
}

/* Bounce Animation */
.bounce {
    animation: bounce 1s;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

/* Fade In Animation */
.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

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

/* Fade In Up Animation */
.fade-in-up {
    animation: fadeInUp 0.5s ease-out forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Down Animation */
.fade-in-down {
    animation: fadeInDown 0.5s ease-out forwards;
}

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

/* Fade In Left Animation */
.fade-in-left {
    animation: fadeInLeft 0.5s ease-out forwards;
}

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

/* Fade In Right Animation */
.fade-in-right {
    animation: fadeInRight 0.5s ease-out forwards;
}

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

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

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

/* Zoom Out Animation */
.zoom-out {
    animation: zoomOut 0.5s ease-out forwards;
}

@keyframes zoomOut {
    from {
        opacity: 0;
        transform: scale(1.1);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Rotate Animation */
.rotate {
    animation: rotate 0.5s ease-out forwards;
}

@keyframes rotate {
    from {
        opacity: 0;
        transform: rotate(-10deg);
    }
    to {
        opacity: 1;
        transform: rotate(0);
    }
}

/* Float Animation */
.float {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0);
    }
}

/* Progress Bar */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background-color: var(--primary);
    z-index: var(--z-sticky);
    width: 0;
    transition: width 0.3s ease;
}

/* Custom Cursor */
.custom-cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    border-radius: var(--radius-circle);
    background-color: rgba(248, 165, 194, 0.3);
    border: 1px solid var(--primary);
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: var(--z-tooltip);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
    display: none;
}

@media (min-width: 1024px) {
    .custom-cursor {
        display: block;
    }
}

.custom-cursor.active {
    width: 16px;
    height: 16px;
    background-color: var(--primary);
}

/* Hover Card Effect */
.hover-card {
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

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

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

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background-color: rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-circle);
    transform: translate(-50%, -50%);
    opacity: 0;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
    opacity: 1;
    transition: width 0.6s, height 0.6s, opacity 0.6s;
}

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

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

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

/* Scale Effect */
.scale-effect {
    transition: transform var(--transition-normal);
}

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

/* Rotate Effect */
.rotate-effect {
    transition: transform var(--transition-normal);
}

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

/* Tilt Effect */
.tilt-effect {
    transition: transform var(--transition-normal);
    transform-style: preserve-3d;
}

.tilt-effect:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(5deg);
}

/* Glow Effect */
.glow-effect {
    transition: box-shadow var(--transition-normal);
}

.glow-effect:hover {
    box-shadow: 0 0 15px var(--primary-light);
}

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

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

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

/* Loading Spinner */
.loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(248, 165, 194, 0.3);
    border-radius: var(--radius-circle);
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-300) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Responsive adjustments */
@media (prefers-reduced-motion: reduce) {
    .scroll-animate,
    .stagger-item,
    .btn-hover-effect,
    .pulse,
    .shake,
    .bounce,
    .fade-in,
    .fade-in-up,
    .fade-in-down,
    .fade-in-left,
    .fade-in-right,
    .zoom-in,
    .zoom-out,
    .rotate,
    .float {
        animation: none !important;
        transition: none !important;
        transform: none !important;
        opacity: 1 !important;
    }
}