/* ═════════════════════════════════════════════════════════════
   MICRO-INTERACTIONS SUBTILES - DESIGN 2026
   Animations et effets au hover pour une UX premium
   ═════════════════════════════════════════════════════════════ */

/* ═════════════════════════════════════════════════════════════
   CURSEURS PERSONNALISÉS
   ═════════════════════════════════════════════════════════════ */
button, .btn, a, input[type="submit"], input[type="button"], 
.nav-link, .table tbody tr, summary {
    cursor: pointer;
}

/* Curseur interdit pour éléments désactivés */
button:disabled, .btn:disabled, input:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* ═════════════════════════════════════════════════════════════
   EFFET RIPPLE (Material Design)
   ═════════════════════════════════════════════════════════════ */
.btn, .badge, .nav-tabs .nav-link {
    position: relative;
    overflow: hidden;
}

.btn::after, .badge::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 ease-out, height 0.6s ease-out;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

/* ═════════════════════════════════════════════════════════════
   EFFET PARALLAX SUBTIL SUR CARDS
   ═════════════════════════════════════════════════════════════ */
.card {
    transform-style: preserve-3d;
    transition: transform 0.3s ease-out;
}

.card:hover {
    transform: translateY(-6px) rotateX(2deg);
}

.card.text-white:hover {
    transform: translateY(-6px) scale(1.02);
}

/* ═════════════════════════════════════════════════════════════
   EFFET DE PULSATION POUR ÉLÉMENTS IMPORTANTS
   ═════════════════════════════════════════════════════════════ */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.badge-danger, .alert-danger {
    animation: pulse 2s ease-in-out infinite;
}

.badge-danger:hover, .alert-danger:hover {
    animation: none;
}

/* ═════════════════════════════════════════════════════════════
   EFFET DE GLOW (BRILLANCE) AU FOCUS
   ═════════════════════════════════════════════════════════════ */
.form-control:focus, .btn-primary:focus, .btn-success:focus {
    position: relative;
}

.form-control:focus::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: inherit;
    background: linear-gradient(45deg, #3b82f6, #8b5cf6, #ec4899, #3b82f6);
    background-size: 300% 300%;
    z-index: -1;
    animation: gradientShift 3s ease infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ═════════════════════════════════════════════════════════════
   EFFET DE SHAKE POUR ERREURS DE VALIDATION
   ═════════════════════════════════════════════════════════════ */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.invalid, .validation-message {
    animation: shake 0.5s ease-in-out;
}

/* ═════════════════════════════════════════════════════════════
   EFFET DE BOUNCE POUR ALERTES
   ═════════════════════════════════════════════════════════════ */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.alert-success {
    animation: slideInDown 0.4s ease-out, bounce 1s ease-in-out 0.4s;
}

/* ═════════════════════════════════════════════════════════════
   LOADER / SKELETON SHIMMER
   ═════════════════════════════════════════════════════════════ */
@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 0%,
        #e0e0e0 50%,
        #f0f0f0 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear;
    border-radius: 4px;
    display: inline-block;
}

/* ═════════════════════════════════════════════════════════════
   EFFET DE SCALE POUR ICÔNES
   ═════════════════════════════════════════════════════════════ */
.oi, .icon, svg {
    transition: transform 0.2s ease-in-out;
}

button:hover .oi, 
.btn:hover .icon, 
a:hover svg {
    transform: scale(1.2);
}

/* ═════════════════════════════════════════════════════════════
   EFFET DE ROTATION AU HOVER (pour refresh, sync, etc.)
   ═════════════════════════════════════════════════════════════ */
.oi-loop-circular, .oi-reload, .oi-sync {
    transition: transform 0.5s ease-in-out;
}

button:hover .oi-loop-circular,
button:hover .oi-reload,
button:hover .oi-sync {
    transform: rotate(180deg);
}

/* ═════════════════════════════════════════════════════════════
   SMOOTH FOCUS VISIBLE (pour accessibilité)
   ═════════════════════════════════════════════════════════════ */
*:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ═════════════════════════════════════════════════════════════
   EFFET DE SLIDE POUR DROPDOWNS
   ═════════════════════════════════════════════════════════════ */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-menu, .popover {
    animation: slideDown 0.2s ease-out;
}

/* ═════════════════════════════════════════════════════════════
   EFFET DE TYPING INDICATOR (pour chargements)
   ═════════════════════════════════════════════════════════════ */
@keyframes typing {
    0%, 100% { opacity: 0.3; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-5px); }
}

.loading-dots span {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin: 0 2px;
    background: #3b82f6;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

/* ═════════════════════════════════════════════════════════════
   EFFET DE PROGRESS BAR ANIMÉE
   ═════════════════════════════════════════════════════════════ */
@keyframes progressSlide {
    0% { background-position: 0 0; }
    100% { background-position: 40px 0; }
}

.progress-bar {
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.15) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.15) 75%,
        transparent 75%,
        transparent
    );
    background-size: 40px 40px;
    animation: progressSlide 1s linear infinite;
}

/* ═════════════════════════════════════════════════════════════
   EFFET DE GLASSMORPHISM (optionnel)
   ═════════════════════════════════════════════════════════════ */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}

/* ═════════════════════════════════════════════════════════════
   EFFET DE ZOOM SUR IMAGES
   ═════════════════════════════════════════════════════════════ */
img {
    transition: transform 0.3s ease-in-out;
}

img:hover {
    transform: scale(1.05);
}

/* ═════════════════════════════════════════════════════════════
   SCROLL BAR MODERNE (Webkit uniquement)
   ═════════════════════════════════════════════════════════════ */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 5px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ═════════════════════════════════════════════════════════════
   EFFET DE TEXT SELECTION
   ═════════════════════════════════════════════════════════════ */
::selection {
    background: rgba(59, 130, 246, 0.3);
    color: #0f172a;
}

::-moz-selection {
    background: rgba(59, 130, 246, 0.3);
    color: #0f172a;
}

/* ═════════════════════════════════════════════════════════════
   REDUCE MOTION (Accessibilité)
   ═════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

