/*
================================================================================
LOCOTO DESIGN SYSTEM - INTERACTIONS & ÉTATS VISUELS
================================================================================
Version: 1.0
Date: 2025-01-19
Description: Système unifié d'interactions, animations et états visuels
Phase 4 du plan d'harmonisation CSS
================================================================================
*/

/* ===== VARIABLES D'ANIMATION ===== */
:root {
    /* Durées de transition standardisées */
    --lds-transition-fast: 150ms;
    --lds-transition-base: 200ms;
    --lds-transition-slow: 300ms;
    --lds-transition-slower: 400ms;
    
    /* Fonctions d'easing */
    --lds-ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    --lds-ease-out: cubic-bezier(0, 0, 0.2, 1);
    --lds-ease-in: cubic-bezier(0.4, 0, 1, 1);
    --lds-ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --lds-ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    
    /* Ombres d'interaction */
    --lds-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --lds-shadow-focus: 0 0 0 3px rgba(66, 136, 250, 0.15);
    --lds-shadow-active: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
}

/* ===== CLASSES DE TRANSITION GLOBALES ===== */
.lds-transition-all {
    transition: all var(--lds-transition-base) var(--lds-ease-in-out);
}

.lds-transition-colors {
    transition: color var(--lds-transition-base) var(--lds-ease-in-out),
                background-color var(--lds-transition-base) var(--lds-ease-in-out),
                border-color var(--lds-transition-base) var(--lds-ease-in-out);
}

.lds-transition-opacity {
    transition: opacity var(--lds-transition-base) var(--lds-ease-in-out);
}

.lds-transition-transform {
    transition: transform var(--lds-transition-base) var(--lds-ease-in-out);
}

.lds-transition-shadow {
    transition: box-shadow var(--lds-transition-base) var(--lds-ease-in-out);
}

/* ===== ÉTATS DE CHARGEMENT ===== */

/* Spinner de base */
.lds-spinner {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid rgba(66, 136, 250, 0.2);
    border-radius: 50%;
    border-top-color: var(--lds-primary);
    animation: lds-spin 0.8s linear infinite;
}

.lds-spinner-sm {
    width: 1rem;
    height: 1rem;
}

.lds-spinner-lg {
    width: 2.5rem;
    height: 2.5rem;
    border-width: 3px;
}

@keyframes lds-spin {
    to { transform: rotate(360deg); }
}

/* Dots de chargement */
.lds-loading-dots {
    display: inline-flex;
    gap: 0.25rem;
}

.lds-loading-dots span {
    width: 0.5rem;
    height: 0.5rem;
    background-color: var(--lds-primary);
    border-radius: 50%;
    animation: lds-dots 1.4s infinite ease-in-out both;
}

.lds-loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.lds-loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes lds-dots {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Skeleton loading */
.lds-skeleton {
    background: linear-gradient(90deg, 
        rgba(0, 0, 0, 0.05) 25%, 
        rgba(0, 0, 0, 0.1) 50%, 
        rgba(0, 0, 0, 0.05) 75%);
    background-size: 200% 100%;
    animation: lds-skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes lds-skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Progress bar */
.lds-progress {
    width: 100%;
    height: 4px;
    background-color: rgba(66, 136, 250, 0.1);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.lds-progress-bar {
    height: 100%;
    background-color: var(--lds-primary);
    border-radius: 2px;
    transition: width var(--lds-transition-slow) var(--lds-ease-in-out);
}

.lds-progress-indeterminate .lds-progress-bar {
    width: 30%;
    animation: lds-progress-indeterminate 1.5s ease-in-out infinite;
}

@keyframes lds-progress-indeterminate {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(400%); }
}

/* ===== ÉTATS VISUELS DES ÉLÉMENTS ===== */

/* États disabled */
.lds-disabled,
[disabled],
:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* États de focus améliorés */
.lds-focus-visible:focus-visible,
.lds-focus:focus {
    outline: 2px solid var(--lds-primary);
    outline-offset: 2px;
}

.lds-focus-ring:focus {
    box-shadow: var(--lds-shadow-focus);
}

/* États hover standards */
.lds-hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: var(--lds-shadow-hover);
}

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

.lds-hover-brightness:hover {
    filter: brightness(1.1);
}

/* États active/pressed */
.lds-active-scale:active {
    transform: scale(0.98);
}

.lds-active-shadow:active {
    box-shadow: var(--lds-shadow-active);
}

/* ===== ÉTATS DE VALIDATION ===== */

/* Success state */
.lds-state-success {
    border-color: var(--lds-success) !important;
    background-color: rgba(16, 185, 129, 0.05);
}

.lds-state-success:focus {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* Error state */
.lds-state-error {
    border-color: var(--lds-danger) !important;
    background-color: rgba(239, 68, 68, 0.05);
}

.lds-state-error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* Warning state */
.lds-state-warning {
    border-color: var(--lds-warning) !important;
    background-color: rgba(245, 158, 11, 0.05);
}

.lds-state-warning:focus {
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

/* ===== ANIMATIONS D'ENTRÉE/SORTIE ===== */

/* Fade animations */
.lds-fade-in {
    animation: lds-fadeIn var(--lds-transition-base) var(--lds-ease-out);
}

.lds-fade-out {
    animation: lds-fadeOut var(--lds-transition-base) var(--lds-ease-in);
}

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

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

/* Slide animations */
.lds-slide-up {
    animation: lds-slideUp var(--lds-transition-base) var(--lds-ease-out);
}

.lds-slide-down {
    animation: lds-slideDown var(--lds-transition-base) var(--lds-ease-out);
}

@keyframes lds-slideUp {
    from {
        transform: translateY(10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes lds-slideDown {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Scale animations */
.lds-scale-in {
    animation: lds-scaleIn var(--lds-transition-base) var(--lds-ease-bounce);
}

.lds-scale-out {
    animation: lds-scaleOut var(--lds-transition-base) var(--lds-ease-in);
}

@keyframes lds-scaleIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes lds-scaleOut {
    from {
        transform: scale(1);
        opacity: 1;
    }
    to {
        transform: scale(0.95);
        opacity: 0;
    }
}

/* ===== INDICATEURS HTMX ===== */

/* Indicateur de requête en cours */
.htmx-request .lds-htmx-indicator,
.htmx-request.lds-htmx-indicator {
    display: inline-block;
}

.lds-htmx-indicator {
    display: none;
}

/* Transition pour les swaps HTMX */
.htmx-swapping {
    opacity: 0.5;
    transition: opacity var(--lds-transition-fast) var(--lds-ease-in-out);
}

.htmx-settling {
    opacity: 1;
    transition: opacity var(--lds-transition-base) var(--lds-ease-out);
}

/* ===== TOOLTIPS ===== */

.lds-tooltip {
    position: relative;
}

.lds-tooltip-content {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-0.5rem);
    padding: 0.5rem 0.75rem;
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    font-size: 0.875rem;
    border-radius: 0.375rem;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--lds-transition-fast) var(--lds-ease-in-out);
    z-index: 1000;
}

.lds-tooltip:hover .lds-tooltip-content {
    opacity: 1;
}

/* ===== NOTIFICATIONS TOAST ===== */

.lds-toast {
    position: fixed;
    top: 1rem;
    right: 1rem;
    min-width: 300px;
    max-width: 500px;
    padding: 1rem;
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    animation: lds-slideDown var(--lds-transition-slow) var(--lds-ease-out);
    z-index: 9999;
    pointer-events: auto;
}

.lds-toast-success {
    border-left: 4px solid var(--lds-success);
}

.lds-toast-error {
    border-left: 4px solid var(--lds-danger);
}

.lds-toast-warning {
    border-left: 4px solid var(--lds-warning);
}

.lds-toast-info {
    border-left: 4px solid var(--lds-info);
}

/* Animation de sortie du toast (vers le haut) */
@keyframes lds-toast-exit {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-20px);
        opacity: 0;
    }
}

/* ===== BOUTONS AVEC ÉTATS INTERACTIFS ===== */

.lds-btn {
    position: relative;
    transition: all var(--lds-transition-base) var(--lds-ease-in-out);
}

.lds-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.lds-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
}

.lds-btn:focus-visible {
    outline: 2px solid var(--lds-primary);
    outline-offset: 2px;
}

.lds-btn-loading {
    color: transparent;
    pointer-events: none;
}

.lds-btn-loading::after {
    content: "";
    position: absolute;
    width: 1rem;
    height: 1rem;
    top: 50%;
    left: 50%;
    margin-left: -0.5rem;
    margin-top: -0.5rem;
    border: 2px solid currentColor;
    border-radius: 50%;
    border-top-color: transparent;
    animation: lds-spin 0.6s linear infinite;
}

/* ===== FORMULAIRES AVEC ÉTATS ===== */

.lds-input,
.lds-select,
.lds-textarea {
    transition: all var(--lds-transition-base) var(--lds-ease-in-out);
}

.lds-input:focus,
.lds-select:focus,
.lds-textarea:focus {
    border-color: var(--lds-primary);
    box-shadow: 0 0 0 3px rgba(66, 136, 250, 0.1);
}

.lds-input:hover:not(:disabled),
.lds-select:hover:not(:disabled),
.lds-textarea:hover:not(:disabled) {
    border-color: var(--lds-primary-light);
}

/* ===== CARDS INTERACTIVES ===== */

.lds-card-interactive {
    transition: all var(--lds-transition-base) var(--lds-ease-in-out);
    cursor: pointer;
}

.lds-card-interactive:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.lds-card-interactive:active {
    transform: translateY(0);
}

/* ===== SUPPORT REDUCED MOTION ===== */

@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;
    }
    
    .lds-spinner {
        animation: none;
        border: 2px solid var(--lds-primary);
    }
    
    .lds-hover-lift:hover,
    .lds-hover-grow:hover {
        transform: none;
    }
}

/* ===== CLASSES UTILITAIRES D'ANIMATION ===== */

.lds-animate-pulse {
    animation: lds-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes lds-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.lds-animate-bounce {
    animation: lds-bounce 1s infinite;
}

@keyframes lds-bounce {
    0%, 100% {
        transform: translateY(-25%);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }
    50% {
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

.lds-animate-ping {
    animation: lds-ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes lds-ping {
    75%, 100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* ===== TRANSITIONS DE PAGE ===== */

.lds-page-transition-enter {
    animation: lds-pageEnter var(--lds-transition-slow) var(--lds-ease-out);
}

.lds-page-transition-exit {
    animation: lds-pageExit var(--lds-transition-base) var(--lds-ease-in);
}

@keyframes lds-pageEnter {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes lds-pageExit {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-20px);
    }
}/*
================================================================================
LOCOTO DESIGN SYSTEM - MICRO-ANIMATIONS AVANCÉES
================================================================================
Version: 1.0
Date: 2025-01-19
Description: Micro-interactions et animations subtiles pour améliorer l'UX
Phase 4.5 du plan d'harmonisation CSS
================================================================================
*/

/* ===== ANIMATIONS DE BOUTONS ===== */

/* Effet ripple au clic */
.lds-btn-ripple {
    position: relative;
    overflow: hidden;
}

.lds-btn-ripple::before {
    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;
}

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

/* Effet de brillance au hover */
.lds-btn-shine {
    position: relative;
    overflow: hidden;
}

.lds-btn-shine::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 70%
    );
    transform: rotate(45deg) translateX(-100%);
    transition: transform 0.6s;
}

.lds-btn-shine:hover::after {
    transform: rotate(45deg) translateX(100%);
}

/* Effet de pulsation pour les CTAs importants */
@keyframes lds-pulse-shadow {
    0% {
        box-shadow: 0 0 0 0 rgba(66, 136, 250, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(66, 136, 250, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(66, 136, 250, 0);
    }
}

.lds-btn-pulse {
    animation: lds-pulse-shadow 2s infinite;
}

/* ===== ANIMATIONS DE CARDS ===== */

/* Effet de tilt 3D au hover */
.lds-card-tilt {
    transition: transform 0.3s var(--lds-ease-in-out);
    transform-style: preserve-3d;
    perspective: 1000px;
}

.lds-card-tilt:hover {
    transform: rotateX(5deg) rotateY(5deg) scale(1.02);
}

/* Effet de slide-in pour les cards */
@keyframes lds-slide-in-bottom {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.lds-card-slide-in {
    animation: lds-slide-in-bottom 0.5s var(--lds-ease-out) both;
}

.lds-card-slide-in:nth-child(1) { animation-delay: 0.1s; }
.lds-card-slide-in:nth-child(2) { animation-delay: 0.2s; }
.lds-card-slide-in:nth-child(3) { animation-delay: 0.3s; }
.lds-card-slide-in:nth-child(4) { animation-delay: 0.4s; }
.lds-card-slide-in:nth-child(5) { animation-delay: 0.5s; }

/* Effet de flip pour révéler du contenu */
.lds-card-flip {
    position: relative;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.lds-card-flip.is-flipped {
    transform: rotateY(180deg);
}

.lds-card-flip-front,
.lds-card-flip-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
}

.lds-card-flip-back {
    transform: rotateY(180deg);
}

/* ===== ANIMATIONS DE FORMULAIRES ===== */

/* Effet de focus animé pour les inputs */
.lds-input-animated {
    position: relative;
    border-bottom: 2px solid var(--lds-gray-300);
    transition: border-color 0.3s;
}

.lds-input-animated::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--lds-primary);
    transition: width 0.3s var(--lds-ease-out);
}

.lds-input-animated:focus {
    border-color: transparent;
}

.lds-input-animated:focus::after {
    width: 100%;
}

/* Label flottant animé */
.lds-floating-label {
    position: relative;
}

.lds-floating-label label {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    transition: all 0.3s var(--lds-ease-in-out);
    pointer-events: none;
    color: var(--lds-gray-500);
}

.lds-floating-label input:focus + label,
.lds-floating-label input:not(:placeholder-shown) + label {
    top: -0.5rem;
    left: 0.5rem;
    font-size: 0.75rem;
    color: var(--lds-primary);
    background: white;
    padding: 0 0.25rem;
}

/* Checkbox animé */
.lds-checkbox-animated {
    position: relative;
    width: 1.25rem;
    height: 1.25rem;
}

.lds-checkbox-animated input[type="checkbox"] {
    opacity: 0;
    position: absolute;
}

.lds-checkbox-animated .checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 1.25rem;
    width: 1.25rem;
    border: 2px solid var(--lds-gray-400);
    border-radius: 0.25rem;
    transition: all 0.2s var(--lds-ease-in-out);
}

.lds-checkbox-animated input[type="checkbox"]:checked ~ .checkmark {
    background-color: var(--lds-primary);
    border-color: var(--lds-primary);
    transform: scale(1.1);
}

.lds-checkbox-animated input[type="checkbox"]:checked ~ .checkmark::after {
    content: "";
    position: absolute;
    display: block;
    left: 0.375rem;
    top: 0.125rem;
    width: 0.375rem;
    height: 0.75rem;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    animation: lds-checkmark 0.3s var(--lds-ease-bounce);
}

@keyframes lds-checkmark {
    0% {
        opacity: 0;
        transform: rotate(45deg) scale(0);
    }
    100% {
        opacity: 1;
        transform: rotate(45deg) scale(1);
    }
}

/* ===== ANIMATIONS DE NAVIGATION ===== */

/* Indicateur de page active animé */
.lds-nav-indicator {
    position: relative;
}

.lds-nav-indicator::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: var(--lds-primary);
    transform: translateX(-50%);
    transition: width 0.3s var(--lds-ease-out);
}

.lds-nav-indicator:hover::after,
.lds-nav-indicator.active::after {
    width: 100%;
}

/* Menu déroulant animé */
@keyframes lds-dropdown-open {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lds-dropdown-animated {
    animation: lds-dropdown-open 0.3s var(--lds-ease-out);
}

/* Breadcrumb animé */
.lds-breadcrumb-item {
    position: relative;
    display: inline-block;
    transition: color 0.2s;
}

.lds-breadcrumb-item::after {
    content: "›";
    margin: 0 0.5rem;
    color: var(--lds-gray-400);
    animation: lds-breadcrumb-arrow 0.3s var(--lds-ease-out);
}

@keyframes lds-breadcrumb-arrow {
    from {
        opacity: 0;
        transform: translateX(-5px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== ANIMATIONS DE CHARGEMENT AVANCÉES ===== */

/* Barres de chargement animées */
.lds-loading-bars {
    display: inline-flex;
    gap: 0.25rem;
}

.lds-loading-bars span {
    width: 0.25rem;
    height: 1.5rem;
    background-color: var(--lds-primary);
    animation: lds-bars 1.2s ease-in-out infinite;
}

.lds-loading-bars span:nth-child(1) { animation-delay: 0s; }
.lds-loading-bars span:nth-child(2) { animation-delay: 0.1s; }
.lds-loading-bars span:nth-child(3) { animation-delay: 0.2s; }
.lds-loading-bars span:nth-child(4) { animation-delay: 0.3s; }
.lds-loading-bars span:nth-child(5) { animation-delay: 0.4s; }

@keyframes lds-bars {
    0%, 40%, 100% {
        transform: scaleY(0.4);
    }
    20% {
        transform: scaleY(1);
    }
}

/* Cercle de progression animé */
.lds-progress-circle {
    position: relative;
    width: 3rem;
    height: 3rem;
}

.lds-progress-circle svg {
    transform: rotate(-90deg);
}

.lds-progress-circle-bg {
    fill: none;
    stroke: var(--lds-gray-200);
    stroke-width: 4;
}

.lds-progress-circle-fill {
    fill: none;
    stroke: var(--lds-primary);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    transition: stroke-dashoffset 0.5s var(--lds-ease-in-out);
}

.lds-progress-circle[data-percent="25"] .lds-progress-circle-fill {
    stroke-dashoffset: 75;
}

.lds-progress-circle[data-percent="50"] .lds-progress-circle-fill {
    stroke-dashoffset: 50;
}

.lds-progress-circle[data-percent="75"] .lds-progress-circle-fill {
    stroke-dashoffset: 25;
}

.lds-progress-circle[data-percent="100"] .lds-progress-circle-fill {
    stroke-dashoffset: 0;
}

/* ===== ANIMATIONS DE CONTENU ===== */

/* Effet de typing pour du texte */
@keyframes lds-typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

.lds-text-typing {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--lds-primary);
    animation: lds-typing 3s steps(40, end),
               lds-cursor 0.75s step-end infinite;
}

@keyframes lds-cursor {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: var(--lds-primary);
    }
}

/* Effet de révélation progressive */
@keyframes lds-reveal {
    from {
        clip-path: inset(0 100% 0 0);
    }
    to {
        clip-path: inset(0 0 0 0);
    }
}

.lds-reveal-text {
    animation: lds-reveal 1s var(--lds-ease-out) both;
}

/* Effet de zoom subtil sur les images */
.lds-img-zoom {
    overflow: hidden;
}

.lds-img-zoom img {
    transition: transform 0.5s var(--lds-ease-in-out);
}

.lds-img-zoom:hover img {
    transform: scale(1.1);
}

/* ===== ANIMATIONS D'ALERTE ET NOTIFICATION ===== */

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

.lds-shake {
    animation: lds-shake 0.5s;
}

/* Notification badge animé */
.lds-badge-ping {
    position: relative;
}

.lds-badge-ping::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: var(--lds-danger);
    opacity: 0.75;
    animation: lds-ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* ===== EFFETS DE SCROLL ===== */

/* Parallax simple */
.lds-parallax {
    transition: transform 0.5s var(--lds-ease-out);
}

.lds-parallax-slow {
    transform: translateY(calc(var(--scroll-y) * 0.5px));
}

.lds-parallax-fast {
    transform: translateY(calc(var(--scroll-y) * 1.5px));
}

/* Apparition au scroll */
.lds-scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s var(--lds-ease-out),
                transform 0.6s var(--lds-ease-out);
}

.lds-scroll-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== OPTIMISATIONS PERFORMANCE ===== */

/* Utilisation de will-change pour les animations fréquentes */
.lds-will-animate {
    will-change: transform, opacity;
}

/* GPU acceleration pour les animations complexes */
.lds-gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* ===== SUPPORT REDUCED MOTION (ACCESSIBILITÉ) ===== */

@media (prefers-reduced-motion: reduce) {
    /* Désactiver toutes les animations non essentielles */
    .lds-btn-ripple::before,
    .lds-btn-shine::after,
    .lds-card-tilt,
    .lds-img-zoom img {
        animation: none !important;
        transition: none !important;
    }
    
    /* Réduire la durée des animations essentielles */
    .lds-transition-all,
    .lds-transition-colors {
        transition-duration: 0.01ms !important;
    }
    
    /* Simplifier les indicateurs de chargement */
    .lds-loading-bars span,
    .lds-spinner {
        animation-duration: 0.01ms !important;
    }
}/*
================================================================================
LOCOTO DESIGN SYSTEM - ACCESSIBILITÉ ET UX AVANCÉE
================================================================================
Version: 1.0
Date: 2025-01-19
Description: Styles pour améliorer l'accessibilité selon les normes WCAG 2.1 AA
Phase 4.6 du plan d'harmonisation CSS
================================================================================
*/

/* ===== FOCUS MANAGEMENT ===== */

/* Focus visible amélioré pour tous les éléments interactifs */
:focus-visible {
    outline: 2px solid var(--lds-primary);
    outline-offset: 2px;
    border-radius: 0.25rem;
}

/* Focus spécifique pour les liens */
a:focus-visible {
    outline: 2px solid var(--lds-primary);
    outline-offset: 4px;
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

/* Focus pour les boutons */
.lds-btn:focus-visible,
button:focus-visible {
    outline: 3px solid var(--lds-primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(66, 136, 250, 0.1);
}

/* Focus pour les inputs */
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--lds-primary);
    outline-offset: 0;
    border-color: var(--lds-primary);
    box-shadow: 0 0 0 3px rgba(66, 136, 250, 0.1);
}

/* Skip to content link */
.lds-skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--lds-primary);
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 0 0 0.25rem 0.25rem;
    z-index: 10000;
    transition: top 0.2s;
}

.lds-skip-link:focus {
    top: 0;
}

/* ===== CONTRAST ET LISIBILITÉ ===== */

/* Mode haut contraste */
.lds-high-contrast {
    filter: contrast(1.2);
}

/* Texte avec meilleur contraste */
.lds-text-high-contrast {
    color: var(--lds-gray-900);
    font-weight: 500;
}

/* Background avec contraste garanti */
.lds-bg-accessible-light {
    background-color: #f8f9fa;
    color: #212529;
}

.lds-bg-accessible-dark {
    background-color: #212529;
    color: #f8f9fa;
}

/* Bordures visibles */
.lds-border-accessible {
    border: 2px solid var(--lds-gray-700);
}

/* ===== TAILLES ET ESPACEMENTS ACCESSIBLES ===== */

/* Zones de clic/touch minimales (44x44px selon WCAG) */
.lds-touch-target {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Espacement pour éviter les erreurs de clic */
.lds-spaced-targets > * {
    margin: 0.25rem;
}

/* Texte lisible minimum */
.lds-text-readable {
    font-size: 1rem;
    line-height: 1.5;
    letter-spacing: 0.01em;
}

/* ===== INDICATEURS VISUELS ===== */

/* Indicateur d'élément requis */
.lds-required::after {
    content: " *";
    color: var(--lds-danger);
    font-weight: bold;
    margin-left: 0.25rem;
}

/* Indicateur d'aide */
.lds-help-indicator {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    background-color: var(--lds-info);
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 1.25rem;
    font-size: 0.875rem;
    cursor: help;
    margin-left: 0.5rem;
}

/* États de validation accessibles */
.lds-input-valid {
    border-color: var(--lds-success);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2310b981'%3E%3Cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.25rem;
    padding-right: 2.5rem;
}

.lds-input-invalid {
    border-color: var(--lds-danger);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23ef4444'%3E%3Cpath fill-rule='evenodd' d='M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.25rem;
    padding-right: 2.5rem;
}

/* ===== NAVIGATION AU CLAVIER ===== */

/* Indicateur de navigation au clavier */
.lds-keyboard-only:not(:focus-visible) {
    outline: none;
}

/* Navigation par tabulation visible */
.lds-tab-navigation *:focus {
    outline: 2px dashed var(--lds-primary);
    outline-offset: 4px;
}

/* Ordre de tabulation explicite */
.lds-tab-first { tab-index: 1; }
.lds-tab-second { tab-index: 2; }
.lds-tab-third { tab-index: 3; }
.lds-tab-skip { tab-index: -1; }

/* ===== SCREEN READER SUPPORT ===== */

/* Texte uniquement pour lecteurs d'écran */
.lds-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Texte visible au focus (pour skip links) */
.lds-sr-only-focusable:focus {
    position: static;
    width: auto;
    height: auto;
    padding: 0.5rem 1rem;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* Annonces live pour lecteurs d'écran */
.lds-live-region {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ===== ARIA ENHANCEMENTS ===== */

/* Indicateurs d'état ARIA */
[aria-busy="true"] {
    cursor: wait;
    opacity: 0.7;
}

[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.5;
    pointer-events: none;
}

[aria-invalid="true"] {
    border-color: var(--lds-danger) !important;
}

[aria-selected="true"] {
    background-color: var(--lds-primary-light);
    font-weight: 600;
}

/* Régions ARIA landmark */
[role="banner"],
[role="navigation"],
[role="main"],
[role="complementary"],
[role="contentinfo"] {
    position: relative;
}

/* Labels pour les régions (dev mode) */
.lds-show-landmarks [role]::before {
    content: "Role: " attr(role);
    position: absolute;
    top: -1.5rem;
    left: 0;
    font-size: 0.75rem;
    color: var(--lds-info);
    background: white;
    padding: 0.125rem 0.25rem;
    border: 1px solid var(--lds-info);
    border-radius: 0.125rem;
    z-index: 1000;
}

/* ===== FORMULAIRES ACCESSIBLES ===== */

/* Groupes de champs avec légende */
.lds-fieldset {
    border: 1px solid var(--lds-gray-300);
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.lds-fieldset legend {
    font-weight: 600;
    padding: 0 0.5rem;
    background: white;
}

/* Labels associés */
.lds-form-group {
    margin-bottom: 1rem;
}

.lds-form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

/* Messages d'erreur accessibles */
.lds-error-message {
    color: var(--lds-danger);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
}

.lds-error-message::before {
    content: "⚠";
    margin-right: 0.25rem;
    font-size: 1rem;
}

/* ===== TABLEAUX ACCESSIBLES ===== */

/* En-têtes de tableau */
.lds-table-accessible th {
    background-color: var(--lds-gray-100);
    font-weight: 600;
    text-align: left;
    padding: 0.75rem;
}

/* Lignes alternées pour meilleure lisibilité */
.lds-table-striped tbody tr:nth-child(odd) {
    background-color: var(--lds-gray-50);
}

/* Focus sur les lignes */
.lds-table-accessible tbody tr:focus-within {
    outline: 2px solid var(--lds-primary);
    outline-offset: -2px;
}

/* ===== MODALES ACCESSIBLES ===== */

/* Focus trap indicator */
.lds-modal-accessible {
    position: relative;
}

.lds-modal-accessible::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid transparent;
    pointer-events: none;
    transition: border-color 0.2s;
}

.lds-modal-accessible:focus-within::before {
    border-color: var(--lds-primary);
}

/* ===== DARK MODE ACCESSIBILITY ===== */

@media (prefers-color-scheme: dark) {
    .lds-auto-dark {
        background-color: var(--lds-gray-900);
        color: var(--lds-gray-100);
    }
    
    .lds-auto-dark a {
        color: var(--lds-blue-400);
    }
    
    .lds-auto-dark .lds-btn {
        border-color: var(--lds-gray-600);
    }
}

/* ===== REDUCED MOTION ===== */

@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;
    }
    
    .lds-transition-all,
    .lds-transition-colors,
    .lds-transition-opacity,
    .lds-transition-transform {
        transition: none !important;
    }
}

/* ===== PRINT ACCESSIBILITY ===== */

@media print {
    /* Cacher les éléments non essentiels */
    .lds-no-print,
    nav,
    aside,
    footer,
    .lds-btn,
    .lds-modal {
        display: none !important;
    }
    
    /* Améliorer la lisibilité */
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: black;
        background: white;
    }
    
    /* Afficher les URLs des liens */
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.9em;
        color: #666;
    }
    
    /* Éviter les coupures de page */
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
    
    p, blockquote, ul, ol {
        page-break-inside: avoid;
    }
}

/* ===== RESPONSIVE TEXT ===== */

/* Tailles de texte fluides */
.lds-text-responsive {
    font-size: clamp(1rem, 2vw, 1.25rem);
    line-height: clamp(1.5, 2.5vw, 1.75);
}

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

/* Indicateur de chargement avec texte */
.lds-loading-accessible {
    position: relative;
}

.lds-loading-accessible::after {
    content: "Chargement en cours...";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ===== TOOLTIPS ACCESSIBLES ===== */

.lds-tooltip-accessible {
    position: relative;
}

.lds-tooltip-accessible:hover::after,
.lds-tooltip-accessible:focus::after {
    content: attr(aria-label);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--lds-gray-900);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 0.25rem;
}

/* ===== COULEURS ACCESSIBLES ===== */

/* Palette avec contraste WCAG AA garanti */
:root {
    --lds-a11y-text-on-light: #1a1a1a;
    --lds-a11y-text-on-dark: #ffffff;
    --lds-a11y-link-on-light: #0066cc;
    --lds-a11y-link-on-dark: #66b3ff;
    --lds-a11y-success: #008800;
    --lds-a11y-warning: #cc6600;
    --lds-a11y-error: #cc0000;
    --lds-a11y-info: #0066cc;
}/**
 * LDS Select Enhanced - Styles
 *
 * Composant de sélection amélioré avec recherche intégrée.
 * Compatible avec le Locoto Design System (LDS).
 */

/* Wrapper */
.lds-select-enhanced-wrapper {
  position: relative;
  width: 100%;
}

/* Trigger (bouton qui affiche la valeur sélectionnée) */
.lds-select-enhanced-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 38px;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--lds-text-gray-900, #111827);
  background-color: white;
  border: 1px solid var(--lds-border-gray-300, #d1d5db);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.lds-select-enhanced-trigger:hover {
  border-color: var(--lds-border-gray-400, #9ca3af);
}

.lds-select-enhanced-trigger:focus {
  outline: none;
  border-color: var(--lds-primary, #3b82f6);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.lds-select-enhanced-trigger[aria-expanded="true"] {
  border-color: var(--lds-primary, #3b82f6);
}

/* Texte du trigger */
.lds-select-enhanced-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Flèche du trigger */
.lds-select-enhanced-arrow {
  flex-shrink: 0;
  color: var(--lds-text-gray-500, #6b7280);
  transition: transform 0.2s ease;
}

.lds-select-enhanced-trigger[aria-expanded="true"] .lds-select-enhanced-arrow {
  transform: rotate(180deg);
}

/* Dropdown */
.lds-select-enhanced-dropdown {
  position: absolute;
  z-index: 50;
  width: 100%;
  background-color: white;
  border: 1px solid var(--lds-border-gray-300, #d1d5db);
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

/* Liste des options */
.lds-select-enhanced-options {
  max-height: 320px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Scrollbar personnalisée */
.lds-select-enhanced-options::-webkit-scrollbar {
  width: 6px;
}

.lds-select-enhanced-options::-webkit-scrollbar-track {
  background: var(--lds-bg-gray-100, #f3f4f6);
}

.lds-select-enhanced-options::-webkit-scrollbar-thumb {
  background-color: var(--lds-border-gray-300, #d1d5db);
  border-radius: 3px;
}

.lds-select-enhanced-options::-webkit-scrollbar-thumb:hover {
  background-color: var(--lds-border-gray-400, #9ca3af);
}

/* Option individuelle */
.lds-select-enhanced-option {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--lds-text-gray-900, #111827);
  cursor: pointer;
  transition: background-color 0.1s ease;
}

.lds-select-enhanced-option:hover,
.lds-select-enhanced-option.lds-bg-gray-100 {
  background-color: var(--lds-bg-gray-100, #f3f4f6);
}

.lds-select-enhanced-option[aria-selected="true"] {
  background-color: var(--lds-bg-primary-light, #dbeafe);
  color: var(--lds-text-primary-dark, #1d4ed8);
  font-weight: 500;
}

/* Champ de recherche dans le dropdown */
.lds-select-enhanced-dropdown input[type="text"] {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid var(--lds-border-gray-300, #d1d5db);
  border-radius: 0.375rem;
}

.lds-select-enhanced-dropdown input[type="text"]:focus {
  outline: none;
  border-color: var(--lds-primary, #3b82f6);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

/* État désactivé */
.lds-select-enhanced-wrapper.disabled .lds-select-enhanced-trigger {
  background-color: var(--lds-bg-gray-100, #f3f4f6);
  color: var(--lds-text-gray-500, #6b7280);
  cursor: not-allowed;
}

/* Animation d'ouverture */
.lds-select-enhanced-dropdown {
  animation: lds-select-dropdown-open 0.15s ease-out;
}

@keyframes lds-select-dropdown-open {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Positionnement vers le haut */
.lds-select-enhanced-dropdown.bottom-full {
  bottom: 100%;
  top: auto;
  margin-bottom: 0.25rem;
  margin-top: 0;
  animation: lds-select-dropdown-open-up 0.15s ease-out;
}

@keyframes lds-select-dropdown-open-up {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/**
 * connected-users-widget.css
 *
 * Styles pour le widget d'affichage des utilisateurs connectés.
 * Réservé au groupe Admin.
 *
 * Intégration avec le Locoto Design System (LDS)
 */

/* ============================================
   CONTAINER PRINCIPAL
   ============================================ */
.connected-users-widget {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* ============================================
   BOUTON PRINCIPAL
   ============================================ */
.connected-users-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
    font-size: 0.875rem;
}

.connected-users-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.connected-users-btn > .fas.fa-users {
    font-size: 1rem;
}

.connected-users-btn .caret-icon {
    font-size: 0.65rem;
    opacity: 0.7;
    margin-left: 2px;
}

/* ============================================
   BADGE DE NOTIFICATION
   ============================================ */
.connected-users-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 11px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 2px 8px rgba(34, 197, 94, 0.4);
    }
}

/* ============================================
   RÉSUMÉ VISIBLE (sans cliquer)
   ============================================ */
.connected-users-summary {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    padding-left: 8px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    margin-left: 4px;
}

.summary-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.summary-dot.active {
    background-color: #22c55e;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
}

.summary-dot.idle {
    background-color: #eab308;
    box-shadow: 0 0 6px rgba(234, 179, 8, 0.6);
}

.summary-dot.inactive {
    background-color: #ef4444;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}

/* ============================================
   MENU DROPDOWN
   ============================================ */
.connected-users-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 340px;
    max-width: 400px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--lds-gray-200, #e5e7eb);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    overflow: hidden;
}

.connected-users-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ============================================
   HEADER DU DROPDOWN
   ============================================ */
.connected-users-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid var(--lds-gray-200, #e5e7eb);
}

.connected-users-header span {
    color: var(--lds-gray-800, #1f2937);
    font-size: 0.9rem;
}

.refresh-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    color: var(--lds-gray-500, #6b7280);
    transition: all 0.2s ease;
}

.refresh-btn:hover {
    background: var(--lds-gray-200, #e5e7eb);
    color: var(--lds-gray-700, #374151);
}

.refresh-btn i {
    font-size: 0.85rem;
}

/* ============================================
   STATISTIQUES
   ============================================ */
.connected-users-stats {
    display: flex;
    justify-content: space-around;
    padding: 12px 16px;
    background: var(--lds-gray-50, #f9fafb);
    border-bottom: 1px solid var(--lds-gray-100, #f3f4f6);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: var(--lds-gray-600, #4b5563);
    font-weight: 500;
}

.stat-item i {
    font-size: 0.5rem;
}

.stat-item.stat-active i { color: #22c55e; }
.stat-item.stat-idle i { color: #eab308; }
.stat-item.stat-inactive i { color: #ef4444; }

/* ============================================
   DIVISEUR
   ============================================ */
.dropdown-divider {
    border: none;
    height: 1px;
    background: var(--lds-gray-200, #e5e7eb);
    margin: 0;
}

/* ============================================
   LISTE DES UTILISATEURS
   ============================================ */
.connected-users-list {
    max-height: 320px;
    overflow-y: auto;
    padding: 8px 0;
}

/* Indicateur de chargement */
.connected-users-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 30px;
    color: var(--lds-gray-500, #6b7280);
    font-size: 0.875rem;
}

/* Message vide */
.connected-users-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 30px;
    color: var(--lds-gray-400, #9ca3af);
    font-size: 0.875rem;
}

/* Message d'erreur */
.connected-users-error {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    color: #ef4444;
    font-size: 0.875rem;
}

/* ============================================
   ITEM UTILISATEUR
   ============================================ */
.connected-user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    transition: background-color 0.15s ease;
}

.connected-user-item:hover {
    background-color: var(--lds-gray-50, #f9fafb);
}

/* Avatar utilisateur */
.connected-user-avatar {
    position: relative;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
}

.user-avatar-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--lds-gray-200, #e5e7eb);
}

.connected-user-avatar > .fas.fa-user-circle {
    font-size: 40px;
    color: var(--lds-gray-300, #d1d5db);
}

/* Point de statut sur l'avatar */
.user-status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.user-status-dot.status-active {
    background-color: #22c55e;
}

.user-status-dot.status-idle {
    background-color: #eab308;
}

.user-status-dot.status-inactive {
    background-color: #ef4444;
}

/* Informations utilisateur */
.connected-user-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.user-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--lds-gray-800, #1f2937);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-status-text {
    font-size: 0.75rem;
    color: var(--lds-gray-500, #6b7280);
    display: flex;
    align-items: center;
    gap: 5px;
}

.user-status-text i {
    font-size: 0.5rem;
}

/* ============================================
   INDICATEUR "PLUS D'UTILISATEURS"
   ============================================ */
.connected-users-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    color: var(--lds-gray-500, #6b7280);
    font-size: 0.8rem;
    font-style: italic;
    background: var(--lds-gray-50, #f9fafb);
    border-top: 1px dashed var(--lds-gray-200, #e5e7eb);
}

/* ============================================
   LIEN "VOIR TOUTES LES SESSIONS"
   ============================================ */
.view-all-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    color: var(--lds-primary, #5cb5b5);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    background: var(--lds-gray-50, #f9fafb);
}

.view-all-link:hover {
    background: var(--lds-primary-light, #e6f4f4);
    color: var(--lds-primary-dark, #4a9a9a);
}

/* ============================================
   SCROLLBAR PERSONNALISÉE
   ============================================ */
.connected-users-list::-webkit-scrollbar {
    width: 6px;
}

.connected-users-list::-webkit-scrollbar-track {
    background: var(--lds-gray-100, #f3f4f6);
    border-radius: 3px;
}

.connected-users-list::-webkit-scrollbar-thumb {
    background: var(--lds-gray-300, #d1d5db);
    border-radius: 3px;
}

.connected-users-list::-webkit-scrollbar-thumb:hover {
    background: var(--lds-gray-400, #9ca3af);
}

/* ============================================
   ANIMATION DE ROTATION
   ============================================ */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.refresh-btn .fa-spin {
    animation: spin 1s linear infinite;
}

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

/* Masquer sur mobile */
@media (max-width: 767px) {
    .connected-users-widget {
        display: none !important;
    }
}

/* Tablettes - masquer le résumé */
@media (min-width: 768px) and (max-width: 1024px) {
    .connected-users-summary {
        display: none;
    }

    .connected-users-dropdown-menu {
        min-width: 300px;
    }
}

/* Petits écrans desktop */
@media (min-width: 1025px) and (max-width: 1280px) {
    .connected-users-summary span:not(.summary-dot) {
        display: none;
    }
}
/**
 * Styles pour les modals imbriqués
 * Locoto Manager - Version 1.0.0
 */

/* Wrapper pour les modals secondaires - CENTRAGE */
#lds-secondary-modal-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    pointer-events: none;
}

#lds-secondary-modal-wrapper > * {
    pointer-events: auto;
}

/* S'assurer que les modals dans le wrapper secondaire ont un z-index élevé */
#lds-secondary-modal-wrapper [data-lds-modal="harmonized"],
#lds-secondary-modal-wrapper .modal,
#lds-secondary-modal-wrapper .lds-modal {
    z-index: 1100 !important;
    position: relative;
    background: rgba(0, 0, 0, 0.5);
}

/* Base pour tous les modals */
.modal.lds-modal {
    transition: opacity 0.3s ease-in-out;
}

.modal.lds-modal.is-open {
    opacity: 1;
}

/* Modals imbriqués - CORRECTION Z-INDEX */
.modal.nested-modal {
    backdrop-filter: blur(2px);
    z-index: 1060 !important; /* Force minimum pour modals imbriqués */
}

.modal.nested-modal .lds-modal-container {
    transform: scale(0.98);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* S'assurer que les sous-modals sont toujours au-dessus */
.modal[id*="nested"], 
.modal[class*="nested"],
#modal-content-nested {
    z-index: 1070 !important;
}

/* Correction pour les modals avec z-index bas */
.modal[style*="z-index"] {
    position: fixed !important;
}

/* Modal avec priorité active */
.modal[data-modal-priority="active"] {
    position: relative;
}

.modal[data-modal-priority="active"]::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--lds-primary, #4fbcbd), var(--lds-primary-dark, #3a9a9b));
    border-radius: 14px;
    z-index: -1;
    opacity: 0.1;
}

.modal[data-modal-priority="active"] .lds-modal-container {
    transform: scale(1) !important;
    box-shadow: 0 25px 50px rgba(79, 188, 189, 0.2), 0 0 0 1px rgba(79, 188, 189, 0.1);
    border: 1px solid rgba(79, 188, 189, 0.1);
}

/* Animation d'entrée pour modals imbriqués */
.modal.nested-modal.is-open .lds-modal-container {
    transform: scale(1);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Z-index management agressif */
.modal[style*="z-index: 1050"] {
    /* Modal principal */
}

.modal[style*="z-index: 1060"],
.modal[style*="z-index: 1070"],
.modal[style*="z-index: 1080"] {
    /* Niveaux d'imbrication multiples */
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

/* Force l'affichage des modals imbriqués */
.modal.nested-modal[style*="display: block"] {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Backdrop pour modals imbriqués */
.modal.nested-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    z-index: -1;
}

/* Amélioration visuelle des formulaires dans modals imbriqués */
.nested-modal form {
    position: relative;
}

.nested-modal form.submitting,
.form-submitting {
    pointer-events: none;
    opacity: 0.7;
    position: relative;
}

.nested-modal form.submitting::after,
.form-submitting::after {
    content: '⏳ Envoi en cours...';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    font-size: 0.875rem;
    color: #374151;
    border-radius: 0.5rem;
    backdrop-filter: blur(2px);
}

/* Formulaires non prioritaires */
.modal:not([data-modal-priority="active"]) .modal-form {
    opacity: 0.8;
    pointer-events: none;
}

.modal[data-modal-priority="active"] .modal-form {
    opacity: 1;
    pointer-events: auto;
}

/* Indicateurs de chargement pour modals imbriqués */
.modal .htmx-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e5e7eb;
    color: #374151;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    z-index: 1000;
    font-size: 0.875rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(4px);
}

.modal .htmx-indicator.show,
.htmx-request .modal .htmx-indicator {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

/* Styles spéciaux pour les boutons dans modals imbriqués */
.nested-modal .btn {
    position: relative;
    z-index: 1;
}

/* Focus management pour modals imbriqués */
.nested-modal input:focus,
.nested-modal select:focus,
.nested-modal textarea:focus,
.modal[data-modal-priority="active"] input:focus,
.modal[data-modal-priority="active"] select:focus,
.modal[data-modal-priority="active"] textarea:focus {
    outline: none;
    ring: 2px;
    ring-color: rgba(79, 188, 189, 0.5);
    border-color: var(--lds-primary, #4fbcbd);
    box-shadow: 0 0 0 3px rgba(79, 188, 189, 0.1);
}

/* Boutons de soumission prioritaires */
.modal[data-modal-priority="active"] .modal-submit-btn {
    position: relative;
    z-index: 10;
}

.modal[data-modal-priority="active"] .modal-submit-btn:focus {
    box-shadow: 0 0 0 3px rgba(79, 188, 189, 0.3);
}

/* Indicateur visuel de priorité */
.modal[data-modal-priority="active"]::after {
    content: '🎯';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 12px;
    opacity: 0.5;
    z-index: 1000;
    pointer-events: none;
}

/* Responsive pour modals imbriqués */
@media (max-width: 768px) {
    .modal.nested-modal .lds-modal-container {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
    }
}

/* Animation de fermeture */
.modal.closing {
    opacity: 0;
    transition: opacity 0.2s ease-out;
}

.modal.closing .lds-modal-container {
    transform: scale(0.95);
    transition: transform 0.2s ease-out;
}

/* États de formulaire */
.form-submitting {
    position: relative;
}

.form-submitting::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-submitting::after {
    content: 'Envoi en cours...';
    font-size: 0.875rem;
    color: #6b7280;
}

/* BLOCAGE VISUEL FORT pour formulaires bloqués par modal imbriqué */
.form-blocked-by-nested {
    pointer-events: none !important;
    opacity: 0.3 !important;
    filter: blur(1px) !important;
    position: relative;
    transition: all 0.3s ease;
}

.form-blocked-by-nested::before {
    content: '⏳ Modal imbriqué actif - Formulaire bloqué';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 0, 0, 0.9);
    color: white;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: bold;
    z-index: 1000;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 2px solid #ef4444;
}

/* Modal principal masqué quand sous-modal ouvert */
body:has(.modal[id*="modal-nested-"]) .modal:not([id*="modal-nested-"]) {
    opacity: 0.3 !important;
    pointer-events: none !important;
    filter: blur(2px) !important;
}

/* Animation de pulsation pour modal bloqué */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* Bloquer TOUS les boutons submit du modal principal */
body:has(.modal[id*="modal-nested-"]) .modal:not([id*="modal-nested-"]) button[type="submit"] {
    pointer-events: none !important;
    opacity: 0.3 !important;
    cursor: not-allowed !important;
}

body:has(.modal[id*="modal-nested-"]) .modal:not([id*="modal-nested-"]) input,
body:has(.modal[id*="modal-nested-"]) .modal:not([id*="modal-nested-"]) select,
body:has(.modal[id*="modal-nested-"]) .modal:not([id*="modal-nested-"]) textarea {
    pointer-events: none !important;
    opacity: 0.5 !important;
}/* Styles complémentaires harmonisés pour le tableau d'opérations dans les modals */
#lds-modal-wrapper #modal-selection-operations .lds-table-operations {
	width: 100%;
	table-layout: fixed;
	border-collapse: separate;
	border-spacing: 0;
}
#lds-modal-wrapper #modal-selection-operations .lds-table-operations thead {
	display: table-header-group;
}
#lds-modal-wrapper #modal-selection-operations .lds-table-operations tbody {
	display: table-row-group;
}
#lds-modal-wrapper #modal-selection-operations .lds-table-operations tr {
	display: table-row;
}
#lds-modal-wrapper #modal-selection-operations .lds-table-operations th,
#lds-modal-wrapper #modal-selection-operations .lds-table-operations td {
	display: table-cell;
	vertical-align: middle;
	white-space: normal;
}

/* Harmonisation des paddings et fonts */
#lds-modal-wrapper #modal-selection-operations .lds-table-operations th {
	font-weight: 600;
	color: var(--lds-secondary-700, #475569);
}
#lds-modal-wrapper #modal-selection-operations .lds-table-operations td {
	color: var(--lds-gray-800, #1f2937);
}

