/* Animations et transitions pour la feuille de temps */

/* Transitions de base */
.calendar-day,
.entry-item,
.timeline-entry,
.card {
    transition: all 0.3s ease;
}

/* Animation fade in */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* Animation slide in */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in {
    animation: slideIn 0.3s ease;
}

/* Animation pour les nouvelles activités */
@keyframes activityAppear {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.timeline-entry.new-activity,
.entry-item.new-activity {
    animation: activityAppear 0.4s ease;
}

/* Animation pour la suppression */
@keyframes activityRemove {
    from {
        opacity: 1;
        transform: scale(1);
        max-height: 200px;
    }
    to {
        opacity: 0;
        transform: scale(0.8);
        max-height: 0;
        margin: 0;
        padding: 0;
    }
}

.timeline-entry.removing,
.entry-item.removing {
    animation: activityRemove 0.3s ease;
    pointer-events: none;
}

/* Hover effects améliorés */
.calendar-day:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

.entry-item:hover,
.timeline-entry:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 174, 158, 0.2) !important;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

/* Loading states - Skeleton screens */
@keyframes skeletonLoading {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: skeletonLoading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-title {
    height: 1.5em;
    width: 60%;
    margin-bottom: 1em;
}

/* Spinner de chargement */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 174, 158, 0.3);
    border-radius: 50%;
    border-top-color: #00AE9E;
    animation: spin 0.8s linear infinite;
}

/* Pulse animation pour les notifications */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Shake animation pour les erreurs */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.5s ease;
}

/* Bounce animation pour les succès */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.bounce {
    animation: bounce 0.6s ease;
}

/* Micro-interactions pour les boutons */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::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:active::before {
    width: 300px;
    height: 300px;
}

/* Transition pour les modals */
.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out;
    transform: translate(0, -50px);
}

.modal.show .modal-dialog {
    transform: translate(0, 0);
}

/* Transition pour les dropdowns */
.dropdown-menu {
    animation: fadeIn 0.2s ease;
}

/* Progress bar animation */
@keyframes progressBar {
    from {
        width: 0%;
    }
}

.progress-bar {
    animation: progressBar 1s ease-out;
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Optimistic UI updates */
.optimistic-update {
    opacity: 0.6;
    pointer-events: none;
}

/* Disable animations si préféré par l'utilisateur */
@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;
    }
}

/* Animation pour les graphiques */
.chart-container {
    animation: fadeIn 0.5s ease;
}

/* Ripple effect pour les cartes cliquables */
.card-clickable {
    position: relative;
    overflow: hidden;
}

.card-clickable::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(0, 174, 158, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.card-clickable:active::after {
    width: 300px;
    height: 300px;
}
