/* Styles pour le composant generalites-responsables */

/* Overlay de chargement */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: #333;
    font-size: 14px;
    font-weight: 500;
}

/* Messages d'alerte */
.alert-message {
    padding: 12px 20px;
    margin-bottom: 15px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Barre d'outils (recherche + stats) */
.generalites-responsables-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
    flex-wrap: wrap;
    gap: 15px;
}

.generalites-responsables-search {
    flex: 1;
    min-width: 300px;
}

.filter-item-search {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-item-search label {
    font-weight: 600;
    white-space: nowrap;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    max-width: 500px;
}

.search-input {
    width: 100%;
    padding: 8px 35px 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.search-input:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.clear-search-button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 20px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.clear-search-button:hover {
    background-color: #e9ecef;
    color: #495057;
}

.generalites-responsables-stats {
    display: flex;
    align-items: center;
    gap: 15px;
}

.stats-text {
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
}

.items-per-page-select {
    padding: 6px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}

/* Pagination */
.generalites-responsables-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 15px 0;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    flex-wrap: wrap;
    gap: 10px;
}

.pagination-info {
    font-size: 14px;
    color: #495057;
}

.pagination-controls {
    display: flex;
    gap: 5px;
}

.pagination-button {
    padding: 6px 12px;
    border: 1px solid #dee2e6;
    background-color: white;
    color: #495057;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s;
}

.pagination-button:hover:not(:disabled) {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.pagination-button.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.pagination-button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.pagination-button.ellipsis {
    border: none;
    background: none;
    cursor: default;
}

.pagination-button.ellipsis:hover {
    background: none;
}

/* Tableau */
.generalites-responsables-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.generalites-responsables-table thead {
    background-color: #343a40;
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.generalites-responsables-table th {
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 2px solid #dee2e6;
}

.sortable-header {
    cursor: pointer;
    user-select: none;
}

.sortable-header:hover {
    background-color: #495057;
}

.sort-indicator {
    margin-left: 5px;
    font-size: 12px;
}

.generalites-responsables-table tbody tr {
    border-bottom: 1px solid #dee2e6;
}

.generalites-responsables-table tbody tr:hover {
    background-color: #f8f9fa;
}

.generalites-responsables-table td {
    padding: 10px 8px;
    font-size: 14px;
    vertical-align: top;
}

.no-data {
    text-align: center;
    padding: 40px !important;
    color: #6c757d;
    font-style: italic;
}

.courriel-cell a {
    color: #007bff;
    text-decoration: none;
}

.courriel-cell a:hover {
    text-decoration: underline;
}

.disponibilite-cell {
    min-width: 200px;
}

.disponibilite-textarea {
    width: 100%;
    padding: 6px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    min-height: 50px;
}

.disponibilite-textarea:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.disponibilite-textarea:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
}

/* Note sur la disponibilité */
.note-disponibilite {
    margin-top: 15px;
    padding: 10px;
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    color: #856404;
}

/* Responsive */
@media (max-width: 768px) {
    .generalites-responsables-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .generalites-responsables-search {
        width: 100%;
    }

    .search-input-wrapper {
        max-width: 100%;
    }

    .generalites-responsables-pagination {
        flex-direction: column;
        align-items: stretch;
    }

    .pagination-controls {
        flex-wrap: wrap;
        justify-content: center;
    }

    .generalites-responsables-table {
        font-size: 12px;
    }

    .generalites-responsables-table th,
    .generalites-responsables-table td {
        padding: 8px 4px;
    }
}
