/**
 * Animations and Transitions
 */

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Slide down animation */
@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Slide up animation */
@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Bounce animation */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Pulse animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Loading spinner */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Shake animation */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

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

/* Apply animations */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

.slide-down {
    animation: slideDown 0.5s ease-out;
}

.slide-up {
    animation: slideUp 0.5s ease-out;
}

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

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

.shake {
    animation: shake 0.5s ease-in-out;
}

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

/* Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease-in;
}

.loading-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    animation: scaleIn 0.3s ease-out;
}

/* Transition for all interactive elements */
button, a, input, select, textarea {
    transition: all 0.3s ease;
}

/* Smooth page transitions */
.page-transition {
    animation: fadeIn 0.5s ease-in;
}

/* Error shake on form fields */
.field-error {
    animation: shake 0.4s ease-in-out;
}

/* Success check animation */
@keyframes checkmark {
    0% {
        stroke-dashoffset: 50px;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

.success-checkmark {
    animation: checkmark 0.6s ease-out;
}

/* Modal animations */
.modal.show {
    animation: fadeIn 0.3s ease-out;
}

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

/* Card hover effect */
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

/* Button scale on hover */
button:not(:disabled):hover {
    transform: scale(1.02);
    transition: all 0.2s ease;
}

/* Link hover animation */
a:hover {
    animation: pulse 0.6s ease-in-out;
}

/* Tooltip animation */
.tooltip {
    opacity: 0;
    animation: slideUp 0.3s ease-out forwards;
}

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

/* Page load animation */
body {
    animation: fadeIn 0.5s ease-in;
}
