/* Animations CSS */

/* Fade In Animations */
.fade-in {
    opacity: 0;
    animation: fadeIn 0.8s ease-out forwards;
}

.fade-in-delay {
    opacity: 0;
    animation: fadeIn 0.8s ease-out 0.2s forwards;
}

.fade-in-delay-2 {
    opacity: 0;
    animation: fadeIn 0.8s ease-out 0.4s forwards;
}

.fade-in-delay-3 {
    opacity: 0;
    animation: fadeIn 0.8s ease-out 0.6s forwards;
}

.fade-in-delay-4 {
    opacity: 0;
    animation: fadeIn 0.8s ease-out 0.8s forwards;
}

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

/* Slide In Animations */
.slide-in-left {
    opacity: 0;
    animation: slideInLeft 0.8s ease-out forwards;
}

.slide-in-right {
    opacity: 0;
    animation: slideInRight 0.8s ease-out 0.3s forwards;
}

.slide-in-up {
    opacity: 0;
    animation: slideInUp 0.8s ease-out 0.6s forwards;
}

.slide-in-up-delay {
    opacity: 0;
    animation: slideInUp 0.8s ease-out 0.8s forwards;
}

.slide-in-up-delay-2 {
    opacity: 0;
    animation: slideInUp 0.8s ease-out 1s forwards;
}

.slide-in-up-delay-3 {
    opacity: 0;
    animation: slideInUp 0.8s ease-out 1.2s forwards;
}

.slide-in-up-delay-4 {
    opacity: 0;
    animation: slideInUp 0.8s ease-out 1.4s forwards;
}

.slide-in-up-delay-5 {
    opacity: 0;
    animation: slideInUp 0.8s ease-out 1.6s forwards;
}

.slide-in-up-delay-6 {
    opacity: 0;
    animation: slideInUp 0.8s ease-out 1.8s forwards;
}

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

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

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

/* Hover Effects */
.hover-lift {
    transition: transform 0.3s ease-out;
}

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

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

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

/* Typing Animation */
.typing {
    overflow: hidden;
    border-right: 2px solid #333;
    white-space: nowrap;
    animation: typing 3s 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: #333 }
}

/* 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.5s;
}

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

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

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

/* Loading Spinner */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #333;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Glow Effect */
.glow {
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 5px #333;
    }
    to {
        box-shadow: 0 0 20px #333, 0 0 30px #333;
    }
}

/* Success Message Animation */
.success-message {
    background: #4CAF50;
    color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    animation: slideInRight 0.3s ease-out;
}

/* Error Message Animation */
.error-message {
    background: #f44336;
    color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    animation: shake 0.5s;
}

/* Stagger Animation for Lists */
.stagger-item {
    opacity: 0;
    animation: fadeInUp 0.5s ease-out forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }

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

/* Progress Bar Animation */
.progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #333 0%, #666 100%);
    transition: width 1.5s ease-out;
}

.progress-bar.animated {
    animation: progressFill 1.5s ease-out forwards;
}

@keyframes progressFill {
    from { width: 0%; }
    to { width: var(--progress-width); }
}

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

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

/* Rotate Animation */
.rotate {
    animation: rotate 20s linear infinite;
}

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

/* Heartbeat Animation */
.heartbeat {
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.3); }
    28% { transform: scale(1); }
    42% { transform: scale(1.3); }
    70% { transform: scale(1); }
}

/* Slide Down Animation */
.slide-down {
    opacity: 0;
    transform: translateY(-20px);
    animation: slideDown 0.5s ease-out forwards;
}

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

/* Flip Animation */
.flip {
    animation: flip 0.6s;
}

@keyframes flip {
    0% {
        transform: perspective(400px) rotateY(0);
    }
    40% {
        transform: perspective(400px) translateZ(150px) rotateY(170deg);
    }
    50% {
        transform: perspective(400px) translateZ(150px) rotateY(190deg) scale(1);
    }
    80% {
        transform: perspective(400px) rotateY(360deg) scale(0.95);
    }
    100% {
        transform: perspective(400px) scale(1);
    }
}

/* Responsive Animations */
@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;
    }
}

/* Custom Scrollbar Animation */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
    transition: background 0.3s ease;
}

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