/* Styles pour la plateforme sites */
body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Carte Leaflet */
#map {
    height: 500px;
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Tableau */
.table-responsive {
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    background: white;
}

#sitesTable {
    margin-bottom: 0;
}

#sitesTable th {
    border-top: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

#sitesTable td {
    vertical-align: middle;
    padding: 12px 8px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Badges pour les états */
.badge-actif {
    background-color: #28a745;
}

.badge-inactif {
    background-color: #dc3545;
}

.badge-etat {
    background-color: #17a2b8;
}

/* Sélecteur de colonnes */
#columnSelector {
    animation: slideDown 0.3s ease-in-out;
}

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

.multi-select {
    height: 150px;
    width: 100%;
}

/* Filtres */
.form-select, .form-control {
    font-size: 0.9rem;
}

/* Boutons actions */
.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* Contrôles */
.input-group-text {
    background-color: #e9ecef;
    border: 1px solid #ced4da;
}

/* Pagination */
.pagination-sm .page-link {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* Loading */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Modal */
.modal-body dl {
    margin-bottom: 0;
}

.modal-body dt {
    font-weight: 600;
    color: #495057;
    margin-top: 1rem;
}

.modal-body dt:first-child {
    margin-top: 0;
}

.modal-body dd {
    margin-bottom: 0.5rem;
    padding-left: 1rem;
}

/* Popup Leaflet personnalisé */
.leaflet-popup-content {
    margin: 8px 16px;
    line-height: 1.4;
}

.leaflet-popup-content h6 {
    margin: 0 0 8px 0;
    color: #0056b3;
    font-weight: 600;
}

.popup-info {
    font-size: 0.9rem;
}

.popup-info strong {
    color: #495057;
}

/* Responsive */
@media (max-width: 768px) {
    #map {
        height: 400px;
    }
    
    .table-responsive {
        font-size: 0.85rem;
    }
    
    #sitesTable th,
    #sitesTable td {
        padding: 8px 4px;
        font-size: 0.8rem;
    }
    
    .btn-sm {
        padding: 0.2rem 0.4rem;
        font-size: 0.75rem;
    }
    
    /* Masquer certaines colonnes sur mobile */
    #sitesTable th:nth-child(n+6),
    #sitesTable td:nth-child(n+6) {
        display: none;
    }
    
    #sitesTable th:last-child,
    #sitesTable td:last-child {
        display: table-cell; /* Garder la colonne actions */
    }
}

/* Animation de transition */
#mapContainer,
#tableContainer {
    transition: all 0.3s ease-in-out;
}

/* Highlight des lignes au survol */
#sitesTable tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.1);
    cursor: pointer;
}

/* Style pour indiquer que les lignes sont cliquables */
#sitesTable tbody tr {
    transition: background-color 0.2s ease;
}

#sitesTable tbody tr:hover td {
    background-color: rgba(0, 123, 255, 0.05);
}

/* Badges colorés */
.badge {
    font-size: 0.75rem;
    padding: 0.375em 0.5em;
}

/* Style des cartes */
.card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 0.75rem 1rem;
}

.card-body {
    padding: 1rem;
}

/* Amélioration des sélecteurs multiples */
#colSelector {
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 0.375rem;
}

#colSelector option {
    padding: 4px 8px;
}

#colSelector option:hover {
    background-color: #e9ecef;
}

/* Indicateur de colonnes sélectionnées */
.column-count {
    font-size: 0.8rem;
    color: #6c757d;
}

.bg-custom {
    background-color: #f8f9fa !important; /* Bleu moderne */
	color: #174470;
}

.bg-gradient-custom {
    background: linear-gradient(135deg, #1e40af, #fff) !important;
}



/* Header connexion */

/* Barre utilisateur en haut */
.top-user-bar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    /* box-shadow: 0 2px 4px rgba(0,0,0,0.1); */
}

/* Alignement à droite pour les infos utilisateur */
.user-info-section {
    margin-left: auto !important;
    text-align: right;
}

.top-user-bar .container-fluid {
    justify-content: flex-end !important;
}

/* Affichage utilisateur */
.user-display {
    font-size: 14px;
    color: #495057;
}

.user-welcome {
    color: #6c757d;
}

/* Badges rôle utilisateur */
.user-role-badge .badge {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.role-admin {
    background: linear-gradient(45deg, #dc3545, #fd7e14);
    color: white;
    box-shadow: 0 2px 4px rgba(220,53,69,0.3);
}

.role-user {
    background: linear-gradient(45deg, #198754, #20c997);
    color: white;
    box-shadow: 0 2px 4px rgba(25,135,84,0.3);
}

/* Animation badge */
.user-role-badge .badge {
    animation: fadeInBadge 0.5s ease-in;
    position: relative;
    /* overflow: hidden; */
}

.user-role-badge .badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.3s;
}

.user-role-badge .badge:hover::before {
    /* left: 100%; */
}

@keyframes fadeInBadge {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

/* Bouton déconnexion stylé */
.btn-outline-danger:hover {
    /* transform: translateY(-1px); */
    /* box-shadow: 0 4px 8px rgba(220,53,69,0.2); */
    /* transition: all 0.2s ease; */
}

/* Responsive */
@media (max-width: 768px) {
    .top-user-bar .container-fluid {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .user-display {
        font-size: 12px;
    }
}