/* =============================================
   UI/UX Enhancement - Animations & Transitions
   ============================================= */

/* ===== Animation Keyframes ===== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ===== Utility Classes ===== */

.animate-fade-in {
    animation: fadeIn 0.5s ease-out;
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.animate-fade-in-down {
    animation: fadeInDown 0.6s ease-out;
}

.animate-scale-in {
    animation: scaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-bounce {
    animation: bounce 1s ease-in-out infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* 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;
}

/* ===== Enhanced Transitions ===== */

.transition-all {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.transition-fast {
    transition: all 0.15s ease;
}

.transition-smooth {
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== Skeleton Loaders ===== */

.skeleton {
    background: linear-gradient(90deg,
            #f0f0f0 25%,
            #e0e0e0 50%,
            #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 12px;
}

.skeleton-card {
    height: 200px;
    border-radius: 12px;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

/* ===== Enhanced Card Hovers ===== */

.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.card-hover:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.card-hover:active {
    transform: translateY(-2px) scale(1.01);
}

/* ===== Button Enhancements ===== */

.btn-enhanced {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-enhanced::before {
    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, height 0.6s;
}

.btn-enhanced:hover::before {
    width: 300px;
    height: 300px;
}

.btn-enhanced:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.btn-enhanced:active {
    transform: translateY(0);
}

/* ===== Loading Spinner ===== */

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: var(--primary-uitm, #005C99);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.spinner-lg {
    width: 60px;
    height: 60px;
    border-width: 6px;
}

/* ===== Page Transitions ===== */

.page-enter {
    animation: fadeInUp 0.5s ease-out;
}

.page-enter-fast {
    animation: fadeIn 0.3s ease-out;
}

/* ===== Focus States ===== */

.focus-ring:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 92, 153, 0.3);
    border-color: var(--primary-uitm, #005C99);
}

/* ===== Hover Effects ===== */

.hover-lift {
    transition: transform 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
}

.hover-scale {
    transition: transform 0.2s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(0, 92, 153, 0.3);
}

/* ===== Smooth Scroll ===== */

html {
    scroll-behavior: smooth;
}

/* ===== Image Animations ===== */

.image-zoom {
    overflow: hidden;
}

.image-zoom img {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.image-zoom:hover img {
    transform: scale(1.1);
}

/* ===== Notification Badge Pulse ===== */

.badge-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ===== Success Checkmark Animation ===== */

@keyframes checkmark {
    0% {
        stroke-dashoffset: 100;
    }

    100% {
        stroke-dashoffset: 0;
    }
}

.checkmark-animate {
    stroke-dasharray: 100;
    animation: checkmark 0.5s ease-out forwards;
}

/* ===== Price Highlight ===== */

@keyframes priceHighlight {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(0, 92, 153, 0.4);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(0, 92, 153, 0);
    }
}

.price-highlight {
    animation: priceHighlight 1.5s ease-out;
}

/* ===== Empty State Illustration ===== */

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    animation: fadeInUp 0.6s ease-out;
}

.empty-state i {
    font-size: 4rem;
    color: var(--text-tertiary, #64748B);
    opacity: 0.5;
    margin-bottom: 1rem;
    display: block;
}

/* ===== Responsive Animations ===== */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}