/**
 * Styles pour les Options de Service et Niveaux ASP
 * Utilisé dans les pages d'administration /admin/options-service et /admin/niveau-asp
 */

/* ==========================================================================
   Tables communes (level-table, option-table)
   ========================================================================== */

.level-table th,
.option-table th {
    white-space: nowrap;
    vertical-align: middle;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    font-size: 0.875rem;
}

.level-table td,
.option-table td {
    vertical-align: middle;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    font-size: 0.875rem;
}

/* Colonnes communes */
.level-table .col-drag,
.option-table .col-drag {
    width: 40px;
    text-align: center;
}

.level-table .col-id,
.option-table .col-id {
    width: 50px;
}

.level-table .col-order,
.option-table .col-order {
    width: 70px;
}

.level-table .col-status,
.option-table .col-status {
    width: 100px;
}

.level-table .col-actions,
.option-table .col-actions {
    width: 100px;
    text-align: center;
}

/* Colonne spécifique aux niveaux ASP */
.level-table .col-options {
    width: 180px;
}

/* Badge pour les options dans la liste */
.badge-option {
    font-size: 0.7rem;
    margin: 1px;
}

/* ==========================================================================
   Drag & Drop (SortableJS)
   ========================================================================== */

.drag-handle {
    cursor: grab;
    color: #6c757d;
    transition: color 0.2s;
}

.drag-handle:hover {
    color: #0d6efd;
}

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

/* Style pendant le drag */
.level-table tbody tr.sortable-ghost,
.option-table tbody tr.sortable-ghost {
    opacity: 0.4;
}

.level-table tbody tr.sortable-chosen,
.option-table tbody tr.sortable-chosen {
    background-color: #e7f1ff !important;
}

/* Animation de transition */
.level-table tbody tr,
.option-table tbody tr {
    transition: background-color 0.2s;
}

/* ==========================================================================
   Formulaire - Liste des options de service (ASP Level form)
   ========================================================================== */

.service-option-list {
    max-height: 400px;
    overflow-y: auto;
}

.service-option-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.15s ease-in-out;
    cursor: pointer;
}

.service-option-item:last-child {
    border-bottom: none;
}

.service-option-item:hover {
    background-color: #f8f9fa;
}

.service-option-item.selected {
    background-color: #e7f1ff;
}

.service-option-item.included-in-level {
    background-color: #f0f0f0;
    opacity: 0.6;
    cursor: default;
}

.service-option-item.included-in-level label {
    color: #6c757d;
    cursor: default;
}

.service-option-item.included-in-level input[type="checkbox"] {
    cursor: default;
}

.service-option-item input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.75rem;
    cursor: pointer;
    accent-color: #0d6efd;
    flex-shrink: 0;
}

.service-option-item label {
    flex: 1;
    margin: 0;
    cursor: pointer;
    font-weight: 500;
    color: #212529;
}

.service-options-empty {
    padding: 2rem;
    text-align: center;
    color: #6c757d;
}

.service-options-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    border-radius: 0.375rem 0.375rem 0 0;
}

.service-options-count {
    font-size: 0.875rem;
    color: #6c757d;
}

.service-options-card {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    overflow: hidden;
}

/* Barre de recherche des options */
.service-options-search {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #e9ecef;
    background-color: #fff;
}

.service-options-search .input-group {
    background-color: #f8f9fa;
    border-radius: 0.375rem;
}

.service-options-search .form-control {
    background-color: transparent;
}

.service-options-search .form-control:focus {
    box-shadow: none;
}

.service-options-search .btn-link {
    text-decoration: none;
    padding: 0.25rem 0.5rem;
}

.service-options-search .btn-link:hover {
    color: #dc3545 !important;
}

/* Message "aucun résultat" */
.service-options-no-results {
    padding: 2rem;
    text-align: center;
    color: #6c757d;
}

.service-options-no-results i {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

/* ==========================================================================
   Color select (ASP Level form)
   ========================================================================== */

.color-select-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.color-select-wrapper .color-preview {
    min-width: 70px;
    text-align: center;
    padding: 0.4rem 0.75rem;
    font-size: 0.875rem;
}

.color-select-wrapper .form-select {
    flex: 1;
}

/* Style for color options in select */
.color-select option[value="bg-secondary"] { background-color: #6c757d; color: white; }
.color-select option[value="bg-info"] { background-color: #0dcaf0; color: black; }
.color-select option[value="bg-primary"] { background-color: #0d6efd; color: white; }
.color-select option[value="bg-success"] { background-color: #198754; color: white; }
.color-select option[value="bg-warning"] { background-color: #ffc107; color: black; }
.color-select option[value="bg-danger"] { background-color: #dc3545; color: white; }

/* ==========================================================================
   Switch toggle
   ========================================================================== */

.form-switch .form-check-input {
    cursor: pointer;
}
