/*
 * UNIKARTA Repository - Animation Library
 * Smooth, Premium Animations & Transitions
 * Version: 1.0.0
 */

/* ============================================
   1. KEYFRAME ANIMATIONS
   ============================================ */

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

    to {
        opacity: 1;
    }
}

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

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

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

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

/* Slide In Left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

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

/* Slide In Right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

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

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

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

/* Bounce */
@keyframes bounce {

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

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

/* Pulse */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Shimmer (Loading Effect) */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

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

/* Spin */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   2. ANIMATION UTILITY CLASSES
   ============================================ */

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

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

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

.slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

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

.bounce {
    animation: bounce 1s ease-in-out infinite;
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

.spin {
    animation: spin 1s linear infinite;
}

/* Animation Delays */
.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

.delay-4 {
    animation-delay: 0.4s;
}

.delay-5 {
    animation-delay: 0.5s;
}

/* ============================================
   3. SKELETON LOADING STATES
   ============================================ */

.skeleton {
    background: linear-gradient(90deg,
            #f0f0f0 0%,
            #e0e0e0 50%,
            #f0f0f0 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
    border-radius: 4px;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 16px;
    border-radius: 4px;
}

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

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

/* ============================================
   4. HOVER EFFECTS
   ============================================ */

.hover-lift {
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.hover-lift:hover {
    transform: translateY(-5px);
}

.hover-grow {
    transition: transform 0.3s ease;
}

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

.hover-glow {
    position: relative;
    transition: all 0.3s ease;
}

.hover-glow::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: inherit;
    opacity: 0;
    background: linear-gradient(135deg, #1e40af 0%, #f59e0b 100%);
    z-index: -1;
    filter: blur(20px);
    transition: opacity 0.3s ease;
}

.hover-glow:hover::after {
    opacity: 0.5;
}

.hover-shadow {
    transition: box-shadow 0.3s ease;
}

.hover-shadow:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15),
        0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* ============================================
   5. PAGE TRANSITIONS
   ============================================ */

.page-transition {
    animation: fadeIn 0.4s ease-out;
}

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

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ============================================
   6. LOADING STATES
   ============================================ */

.loading-spinner {
    border: 3px solid rgba(30, 64, 175, 0.1);
    border-top: 3px solid #1e40af;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

.loading-dots span {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin: 0 4px;
    background-color: #1e40af;
    border-radius: 50%;
    animation: pulse 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;
}

/* ============================================
   7. PROGRESS INDICATORS
   ============================================ */

.progress-bar-animated {
    position: relative;
    overflow: hidden;
}

.progress-bar-animated::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.4),
            transparent);
    animation: shimmer 2s infinite;
}

/* ============================================
   8. TOAST NOTIFICATIONS
   ============================================ */

.toast-enter {
    animation: slideInRight 0.3s ease-out;
}

.toast-exit {
    animation: slideInRight 0.3s ease-out reverse;
}

/* ============================================
   9. MODAL ANIMATIONS
   ============================================ */

.modal-backdrop {
    animation: fadeIn 0.3s ease-out;
}

.modal-content-enter {
    animation: scaleIn 0.3s ease-out;
}

/* ============================================
   10. CARD REVEAL ANIMATIONS
   ============================================ */

.card-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.card-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger effect for multiple cards */
.card-reveal:nth-child(1) {
    transition-delay: 0.1s;
}

.card-reveal:nth-child(2) {
    transition-delay: 0.2s;
}

.card-reveal:nth-child(3) {
    transition-delay: 0.3s;
}

.card-reveal:nth-child(4) {
    transition-delay: 0.4s;
}

.card-reveal:nth-child(5) {
    transition-delay: 0.5s;
}

.card-reveal:nth-child(6) {
    transition-delay: 0.6s;
}

/* ============================================
   11. BUTTON ANIMATIONS
   ============================================ */

.btn-animate {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-animate::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-animate:hover::before {
    width: 300px;
    height: 300px;
}

/* ============================================
   12. TEXT ANIMATIONS
   ============================================ */

.text-reveal {
    overflow: hidden;
}

.text-reveal span {
    display: inline-block;
    animation: fadeInUp 0.6s ease-out;
}

/* Typewriter Effect */
@keyframes typewriter {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

.typewriter {
    overflow: hidden;
    border-right: 2px solid #1e40af;
    white-space: nowrap;
    animation: typewriter 3s steps(40) 1s 1 normal both;
}

/* ============================================
   13. RESPONSIVE ANIMATION CONTROL
   ============================================ */

/* 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;
        scroll-behavior: auto !important;
    }

    .skeleton {
        animation: none;
        background: #f0f0f0;
    }
}

/* Disable complex animations on mobile for performance */
@media (max-width: 767px) {
    .hover-glow::after {
        display: none;
    }

    .card-reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}