/* animations.css */
/* Animations avancées pour améliorer l'UX */

/* =========================================================
   ANIMATIONS DE BASE
   ========================================================= */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

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

@keyframes slideInDown {
    from {
        transform: translateY(-8px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

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

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

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

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

/* =========================================================
   CLASSES UTILITAIRES
   ========================================================= */

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

.animate-fade-out {
    animation: fadeOut 0.3s ease-in-out;
}

.animate-slide-up {
    animation: slideInUp 0.4s ease-out;
}

.animate-slide-down {
    animation: slideInDown 0.4s ease-out;
}

.animate-slide-left {
    animation: slideInLeft 0.4s ease-out;
}

.animate-slide-right {
    animation: slideInRight 0.4s ease-out;
}

.animate-bounce {
  animation: none;
}

.animate-pulse {
  animation: none;
}

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

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

/* =========================================================
   TRANSITIONS SMOOTH
   ========================================================= */

.smooth-transition {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.smooth-transition-fast {
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.smooth-transition-slow {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================================================
   HOVER EFFECTS
   ========================================================= */

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

.hover-lift:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

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

.hover-scale:hover {
    transform: none;
}

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

.hover-glow:hover {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--hl-blue) 12%, transparent);
}

/* =========================================================
   DRAG & DROP STYLES
   ========================================================= */

.drag-drop-zone {
    border: 2px dashed var(--color-border);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    background: var(--bg-secondary);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.drag-drop-zone::before {
    display: none;
}

.drag-drop-zone:hover::before {
    display: none;
}

.drag-drop-zone.dragover {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.drag-drop-zone.dragover::before {
    background: linear-gradient(rgba(0, 56, 101, 0.2), transparent);
}

.drag-drop-zone.dragover i {
    color: var(--color-primary);
    transform: scale(1.2);
}

.drag-drop-zone i {
    font-size: 3rem;
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.drag-drop-zone p {
    color: var(--color-text-secondary);
    margin: 0.5rem 0;
}

.drag-drop-zone .file-input {
    display: none;
}

.draggable {
    cursor: move;
    user-select: none;
    transition: all 0.2s ease;
}

.draggable.dragging {
    opacity: 0.5;
    transform: scale(0.95);
    z-index: 1000;
}

.drag-handle {
    cursor: grab;
}

.drag-handle:active {
    cursor: grabbing;
}

.drop-zone {
    min-height: 100px;
    border: 2px dashed transparent;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.3s ease;
}

.drop-zone.drag-over {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.drop-zone.drag-over::after {
    content: 'Déposer ici';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--color-primary);
    font-weight: 600;
    font-size: 1.2rem;
}

/* =========================================================
   LOADING STATES
   ========================================================= */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* =========================================================
   NOTIFICATION ANIMATIONS
   ========================================================= */

@keyframes slideInNotification {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutNotification {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.notification {
    animation: slideInNotification 0.3s ease-out;
}

.notification.hiding {
    animation: slideOutNotification 0.3s ease-out;
}

/* =========================================================
   CARD ANIMATIONS
   ========================================================= */

.card-animate {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-animate:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.card-animate.stagger-1 {
    animation-delay: 0.1s;
}

.card-animate.stagger-2 {
    animation-delay: 0.2s;
}

.card-animate.stagger-3 {
    animation-delay: 0.3s;
}

/* =========================================================
   BUTTON ANIMATIONS
   ========================================================= */

.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-ripple:active::after {
    width: 300px;
    height: 300px;
}

/* =========================================================
   RESPONSIVE ANIMATIONS
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

