/* Définition des couleurs UVCI */
:root {
    --uvci-green: #18a855; /* Vert UVCI */
    --uvci-purple: #8e1582; /* Violet UVCI */
    --uvci-bg-dark: #0f0814; /* Fond très sombre teinté de violet */
}

/* Reset et immersion */
.avatar-workspace {
    background-color: var(--uvci-bg-dark);
    color: #e0e0e0;
    font-family: "DM Sans", sans-serif;
    padding-top: 90px;
    padding-bottom: 20px;
    height: 100vh;
    min-height: 600px; /* Empêche la zone globale de s'écraser au-delà du raisonnable */
    display: flex;
    flex-direction: column;
}

.game-lobby-container {
    flex: 1;
    position: relative;
    width: 100%;
    background: radial-gradient(
        circle at 50% 60%,
        #201026 0%,
        var(--uvci-bg-dark) 70%
    );
    border: 1px solid rgba(142, 21, 130, 0.15);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.8);
}

/* Grille de fond 3D */
.game-lobby-container::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(142, 21, 130, 0.15) 1px, transparent 1px),
        linear-gradient(90deg, rgba(142, 21, 130, 0.15) 1px, transparent 1px);
    background-size: 40px 40px;
    transform: perspective(500px) rotateX(60deg) translateY(100px) scale(3);
    transform-origin: bottom center;
    pointer-events: none;
}

/* Zone du modèle 3D */
.canvas-zone {
    flex-grow: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
    overflow: hidden;
}

/* LOADER */
.loader-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 8, 20, 0.85);
    backdrop-filter: blur(6px);
    z-index: 20;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--uvci-green);
    font-family: "Syne", sans-serif;
    font-weight: 700;
    letter-spacing: 2px;
    transition: opacity 0.3s ease;
}
.tactical-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(24, 168, 85, 0.2);
    border-top-color: var(--uvci-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}
@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* Halo lumineux au sol */
.avatar-spotlight {
    position: absolute;
    bottom: 10%;
    width: 300px;
    height: 50px;
    background: radial-gradient(
        ellipse at center,
        rgba(24, 168, 85, 0.35) 0%,
        transparent 70%
    );
    border-radius: 50%;
    filter: blur(15px);
    z-index: 0;
}

/* Configuration du composant 3D */
model-viewer {
    width: 100%;
    height: 90%;
    z-index: 2;
    --poster-color: transparent;
}

#avatar-3d-viewer {
    animation: float 5s ease-in-out infinite;
}

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

/* ---- PANNEAU HUD (INVENTAIRE) ---- */
.hud-panel {
    position: relative;
    z-index: 10;
    background: rgba(20, 10, 26, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-left: 1px solid rgba(142, 21, 130, 0.2);
    width: 480px;
    display: flex;
    flex-direction: column;
    padding: 24px;
    transition: transform 0.3s ease-in-out;
    max-height: 100%; /* S'assure de ne pas déborder en hauteur */
}

.hud-title {
    font-family: "Syne", sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.9rem;
    color: #fff;
    border-bottom: 2px solid var(--uvci-purple);
    padding-bottom: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0; /* Le titre ne s'écrase jamais */
}

/* CORRECTION DÉFINITIVE DE LA GRILLE ET DU SCROLL */
.avatar-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: max-content; /* Force la grille à respecter la hauteur des carrés */
    gap: 12px;

    /* C'est ça la magie : flex: 1 + min-height: 0 active le scroll interne sans écraser */
    flex: 1;
    min-height: 0;
    overflow-y: auto;

    padding-right: 5px;
    margin-bottom: 20px;
    align-content: start;
}
.avatar-grid::-webkit-scrollbar {
    width: 4px;
}
.avatar-grid::-webkit-scrollbar-thumb {
    background: var(--uvci-purple);
    border-radius: 4px;
}

/* VERROUILLAGE DES SLOTS AVATARS */
.avatar-slot {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;

    /* Force le format carré strict et empêche la compression */
    aspect-ratio: 1 / 1;
    min-height: 130px; /* GARANTIE ANTI-ÉCRASEMENT */

    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    overflow: hidden;
    display: block;
}

.avatar-slot img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: transform 0.3s ease;
}

.avatar-admin-actions {
    position: absolute;
    top: 2px;
    left: 4px;
    z-index: 4;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
}

.avatar-slot.active .avatar-admin-actions {
    opacity: 1;
    pointer-events: auto;
}

.avatar-admin-menu-btn {
    width: 22px;
    height: 22px;
    top : 0;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    background: rgba(10, 14, 22, 0.85);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.avatar-admin-menu-btn i {
    font-size: 0.65rem;
}

.avatar-admin-menu-btn:hover {
    background: rgba(26, 33, 46, 0.9);
    border-color: rgba(255, 255, 255, 0.48);
}

.avatar-admin-menu {
    display: none;
    position: absolute;
    top: 30px;
    left: 0;
    min-width: 122px;
    background: rgba(9, 12, 19, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    padding: 5px;
    backdrop-filter: blur(4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.52);
    z-index: 6;
}

.avatar-admin-menu.open {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.avatar-admin-menu-item {
    border: none;
    border-radius: 5px;
    background: transparent;
    color: #e5e7eb;
    text-align: left;
    font-size: 0.72rem;
    padding: 6px 8px;
    cursor: pointer;
}

.avatar-admin-menu-item i {
    width: 12px;
    margin-right: 6px;
}

.avatar-admin-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.avatar-admin-menu-item.danger:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fecaca;
}

.avatar-slot:hover {
    border-color: var(--uvci-purple);
    background: rgba(142, 21, 130, 0.15);
}
.avatar-slot:hover img {
    transform: scale(1.1);
}

.avatar-slot.active {
    border-color: var(--uvci-green);
    box-shadow: 0 0 15px rgba(24, 168, 85, 0.3);
}
.avatar-slot.active::after {
    content: "ÉQUIPÉ";
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6rem;
    font-weight: bold;
    background: var(--uvci-green);
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    z-index: 2;
}

.avatar-slot.user-avatar-inactive {
    border-color: rgba(163, 170, 186, 0.8);
    box-shadow: 0 0 12px rgba(163, 170, 186, 0.22);
}

.avatar-slot.user-avatar-inactive::after {
    content: "EQUIPE";
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6rem;
    font-weight: bold;
    background: #9ca3af;
    color: #111827;
    padding: 3px 8px;
    border-radius: 4px;
    z-index: 2;
}

/* Badge coche verte en haut à droite */
.avatar-badge-check {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, var(--uvci-green) 0%, #0fd67b 100%);
    border-radius: 50%;
    z-index: 3;
    box-shadow: 0 0 8px rgba(24, 168, 85, 0.4), 0 2px 6px rgba(0, 0, 0, 0.2);
    animation: badgePulse 2s ease-in-out infinite;
}

.avatar-badge-check i {
    color: white;
    font-size: 1rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.avatar-badge-check--inactive {
    background: linear-gradient(135deg, #9ca3af 0%, #cbd5e1 100%);
    box-shadow: 0 0 8px rgba(156, 163, 175, 0.35), 0 2px 6px rgba(0, 0, 0, 0.2);
    animation: none;
}

.avatar-badge-check--inactive i {
    color: #1f2937;
    text-shadow: none;
}

@keyframes badgePulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(24, 168, 85, 0.5), 0 4px 8px rgba(0, 0, 0, 0.3);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 20px rgba(24, 168, 85, 0.8), 0 4px 12px rgba(0, 0, 0, 0.4);
        transform: scale(1.05);
    }
}

/* Bouton d'action principal */
.btn-tactical {
    flex-shrink: 0; /* Empêche le bouton de s'écraser */
    margin-top: auto;
    background: var(--uvci-green);
    color: #fff;
    font-family: "Syne", sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    padding: 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    clip-path: polygon(
        10px 0,
        100% 0,
        100% calc(100% - 10px),
        calc(100% - 10px) 100%,
        0 100%,
        0 10px
    );
}
.btn-tactical:hover {
    background: #148f47;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(24, 168, 85, 0.4);
}

/* ---- RESPONSIVE MOBILE ---- */
.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1040;
}

.btn-open-inventory {
    display: none;
    position: absolute;
    bottom: 30px;
    right: 20px;
    background: rgba(15, 8, 20, 0.9);
    border: 1px solid var(--uvci-green);
    color: var(--uvci-green);
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    z-index: 9;
    box-shadow: 0 0 15px rgba(24, 168, 85, 0.2);
}

.btn-close-inventory {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
}

@media (max-width: 991.98px) {
    .hud-panel {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 350px;
        max-width: 85vw;
        z-index: 1050;
        transform: translateX(100%);
        border-left: 1px solid rgba(142, 21, 130, 0.3);
    }
    .hud-panel.open {
        transform: translateX(0);
    }
    .avatar-grid {
        gap: 6px;
    }
    .avatar-slot {
        min-height: 82px;
    }

    .avatar-admin-actions {
        top: 2px;
        left: 4px;
    }

    .avatar-admin-menu-btn {
        width: 18px;
        height: 18px;
    }

    .avatar-admin-menu-btn i {
        font-size: 0.55rem;
    }

    .avatar-admin-menu {
        top: 20px;
        left: 0;
        min-width: 80px;
        max-width: calc(100% - 6px);
        padding: 2px;
    }

    .avatar-admin-menu.open {
        gap: 2px;
    }

    .avatar-admin-menu-item {
        font-size: 0.58rem;
        line-height: 1.1;
        padding: 3px 4px;
    }

    .avatar-admin-menu-item i {
        width: 9px;
        margin-right: 4px;
        font-size: 0.56rem;
    }

    .mobile-overlay.open {
        display: block;
    }
    .btn-open-inventory {
        display: block;
    }
    .btn-close-inventory {
        display: block;
    }

    .avatar-workspace {
        padding-top: 72px;
        padding-bottom: 0;
        height: calc(100vh - 72px);
        min-height: auto;
    }
    .game-lobby-container {
        border-radius: 0;
        border: none;
    }
}



/* Css pour le header de l'avatar creator */
/* ===== Header Background ===== */

.avatar-header {
    background: linear-gradient(135deg, #0a0614 0%, #1a0f2e 50%, #0f0825 100%);
    position: relative;
    overflow: hidden;
}

.overlay-gradient {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 30% 20%, rgba(124, 92, 252, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(0, 229, 160, 0.05) 0%, transparent 50%);
    animation: subtleMove 20s ease-in-out infinite alternate;
}

.overlay-grid {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.4;
}

.overlay-glass {
    position: absolute;
    top: 20%;
    right: 10%;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(124, 92, 252, 0.03);
    backdrop-filter: blur(40px);
    border: 1px solid rgba(124, 92, 252, 0.08);
    animation: float 25s ease-in-out infinite;
}

.content-wrapper {
    position: relative;
    z-index: 2;
}

/* ===== Typography ===== */

.page-header-content h1 {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 2.5rem;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    letter-spacing: 0.02em;
}

.page-header-content .lead {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
}

/* ===== Badge + Button ===== */

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(0, 229, 160, 0.08);
    border: 1px solid rgba(0, 229, 160, 0.2);
    border-radius: 50px;
    font-size: 0.85rem;
    color: #00e5a0;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background: #00e5a0;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* Soft Button */

/* Bouton "Ajouter nouvel avatar" Amélioré */
.btn-soft-add {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 24px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 50px;
    /* Effet Glassmorphism */
    background: rgba(124, 92, 252, 0.1); 
    border: 1px solid rgba(124, 92, 252, 0.4);
    color: #ffffff;
    backdrop-filter: blur(10px);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-soft-add i {
    font-size: 1.1rem;
    color: #00e5a0; /* Rappel du vert émeraude du badge */
    transition: transform 0.3s ease;
}

.btn-soft-add:hover {
    background: rgba(124, 92, 252, 0.2);
    border-color: #7c5cfc;
    box-shadow: 0 0 20px rgba(124, 92, 252, 0.3);
    transform: translateY(-2px);
    color: #fff;
}

.btn-soft-add:hover i {
    transform: rotate(90deg);
    color: #ffffff;
}

.btn-soft-add:active {
    transform: translateY(0);
}

/* Optionnel : Ajout d'un petit reflet qui passe sur le bouton */
.btn-soft-add::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 20%;
    height: 200%;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(30deg);
    transition: all 0.6s ease;
}

.btn-soft-add:hover::after {
    left: 120%;
}

/* ===== Animations ===== */

@keyframes subtleMove {
    0% { transform: translate(0,0); }
    100% { transform: translate(20px,-10px); }
}

@keyframes float {
    0%,100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-20px) scale(1.05); }
}

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

/* Responsive */

@media (max-width: 768px) {
    .page-header-content h1 {
        font-size: 2rem;
    }
    .page-header-content .lead {
        font-size: 1rem;
    }
}



/* CSS POUR LE POPUP */
.avatar-modal-scope {
        --modal-bg: #0a0514;
        --accent-v: #7c5cfc;
        --accent-p: #ff7bf0;
        --border: rgba(255, 255, 255, 0.1);
        --glass: rgba(255, 255, 255, 0.03);
        --danger: #ff4757;
    }

    .avmStatus-option{
        background: #0a0514;
        color: #ffffff;
    }

    /* --- SCROLLBAR --- */
    .avatar-modal-scope .modal-container::-webkit-scrollbar { width: 8px; }
    .avatar-modal-scope .modal-container::-webkit-scrollbar-track { background: var(--modal-bg); }
    .avatar-modal-scope .modal-container::-webkit-scrollbar-thumb { 
        background: rgba(255, 255, 255, 0.1); border-radius: 10px; border: 2px solid var(--modal-bg); 
    }

    /* --- ANIMATIONS DE CLIC --- */
    .avatar-modal-scope button, 
    .avatar-modal-scope .radio-card-inner, 
    .avatar-modal-scope .upload-zone {
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .avatar-modal-scope button:active, 
    .avatar-modal-scope .radio-card:active { transform: scale(0.95); }

    /* --- LAYOUT --- */
    .avatar-modal-scope .modal-backdrop {
        display: none; position: fixed; inset: 0; z-index: 99999;
        background: rgba(0, 0, 0, 0.85); backdrop-filter: blur(12px);
        align-items: center; justify-content: center; padding: 20px;
    }
    .avatar-modal-scope .modal-backdrop.active { display: flex; animation: fadeIn 0.3s ease; }

    .avatar-modal-scope .modal-container {
        background: var(--modal-bg); width: 100%; max-width: 800px;
        border-radius: 24px; border: 1px solid var(--border); color: #fff;
        max-height: 90vh; overflow-y: auto; position: relative;
    }

    .avatar-modal-scope .modal-header { padding: 30px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 25px; }
    .avatar-modal-scope .header-top { display: flex; justify-content: space-between; align-items: flex-start; width: 100%; }

    .avatar-modal-scope .form-steps { display: flex; align-items: center; justify-content: space-between; width: 100%; }
    .avatar-modal-scope .step-item { display: flex; align-items: center; gap: 10px; opacity: 0.3; transition: 0.5s ease; }
    .avatar-modal-scope .step-item.active { opacity: 1; color: var(--accent-v); }
    .avatar-modal-scope .step-num { width: 28px; height: 28px; background: var(--glass); border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); font-size: 0.8rem; }
    .avatar-modal-scope .step-line { height: 1px; background: var(--border); flex-grow: 1; margin: 0 15px; }

    /* --- FORMULAIRE --- */
    .avatar-modal-scope .form-section { padding: 30px; }
    .avatar-modal-scope .form-group { margin-bottom: 20px; }
    .avatar-modal-scope label { display: block; margin-bottom: 8px; font-size: 0.9rem; color: #ccc; }
    .avatar-modal-scope .form-input { width: 100%; background: var(--glass); border: 1px solid var(--border); border-radius: 12px; padding: 12px; color: #fff; outline: none; transition: 0.3s; }
    .avatar-modal-scope .form-input:focus { border-color: var(--accent-v); background: rgba(124, 92, 252, 0.05); }

    /* styles pour l'alerte de validation */
    .avatar-modal-scope .custom-alert {
        background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
        color: white;
        padding: 15px 20px;
        border-radius: 8px;
        margin-bottom: 20px;
        border-left: 4px solid #ff0000;
        position: relative;
        box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    }
    .avatar-modal-scope .custom-alert .close-alert {
        position: absolute;
        top: 10px;
        right: 15px;
        background: none;
        border: none;
        color: #fff;
        font-size: 1.2rem;
        cursor: pointer;
        padding: 0;
        line-height: 1;
    }
    .avatar-modal-scope .custom-alert .close-alert:hover {
        color: #ffbbbb;
    }

    .avatar-modal-scope .radio-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
    .avatar-modal-scope .radio-card input { position: absolute; opacity: 0; }
    .avatar-modal-scope .radio-card-inner { background: var(--glass); border: 1px solid var(--border); border-radius: 12px; padding: 15px; text-align: center; cursor: pointer; }
    .avatar-modal-scope .radio-card input:checked + .radio-card-inner { border-color: var(--accent-v); background: rgba(124, 92, 252, 0.1); box-shadow: 0 0 15px rgba(124, 92, 252, 0.1); }

    /* --- UPLOAD ZONE & FILE INFO --- */
    .avatar-modal-scope .upload-zone { border: 2px dashed var(--border); border-radius: 15px; padding: 25px; text-align: center; cursor: pointer; background: rgba(255,255,255,0.01); position: relative; }
    .avatar-modal-scope .upload-zone:hover { border-color: var(--accent-v); background: rgba(124, 92, 252, 0.03); }
    
    .avatar-modal-scope .file-badge {
        display: inline-flex; align-items: center; gap: 10px; background: rgba(24, 168, 85, 0.1); 
        border: 1px solid rgba(24, 168, 85, 0.3); padding: 8px 15px; border-radius: 50px; margin-top: 10px;
        animation: slideUp 0.3s ease;
    }
    .avatar-modal-scope .remove-file { color: var(--danger); cursor: pointer; font-weight: bold; padding: 0 5px; font-size: 1.2rem; }
    .avatar-modal-scope .remove-file:hover { filter: brightness(1.2); }

    .avatar-modal-scope .modal-footer { padding: 20px 30px; background: rgba(0,0,0,0.2); display: flex; justify-content: flex-end; gap: 15px; }
    .avatar-modal-scope .btn-submit {
        background: var(--accent-v);
        border: none;
        color: #fff;
        padding: 12px 35px;
        border-radius: 50px;
        font-weight: bold;
        cursor: pointer;
        box-shadow: 0 4px 15px rgba(124, 92, 252, 0.3);
        position: relative;
        overflow: hidden;
        transition: all 0.3s ease;
    }
    .avatar-modal-scope .btn-submit::after {
        content: '';
        position: absolute;
        top: -50%;
        left: -60%;
        width: 20%;
        height: 200%;
        background: rgba(255,255,255,0.15);
        transform: rotate(30deg);
        transition: all 0.5s ease;
    }
    .avatar-modal-scope .btn-submit:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 30px rgba(124,92,252,0.45);
    }
    .avatar-modal-scope .btn-submit:hover::after {
        left: 120%;
    }
    .avatar-modal-scope .btn-submit:disabled {
        opacity: 0.7;
        cursor: not-allowed;
        transform: none;
    }
    @keyframes shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }

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

    /* --- STYLE DES CHAMPS EN ERREUR --- */
    .form-group.field-error .radio-cards {
        border: 2px solid #ff5a5a !important;
        border-radius: 8px;
        padding: 12px;
        box-shadow: 0 0 10px rgba(255, 90, 90, 0.2);
    }

    .form-group.field-error #avmUrl {
        border-color: #ff5a5a !important;
        box-shadow: 0 0 8px rgba(255, 90, 90, 0.3) !important;
    }

    .form-group.field-error #dropZone {
        border-color: #ff5a5a !important;
        box-shadow: 0 0 8px rgba(255, 90, 90, 0.3) !important;
    }





    /* --- STYLE DU TOAST --- */
    .toast-success {
        position: fixed;
        top: 30px;
        right: 30px;
        background: linear-gradient(135deg, rgba(15, 8, 25, 0.98), rgba(10, 4, 18, 0.98));
        border: 1px solid rgba(24, 168, 85, 0.35);
        border-radius: 16px;
        padding: 12px 16px;
        display: flex;
        align-items: center;
        gap: 12px;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(24, 168, 85, 0.1);
        z-index: 9999;
        /* État initial (caché) */
        transform: translateY(-20px);
        opacity: 0;
        pointer-events: none;
        transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    /* État affiché (via JS) */
    .toast-success.show {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .toast-icon {
        width: 28px;
        height: 28px;
        border-radius: 50%;
        background: rgba(24, 168, 85, 0.12);
        border: 1px solid rgba(24, 168, 85, 0.25);
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--uvci-green);
        flex-shrink: 0;
        font-size: 0.85rem;
    }

    .toast-text {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .toast-text strong {
        font-family: 'Syne', sans-serif;
        font-size: 0.85rem;
        color: #fff;
    }

    .toast-text span {
        font-size: 0.75rem;
        color: rgba(255, 255, 255, 0.7);
    }

    /* --- TOAST D'ERREUR --- */
    .toast-error {
        position: fixed;
        top: 30px;
        right: 30px;
        background: linear-gradient(135deg, rgba(30, 8, 8, 0.98), rgba(20, 4, 4, 0.98));
        border: 1px solid rgba(255, 71, 87, 0.35);
        border-radius: 16px;
        padding: 12px 16px;
        display: flex;
        align-items: center;
        gap: 12px;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(255, 71, 87, 0.1);
        z-index: 9999;
        /* État initial (caché) */
        transform: translateY(-20px);
        opacity: 0;
        pointer-events: none;
        transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    /* État affiché (via JS) */
    .toast-error.show {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .toast-error .toast-icon {
        background: rgba(255, 71, 87, 0.12);
        border-color: rgba(255, 71, 87, 0.25);
        color: #ff4757;
    }

    .toast-error .toast-text strong {
        color: #ff7bf0;
    }

/* Messages d'avatar stylés */
.avatar-message {
    margin-bottom: 15px;
    flex-shrink: 0;
}

.avatar-message .alert {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    font-family: "DM Sans", sans-serif;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    animation: slideInDown 0.3s ease-out;
}

.avatar-message .alert-success {
    background: linear-gradient(135deg, rgba(24, 168, 85, 0.95) 0%, rgba(15, 214, 123, 0.95) 100%);
    color: #fff;
    border-left: 4px solid var(--uvci-green);
}

.avatar-message .alert-danger {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.95) 0%, rgba(200, 35, 51, 0.95) 100%);
    color: #fff;
    border-left: 4px solid #dc3545;
}

.avatar-message .alert i {
    font-size: 1.1rem;
    margin-right: 8px;
}

.avatar-message .alert {
    position: relative; /* needed for absolute close */
}

.avatar-message .alert .close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    color: inherit;
    opacity: 0.7;
    font-size: 1.1rem;
    padding: 0;
    cursor: pointer;
    transition: opacity 0.2s ease;
    line-height: 1;
}

.avatar-message .alert .close:hover {
    opacity: 1;
}

.avatar-message .alert .avatar-message-close {
    position: absolute !important;
    top: 50% !important;
    right: 14px !important;
    transform: translateY(-50%) !important;
    background: none !important;
    border: none !important;
    color: inherit !important;
    opacity: 0.7 !important;
    font-size: 1.1rem !important;
    padding: 0 !important;
    cursor: pointer !important;
    transition: opacity 0.2s ease !important;
    line-height: 1 !important;
    z-index: 10 !important;
    box-shadow: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 24px !important;
    width: 24px !important;
}

.avatar-message .alert .avatar-message-close:hover {
    opacity: 1 !important;
}

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

/* CSS pour le filtre d'avatars */
.avatar-filter{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin-bottom:12px;
    font-size:13px;
    justify-content:flex-start;
}

.filter-chip{
    cursor:pointer;
    flex-shrink:0;
}

.filter-chip input{
    display:none;
}

.filter-chip span{
    display:flex;
    align-items:center;
    gap:4px;
    padding:4px 10px;
    border-radius:18px;
    border:1px solid #ddd;
    background:#f7f7f7;
    font-weight:500;
    color:#555;
    position:relative;
    transition:all .2s ease;
    white-space:nowrap;
}

/* Hover */
.filter-chip span:hover{
    background:#ececff;
    border-color:#c7ccff;
}

/* Sélection */
.filter-chip input:checked + span{
    background:#6366f1;
    color:white;
    border-color:#6366f1;
}

/* Coche verte, par défaut invisible */
.check-icon{
    display:none;
    margin-left:6px;
    font-size:12px;
    color:#10b981; /* Vert clair */
}

/* Affiche la coche quand sélectionné */
.filter-chip input:checked + span .check-icon{
    display:inline-block;
}

/* Couleur icône par genre */
.female-chip i:first-child{ color:#e85d9e; }
.male-chip i:first-child{ color:#3b82f6; }
.all-chip i:first-child{ color:#6b7280; }

/* Couleur icône quand sélectionné */
.filter-chip input:checked + span i:first-child{ color:white; }

/* Mobile : réduire la taille et l’espace */
@media (max-width: 480px){
    .avatar-filter{
        gap:6px;
    }
    .filter-chip span{
        padding:3px 8px;
        font-size:12px;
        border-radius:16px;
    }
    .filter-chip span i{
        font-size:12px;
    }
}

/* Confirm Delete Modal */
.confirm-delete-modal{
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(124, 92, 252, 0.15) 0%, transparent 45%),
        radial-gradient(circle at 80% 75%, rgba(24, 168, 85, 0.1) 0%, transparent 40%),
        rgba(4, 6, 12, 0.78);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}

.confirm-delete-modal.active{
    opacity: 1;
    pointer-events: auto;
}

.confirm-delete-box{
    position: relative;
    width: min(420px, calc(100vw - 24px));
    border-radius: 16px;
    padding: 24px 22px 18px;
    text-align: center;
    color: #f3f4f6;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: linear-gradient(165deg, rgba(16, 10, 30, 0.98) 0%, rgba(10, 8, 20, 0.98) 100%);
    box-shadow:
        0 24px 50px rgba(0, 0, 0, 0.62),
        inset 0 0 0 1px rgba(124, 92, 252, 0.2);
    animation: pop 0.25s ease;
    overflow: hidden;
}

.confirm-delete-box::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(135deg, rgba(124, 92, 252, 0.14) 0%, transparent 45%),
        linear-gradient(315deg, rgba(255, 59, 59, 0.14) 0%, transparent 45%);
}

.confirm-delete-icon{
    width: 56px;
    height: 56px;
    margin: 0 auto 10px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.65rem;
    color: #ffb4b4;
    border: 1px solid rgba(255, 95, 95, 0.42);
    background: radial-gradient(circle at 35% 30%, rgba(255, 118, 118, 0.18) 0%, rgba(255, 59, 59, 0.08) 70%);
    box-shadow: 0 0 20px rgba(255, 59, 59, 0.24);
}

.confirm-delete-box h3 {
    position: relative;
    margin: 0;
    font-family: "Syne", sans-serif;
    letter-spacing: 0.02em;
    font-size: 1.18rem;
    color: #ffffff;
}

.confirm-delete-box p {
    position: relative;
    margin: 8px 0 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.74);
}

.confirm-delete-actions{
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 18px;
}

.confirm-delete-box .btn-cancel,
.confirm-delete-box .btn-delete {
    min-height: 40px;
    padding: 9px 10px;
    border-radius: 9px;
    border: 1px solid transparent;
    cursor: pointer;
    font-family: "Syne", sans-serif;
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.confirm-delete-box .btn-cancel {
    background: linear-gradient(180deg, rgba(73, 80, 96, 0.85) 0%, rgba(49, 54, 69, 0.95) 100%);
    border-color: rgba(167, 175, 191, 0.35);
    color: #e5e7eb;
}

.confirm-delete-box .btn-cancel:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 14px rgba(0, 0, 0, 0.28);
    border-color: rgba(200, 207, 222, 0.55);
}

.confirm-delete-box .btn-delete {
    background: linear-gradient(180deg, #ff5757 0%, #d62828 100%);
    border-color: rgba(255, 175, 175, 0.35);
    color: #fff;
    box-shadow: 0 10px 16px rgba(214, 40, 40, 0.28);
}

.confirm-delete-box .btn-delete:hover {
    transform: translateY(-1px);
    background: linear-gradient(180deg, #ff6d6d 0%, #e03131 100%);
    box-shadow: 0 12px 20px rgba(224, 49, 49, 0.34);
}

.confirm-delete-box .btn-cancel:active,
.confirm-delete-box .btn-delete:active {
    transform: translateY(0);
}

.edit-avatar-box .confirm-delete-icon.edit-avatar-icon {
    color: #bcf7d5;
    border-color: rgba(24, 168, 85, 0.4);
    background: radial-gradient(circle at 35% 30%, rgba(64, 224, 142, 0.22) 0%, rgba(24, 168, 85, 0.08) 70%);
    box-shadow: 0 0 20px rgba(24, 168, 85, 0.24);
}

.edit-avatar-fields {
    position: relative;
    margin-top: 12px;
    display: grid;
    gap: 8px;
    text-align: left;
}

.edit-avatar-fields label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.82);
}

.edit-avatar-inline {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.edit-avatar-inline label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.68rem;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
}

.edit-avatar-inline input[type="radio"] {
    accent-color: var(--uvci-green);
}

.edit-avatar-input {
    width: 100%;
    min-height: 36px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.04);
    color: #ffffff;
    padding: 8px 10px;
    font-size: 0.78rem;
}

.edit-avatar-input[type="file"] {
    min-height: auto;
    padding: 7px 8px;
    font-size: 0.7rem;
}

.edit-avatar-input[type="file"]::file-selector-button {
    margin-right: 8px;
    border: 1px solid rgba(24, 168, 85, 0.35);
    border-radius: 6px;
    background: rgba(24, 168, 85, 0.14);
    color: #d1fae5;
    padding: 5px 7px;
    cursor: pointer;
}

.edit-avatar-file-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px;
    align-items: center;
}

.edit-avatar-clear-file {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid rgba(255, 95, 95, 0.38);
    background: rgba(255, 95, 95, 0.12);
    color: #ffc5c5;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, background 0.15s ease;
}

.edit-avatar-clear-file.visible {
    opacity: 1;
    pointer-events: auto;
}

.edit-avatar-clear-file:hover {
    background: rgba(255, 95, 95, 0.2);
}

.edit-avatar-file-name {
    margin-top: -2px;
    font-size: 0.62rem;
    color: rgba(255, 255, 255, 0.65);
    min-height: 14px;
    word-break: break-all;
}

.edit-avatar-input:focus {
    outline: none;
    border-color: rgba(24, 168, 85, 0.6);
    box-shadow: 0 0 0 2px rgba(24, 168, 85, 0.18);
}

.edit-avatar-box .btn-delete {
    background: linear-gradient(180deg, #25b869 0%, #188a4f 100%);
    border-color: rgba(172, 248, 207, 0.35);
    box-shadow: 0 10px 16px rgba(24, 138, 79, 0.28);
}

.edit-avatar-box .btn-delete:hover {
    background: linear-gradient(180deg, #33c878 0%, #1e9b5a 100%);
    box-shadow: 0 12px 20px rgba(24, 138, 79, 0.34);
}

@media (max-width: 575.98px) {
    .confirm-delete-box {
        width: calc(100vw - 16px);
        padding: 18px 14px 12px;
        border-radius: 12px;
    }

    .confirm-delete-icon {
        width: 46px;
        height: 46px;
        font-size: 1.4rem;
        margin-bottom: 8px;
    }

    .confirm-delete-box h3 {
        font-size: 1rem;
    }

    .confirm-delete-box p {
        font-size: 0.78rem;
    }

    .confirm-delete-actions {
        gap: 8px;
        margin-top: 14px;
    }

    .confirm-delete-box .btn-cancel,
    .confirm-delete-box .btn-delete {
        min-height: 34px;
        font-size: 0.66rem;
        padding: 7px 6px;
    }

    .edit-avatar-fields {
        gap: 6px;
        margin-top: 10px;
    }

    .edit-avatar-fields label {
        font-size: 0.64rem;
    }

    .edit-avatar-inline label {
        padding: 5px 6px;
        font-size: 0.62rem;
    }

    .edit-avatar-input {
        min-height: 30px;
        font-size: 0.66rem;
        padding: 6px 7px;
    }

    .edit-avatar-input[type="file"] {
        padding: 5px 6px;
        font-size: 0.6rem;
    }

    .edit-avatar-input[type="file"]::file-selector-button {
        padding: 4px 6px;
        font-size: 0.58rem;
    }

    .edit-avatar-clear-file {
        width: 22px;
        height: 22px;
        font-size: 0.9rem;
    }

    .edit-avatar-file-name {
        font-size: 0.56rem;
    }
}

@keyframes pop{
    from{transform:scale(.9);opacity:0}
    to{transform:scale(1);opacity:1}
}