/**
 * ═══════════════════════════════════════════════════════════════════════════
 * SA ĐÉC MARKETING HUB - UI ENHANCEMENTS BUNDLE 2026
 * Micro-animations, Loading States, Hover Effects
 *
 * Categories:
 * 1. Expressive Button Animations
 * 2. Card Hover Effects
 * 3. Scroll-triggered Animations
 * 4. Loading States & Skeleton
 * 5. Success/Error Animations
 * 6. Accessibility (Reduced Motion)
 * ═══════════════════════════════════════════════════════════════════════════
 */

/* ═══════════════════════════════════════════════════════════════════════════
   1. EXPRESSIVE BUTTON ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════ */

/* Primary Button - Shine Sweep + Lift */
.btn-expressive-primary {
    position: relative;
    overflow: hidden;
    transition:
        transform 0.3s cubic-bezier(0.2, 0, 0, 1),
        box-shadow 0.3s cubic-bezier(0.2, 0, 0, 1);
}

.btn-expressive-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.5s ease;
    z-index: 1;
}

.btn-expressive-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 106, 96, 0.4);
}

.btn-expressive-primary:hover::before {
    left: 150%;
}

/* Secondary Button - Pulse Glow */
.btn-expressive-secondary {
    position: relative;
    transition:
        transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-expressive-secondary:hover {
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(156, 104, 0, 0.3);
}

/* Icon Button - Rotate */
.btn-icon-expressive {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.btn-icon-expressive:hover {
    transform: rotate(15deg) scale(1.1);
}

/* Text Button - Background Fill */
.btn-text-expressive {
    position: relative;
    overflow: hidden;
    transition: color 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-text-expressive::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 106, 96, 0.1);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
    border-radius: inherit;
}

.btn-text-expressive:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Button Loading State */
.btn-loading-expressive {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading-expressive::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    animation: spin 0.6s linear infinite;
    color: var(--md-sys-color-on-primary, white);
}

/* ═══════════════════════════════════════════════════════════════════════════
   2. CARD HOVER EFFECTS
   ═══════════════════════════════════════════════════════════════════════════ */

/* Service Card - Lift + Shimmer */
.card-service-expressive {
    position: relative;
    overflow: hidden;
    transition:
        transform 0.3s cubic-bezier(0.2, 0, 0, 1),
        box-shadow 0.3s cubic-bezier(0.2, 0, 0, 1);
}

.card-service-expressive::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transition: left 0.6s ease;
    z-index: 1;
    pointer-events: none;
}

.card-service-expressive:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 20px 60px rgba(0, 106, 96, 0.2);
}

.card-service-expressive:hover::before {
    left: 100%;
}

/* Pricing Card - Glow Border */
.card-pricing-expressive {
    position: relative;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-pricing-expressive::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(
        135deg,
        rgba(156, 104, 0, 0.5),
        transparent 50%,
        rgba(255, 193, 7, 0.5)
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.card-pricing-expressive:hover {
    transform: translateY(-4px);
}

.card-pricing-expressive:hover::before {
    opacity: 1;
}

/* Testimonial Card - Lift + Tilt */
.card-testimonial-expressive {
    transition:
        transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-testimonial-expressive:hover {
    transform: translateY(-3px) rotateX(2deg);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

/* Case Study Card - Image Zoom */
.card-case-study {
    overflow: hidden;
}

.card-case-study .card-image {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-case-study:hover .card-image {
    transform: scale(1.05);
}

/* ═══════════════════════════════════════════════════════════════════════════
   3. SCROLL-TRIGGERED ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════ */

/* Base Reveal Classes */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition:
        opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Direction Variants */
.reveal-from-left {
    opacity: 0;
    transform: translateX(-50px);
    transition:
        opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.reveal-from-right {
    opacity: 0;
    transform: translateX(50px);
    transition:
        opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.scale-in-on-scroll {
    opacity: 0;
    transform: scale(0.9);
    transition:
        opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.scale-in-on-scroll.visible {
    opacity: 1;
    transform: scale(1);
}

/* Stagger Delays */
.stagger-delay-1 { transition-delay: 0ms; }
.stagger-delay-2 { transition-delay: 100ms; }
.stagger-delay-3 { transition-delay: 200ms; }
.stagger-delay-4 { transition-delay: 300ms; }
.stagger-delay-5 { transition-delay: 400ms; }

/* ═══════════════════════════════════════════════════════════════════════════
   4. LOADING STATES & SKELETON
   ═══════════════════════════════════════════════════════════════════════════ */

/* Page Loader */
.page-loader {
    position: fixed;
    inset: 0;
    background: var(--md-sys-color-surface, white);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease-out;
}

.page-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Modern Spinner */
.spinner-modern {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(0, 106, 96, 0.2);
    border-top-color: #006A60;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-modern.sm { width: 24px; height: 24px; border-width: 2px; }
.spinner-modern.md { width: 36px; height: 36px; }
.spinner-modern.lg { width: 64px; height: 64px; border-width: 4px; }

/* Pulsing Spinner */
.spinner-pulse {
    border: 3px solid transparent;
    border-top-color: #006A60;
    animation:
        spin 0.8s linear infinite,
        spinnerPulse 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes spinnerPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
}

/* Loading Dots */
.loading-dots {
    display: flex;
    gap: 6px;
    justify-content: center;
    align-items: center;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #006A60;
    animation: pulse 1.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

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

@keyframes pulse {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* Skeleton Loaders */
.skeleton-base {
    background: linear-gradient(
        90deg,
        rgba(200, 200, 200, 0.3) 25%,
        rgba(220, 220, 220, 0.5) 50%,
        rgba(200, 200, 200, 0.3) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}

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

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

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 12px;
}

.skeleton-text {
    height: 16px;
    width: 100%;
    margin-bottom: 8px;
}

.skeleton-text-short {
    width: 75%;
}

.skeleton-card {
    height: 200px;
    width: 100%;
    border-radius: 12px;
}

.skeleton-image {
    height: 160px;
    width: 100%;
    border-radius: 8px;
    margin-bottom: 12px;
}

/* Progress Bar */
.progress-linear {
    width: 100%;
    height: 4px;
    background: rgba(0, 106, 96, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.progress-linear.indeterminate::after {
    content: '';
    position: absolute;
    height: 100%;
    width: 30%;
    background: #006A60;
    border-radius: 2px;
    animation: progress-indeterminate 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.progress-linear-bar {
    position: relative;
    height: 100%;
    background: linear-gradient(90deg, #006A60, #00897B);
    border-radius: 2px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes progress-indeterminate {
    0% { left: -30%; }
    50% { left: 100%; }
    100% { left: -30%; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   5. SUCCESS/ERROR ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════ */

/* Success Checkmark */
.success-checkmark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #4CAF50;
    color: white;
    animation: successPop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.success-checkmark::after {
    content: '✓';
    font-size: 24px;
    font-weight: bold;
    animation: checkmarkDraw 0.3s cubic-bezier(0.2, 0, 0, 1) 0.2s forwards;
    opacity: 0;
}

@keyframes successPop {
    0% { transform: scale(0); }
    80% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes checkmarkDraw {
    to { opacity: 1; }
}

/* Error Shake */
.error-shake {
    animation: errorShake 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

/* Toast Notification Slide */
.toast-slide-in {
    animation: toastSlideIn 0.3s cubic-bezier(0.2, 0, 0, 1) forwards;
}

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

/* ═══════════════════════════════════════════════════════════════════════════
   6. NAVIGATION EFFECTS
   ═══════════════════════════════════════════════════════════════════════════ */

/* Nav Link Underline Slide */
.nav-link-expressive {
    position: relative;
    display: inline-block;
}

.nav-link-expressive::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: currentColor;
    transition: width 0.3s cubic-bezier(0.2, 0, 0, 1);
}

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

/* Logo Drop */
.nav-logo-expressive {
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.nav-logo-expressive:hover {
    animation: logoDrop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

/* ═══════════════════════════════════════════════════════════════════════════
   7. FORM INPUT FOCUS
   ═══════════════════════════════════════════════════════════════════════════ */

/* Floating Label Input */
.input-floating {
    position: relative;
}

.input-floating input {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-floating input:focus {
    border-color: #006A60;
    box-shadow: 0 0 0 2px rgba(0, 106, 96, 0.2);
    outline: none;
}

.input-floating label {
    position: absolute;
    left: 12px;
    top: 14px;
    transition: top 0.2s, font-size 0.2s, color 0.2s;
    pointer-events: none;
    color: rgba(0, 0, 0, 0.6);
}

.input-floating input:focus ~ label,
.input-floating input:not(:placeholder-shown) ~ label {
    top: -8px;
    font-size: 12px;
    color: #006A60;
    background: white;
    padding: 0 4px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   8. ACCESSIBILITY - REDUCED MOTION
   ═══════════════════════════════════════════════════════════════════════════ */

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

    /* Keep essential loading animations */
    .spinner-modern,
    .spinner-pulse,
    .loading-dots,
    .progress-linear {
        animation-duration: 0.8s !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   9. UTILITY CLASSES
   ═══════════════════════════════════════════════════════════════════════════ */

/* GPU Acceleration */
.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform, opacity;
}

/* Hardware Accelerated */
.hw-accelerated {
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Animation Delays */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }

/* Spin animation for icons/loaders */
@keyframes spin {
    to { transform: rotate(360deg); }
}
