/* Styles pour les checkboxes Symfony générées automatiquement */
#custom-roles-container {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
}

/* Structure spécifique Symfony : tous les éléments dans un seul div */
#custom-roles-container > div {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
}

/* Chaque groupe checkbox + label doit être sur une ligne */
#custom-roles-container input[type="checkbox"] {
    position: absolute !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
}

#custom-roles-container label {
    display: flex !important;
    align-items: center !important;
    cursor: pointer !important;
    padding: 0.75rem !important;
    border-radius: 0.5rem !important;
    border: 1px solid #d1d5db !important;
    background-color: white !important;
    transition: all 0.2s !important;
    font-weight: 500 !important;
    margin: 0 0 0.5rem 0 !important;
    position: relative !important;
    padding-left: 3rem !important; /* Space for custom checkbox */
}

/* Positionnement relatif pour que la checkbox soit dans le label visuellement */
#custom-roles-container label::before {
    content: '' !important;
    position: absolute !important;
    left: 0.75rem !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 1.25rem !important;
    height: 1.25rem !important;
    border: 2px solid #d1d5db !important;
    border-radius: 0.25rem !important;
    background-color: white !important;
    transition: all 0.2s !important;
}

#custom-roles-container input[type="checkbox"]:checked + label::before {
    background-color: #9333ea !important;
    border-color: #9333ea !important;
}

#custom-roles-container input[type="checkbox"]:checked + label::after {
    content: '✓' !important;
    position: absolute !important;
    left: 0.75rem !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 1.25rem !important;
    height: 1.25rem !important;
    color: white !important;
    font-size: 0.875rem !important;
    font-weight: bold !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#custom-roles-container label:hover {
    border-color: #a855f7 !important;
    background-color: #faf5ff !important;
}

#custom-roles-container label:hover::before {
    border-color: #a855f7 !important;
}

#custom-roles-container input[type="checkbox"]:focus + label::before {
    box-shadow: 0 0 0 2px rgba(147, 51, 234, 0.2) !important;
    border-color: #9333ea !important;
}

#custom-roles-container input[type="checkbox"]:checked + label {
    background-color: #faf5ff !important;
    border-color: #a855f7 !important;
}

/* Styles spécifiques pour chaque rôle */
#custom-roles-container label[for*="ROLE_ADMIN"] {
    border-left: 4px solid #2563eb !important;
}

#custom-roles-container label[for*="ROLE_MODERATOR"] {
    border-left: 4px solid #ea580c !important;
}

#custom-roles-container label[for*="ROLE_CLIENT"] {
    border-left: 4px solid #16a34a !important;
}

#custom-roles-container label[for*="ROLE_GUEST"] {
    border-left: 4px solid #6b7280 !important;
}

#custom-roles-container label[for*="ROLE_COLLABORATOR"] {
    border-left: 4px solid #9333ea !important;
}

/* Tooltip styles */
.roles-info-btn:hover + .roles-tooltip,
.roles-info-btn:focus + .roles-tooltip {
    opacity: 1 !important;
    visibility: visible !important;
}

.roles-tooltip {
    position: absolute !important;
    left: 1.5rem !important;
    top: 0 !important;
    z-index: 10 !important;
    width: 18rem !important;
    background-color: #1f2937 !important;
    color: white !important;
    font-size: 0.75rem !important;
    border-radius: 0.5rem !important;
    padding: 0.75rem !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: all 0.2s !important;
}

.roles-info-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 1.25rem !important;
    height: 1.25rem !important;
    background-color: #f3f4f6 !important;
    border-radius: 50% !important;
    transition: background-color 0.2s !important;
    border: none !important;
}

.roles-info-btn:hover {
    background-color: #faf5ff !important;
}

.roles-info-btn:hover svg {
    color: #9333ea !important;
}

/* Masquer les rôles exclus */
.role-excluded {
    display: none !important;
}
