/* -*- coding: utf-8 -*- */
/* Styles personnalisés pour SOF */

/* Animation pour les marqueurs */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Styles pour les popups Leaflet */
.leaflet-popup-content {
    margin: 8px 12px;
    line-height: 1.4;
}

.leaflet-popup-content h3 {
    margin: 0 0 8px 0;
    color: #1f2937;
}

/* Scroll personnalisé pour la sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Styles pour les événements dans la liste */
.event-item {
    transition: all 0.2s ease;
}

.event-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Animation pour les notifications */
.notification {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive design pour mobile */
@media (max-width: 768px) {
    .desktop-sidebar {
        display: none;
    }
    
    .mobile-toggle {
        display: block;
    }
}

@media (min-width: 769px) {
    .mobile-toggle {
        display: none;
    }
}

/* Styles pour les modales */
.modal-overlay {
    backdrop-filter: blur(4px);
    z-index: 9999 !important;
}

.modal-content {
    animation: modalScale 0.2s ease-out;
    z-index: 10000 !important;
    position: relative;
}

@keyframes modalScale {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Styles pour les statistiques */
.stat-card {
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: scale(1.05);
}

/* Amélioration de l'apparence des formulaires */
.form-input:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-color: #3b82f6;
}

/* Styles pour les badges de priorité */
.priority-haute {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.priority-moyenne {
    background-color: #fffbeb;
    color: #d97706;
    border: 1px solid #fed7aa;
}

.priority-basse {
    background-color: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

/* Styles pour les badges de statut */
.status-en-cours {
    background-color: #fff7ed;
    color: #ea580c;
    border: 1px solid #fed7aa;
}

.status-resolu {
    background-color: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.status-en-attente {
    background-color: #fffbeb;
    color: #d97706;
    border: 1px solid #fed7aa;
}

.status-planifie {
    background-color: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

/* Styles pour les boutons d'action */
.action-button {
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.action-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Styles pour les modaux étendus */
.modal-content.wide {
    max-width: 600px;
    width: 90vw;
}

/* Amélioration des event-items */
.event-item {
    border-left: 4px solid transparent;
}

.event-item:hover {
    border-left-color: #3b82f6;
}

/* ===== STYLES POUR LES LIGNES FERROVIAIRES ===== */

/* Styles pour les lignes ferroviaires sur la carte */
.leaflet-interactive:hover {
    stroke-width: 5px !important;
    stroke-opacity: 1 !important;
}

/* Animation pour ligne sélectionnée */
@keyframes pulse-line {
    0% { stroke-width: 3px; }
    50% { stroke-width: 6px; }
    100% { stroke-width: 3px; }
}

.selected-line {
    animation: pulse-line 2s infinite;
}

/* ===== AUTOCOMPLÉTION ===== */

/* Conteneur d'autocomplétion */
.autocomplete-container {
    position: relative;
}

.autocomplete-results {
    position: absolute;
    z-index: 50;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    margin-top: 0.25rem;
    max-height: 15rem;
    overflow-y: auto;
    width: 100%;
}

.autocomplete-item {
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background-color: #f3f4f6;
}

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

/* ===== CONTRÔLES DE CARTE ===== */

/* Boutons de contrôle de la carte */
.map-control {
    position: absolute;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 0.5rem;
    z-index: 2000;
}

.map-control button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.2s;
}

.map-control button:hover {
    background: #1d4ed8;
}

/* Indicateur de sélection de ligne */
.ligne-selection-indicator {
    position: absolute;
    top: 5rem;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 0.75rem;
    z-index: 1000;
    max-width: 20rem;
    text-align: center;
}

/* ===== LÉGENDE DES LIGNES ===== */

.ligne-legende {
    position: absolute;
    bottom: 1.25rem;
    right: 1.25rem;
    background: white;
    padding: 0.75rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 2000;
}

.ligne-legende h4 {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.ligne-legende-item {
    display: flex;
    align-items: center;
    margin: 0.25rem 0;
}

.ligne-legende-color {
    width: 1.5rem;
    height: 0.25rem;
    margin-right: 0.5rem;
    border-radius: 0.125rem;
}

.ligne-legende-text {
    font-size: 0.75rem;
    color: #6b7280;
}

/* ===== AMÉLIORATIONS FORMULAIRE ===== */

/* Information de ligne dans le formulaire */
.ligne-info {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
    padding: 0.25rem 0;
}

.ligne-info.with-pk {
    color: #059669;
    font-weight: 500;
}

/* ===== NOTIFICATIONS ===== */

/* Styles pour les notifications popup */
.notification-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease-out;
}

.notification-popup {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    padding: 20px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    position: relative;
}

.notification-message {
    margin-bottom: 20px;
    color: #333;
    line-height: 1.5;
}

.notification-close {
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: opacity 0.2s ease;
}

.notification-close:hover {
    opacity: 0.9;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ===== RESPONSIVE ===== */

/* Adaptations mobiles */
@media (max-width: 768px) {
    .map-control {
        position: static;
        margin: 0.5rem;
        width: calc(100% - 1rem);
    }
    
    .ligne-legende {
        position: static;
        margin: 0.5rem;
        width: calc(100% - 1rem);
    }
    
    .ligne-selection-indicator {
        position: static;
        transform: none;
        margin: 0.5rem;
        width: calc(100% - 1rem);
    }
    
    .autocomplete-results {
        max-height: 10rem;
    }
}

/* ===== ÉTATS DE CHARGEMENT ===== */

/* Indicateur de chargement pour les lignes */
.loading-lines {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 2000;
}

.loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 50%;
    border-top-color: #2563eb;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Styles pour la fonctionnalité PK → GPS */
.pk-preview-marker {
    background-color: #3b82f6;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.pk-marker-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 16px;
}

.pk-preview-popup {
    font-size: 12px;
    line-height: 1.4;
}

.pk-preview-popup strong {
    color: #1f2937;
}

/* Animation de loading pour le calcul PK */
.pk-calculating {
    position: relative;
}

.pk-calculating::after {
    content: '';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* Responsive pour les coordonnées calculées */
@media (max-width: 480px) {
    .grid.grid-cols-2 {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    #calc-lat, #calc-lng {
        font-size: 10px;
    }
}

/* ===== CORRECTION Z-INDEX POUR LEAFLET ===== */

/* S'assurer que tous les contrôles d'interface sont au-dessus de Leaflet */
.leaflet-control-container,
.leaflet-popup,
.leaflet-tooltip {
    z-index: 1000 !important;
}

/* Forcer les contrôles personnalisés au-dessus de tout */
.absolute[style*="z-index: 2000"] {
    z-index: 2000 !important;
}

/* Styles spécifiques pour les boutons de contrôle */
#toggle-lignes,
#toggle-pn {
    position: relative;
    z-index: 2001 !important;
}

/* Indicateurs et légendes */
#ligne-selection-info,
#ligne-legende,
#pn-legend {
    z-index: 2000 !important;
}

/* Notifications au-dessus de tout */
.notification {
    z-index: 3000 !important;
}

/* ===== MODAL DE PERSONNALISATION ===== */

/* Styles pour le modal de personnalisation des lignes */
#customization-modal .modal-content {
    max-width: 500px;
    width: 90vw;
}

/* Sliders personnalisés */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-track {
    background: #e5e7eb;
    height: 8px;
    border-radius: 4px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    background: #3b82f6;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input[type="range"]::-moz-range-track {
    background: #e5e7eb;
    height: 8px;
    border-radius: 4px;
    border: none;
}

input[type="range"]::-moz-range-thumb {
    background: #3b82f6;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    cursor: pointer;
}

/* Sélecteur de couleur personnalisé */
input[type="color"] {
    -webkit-appearance: none;
    appearance: none;
    border: none;
    cursor: pointer;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 6px;
    overflow: hidden;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 6px;
}

/* Boutons de préréglages */
.preset-button {
    transition: all 0.2s ease;
}

.preset-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Amélioration des sections */
#customization-modal h3 {
    border-bottom: 2px solid #f3f4f6;
    padding-bottom: 0.5rem;
}

/* Animation d'ouverture du modal */
#customization-modal.show .modal-content {
    animation: slideIn 0.3s ease-out;
}

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

/* Responsive pour le modal de personnalisation */
@media (max-width: 640px) {
    #customization-modal .modal-content {
        width: 95vw;
        max-height: 95vh;
        margin: 1rem;
    }
    
    .grid-cols-2 {
        grid-template-columns: 1fr;
    }
}

/* Styles pour les gares */
.gare-marker {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

.gare-marker:hover {
    transform: scale(1.1);
}

.gare-icon {
    background: transparent !important;
    border: none !important;
}

/* Clusters des gares */
.gare-cluster {
    background: rgba(59, 130, 246, 0.8);
    border: 2px solid white;
    border-radius: 50%;
    color: white;
    font-weight: bold;
    text-align: center;
    font-size: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.gare-cluster div {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.gare-cluster.cluster-voyageurs {
    background: rgba(59, 130, 246, 0.8);
}

.gare-cluster.cluster-fret {
    background: rgba(107, 114, 128, 0.8);
}

.gare-cluster.cluster-mixte {
    background: rgba(139, 92, 246, 0.8);
}

.gare-cluster-small {
    width: 30px;
    height: 30px;
}

.gare-cluster-medium {
    width: 35px;
    height: 35px;
}

.gare-cluster-large {
    width: 40px;
    height: 40px;
}

/* Popup des gares */
.gare-popup {
    min-width: 280px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.gare-popup .popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.gare-popup .popup-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.gare-type {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.gare-type-voyageurs {
    background: #dbeafe;
    color: #1d4ed8;
}

.gare-type-fret {
    background: #f3f4f6;
    color: #374151;
}

.gare-type-mixte {
    background: #ede9fe;
    color: #7c3aed;
}

.gare-popup .popup-section {
    margin-bottom: 12px;
    font-size: 13px;
}

.gare-popup .popup-section div {
    margin-bottom: 6px;
}

.gare-popup .popup-section strong {
    color: #374151;
}

.services-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
}

.service {
    padding: 8px;
    border-radius: 6px;
    text-align: center;
    font-size: 12px;
    font-weight: 500;
}

.service.active {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.service.inactive {
    background: #f9fafb;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.gare-popup .popup-actions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.btn-create-event {
    width: 100%;
    padding: 8px 16px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-create-event:hover {
    background: #2563eb;
}

/* Loader et notifications pour les gares */
.gares-loader {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 20px 30px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 12px;
}

.gares-loader .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #3b82f6;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Tooltip des gares */
.gare-tooltip {
    background: rgba(0, 0, 0, 0.8) !important;
    color: white !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 6px 10px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    line-height: 1.3 !important;
}

.gare-tooltip:before {
    border-top-color: rgba(0, 0, 0, 0.8) !important;
}

/* Notification des gares */
.gares-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #10b981;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    animation: slideInRight 0.3s ease-out;
}

.gares-notification.notification-error {
    background: #ef4444;
}

.gares-notification.notification-warning {
    background: #f59e0b;
    color: #1f2937;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ======================
   STYLES UTM (Unités Territoriales de Maintenance)
   ====================== */

/* Panneau UTM */
#utm-panel {
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
    background-color: rgba(255, 255, 255, 0.95);
}

#utm-panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Styles pour pavé UTM compact */
#utm-panel {
    min-width: 120px;
    max-width: 180px;
}

#utm-panel .utm-button {
    min-height: 28px;
    display: flex;
    align-items: center;
}

/* Indicateur de centre personnalisé */
.utm-button .fa-map-pin {
    font-size: 10px;
    opacity: 0.8;
    animation: pulse-icon 2s infinite;
}

@keyframes pulse-icon {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* Bouton d'enregistrement de centre */
#utm-record-center {
    animation: glow-orange 3s ease-in-out infinite;
}

@keyframes glow-orange {
    0%, 100% { box-shadow: 0 0 5px rgba(251, 146, 60, 0.3); }
    50% { box-shadow: 0 0 15px rgba(251, 146, 60, 0.6); }
}

#utm-record-center:hover {
    background: #fed7aa !important;
    transform: scale(1.02);
}

/* Notification de centre enregistré */
.notification-center-saved {
    animation: bounce-in 0.5s ease-out;
}

@keyframes bounce-in {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.1); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

/* Boutons UTM */
.utm-button {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.utm-button:hover {
    transform: translateX(2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.utm-button:active {
    transform: translateX(1px);
}

/* Animation pour bouton UTM actif */
.utm-button.bg-blue-50 {
    animation: utm-glow 2s ease-in-out infinite alternate;
}

@keyframes utm-glow {
    from { box-shadow: 0 0 5px rgba(59, 130, 246, 0.3); }
    to { box-shadow: 0 0 15px rgba(59, 130, 246, 0.6); }
}

/* Indicateur UTM active */
#utm-indicator {
    animation: slideInUp 0.5s ease-out;
}

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

/* Styles pour les contours départementaux */
.utm-boundary {
    pointer-events: auto;
}

/* Popup UTM */
.utm-popup {
    min-width: 200px;
    font-family: 'Inter', -apple-system, sans-serif;
}

.utm-popup h4 {
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.utm-popup p {
    color: #6b7280;
    line-height: 1.4;
}

/* Notifications UTM */
.utm-notification {
    animation: utm-slide-in 0.4s ease-out;
}

@keyframes utm-slide-in {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Amélioration des filtres par opacité */
.utm-filtered-element {
    transition: opacity 0.3s ease, filter 0.3s ease;
}

.utm-filtered-element.utm-dimmed {
    opacity: 0.2;
    filter: grayscale(50%);
}

/* Responsive pour mobile */
@media (max-width: 768px) {
    #utm-panel {
        min-width: 140px;
        max-width: calc(100vw - 40px);
    }
    
    #utm-record-center {
        font-size: 11px;
        padding: 6px 8px;
    }
}

/* Animation de hover pour le panneau complet */
#utm-panel:hover .utm-button:not(.bg-blue-50) {
    opacity: 0.7;
}

#utm-panel .utm-button:hover {
    opacity: 1 !important;
}

/* Icônes UTM avec couleurs */
.utm-icon {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    margin-right: 6px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Styles pour les statistiques UTM */
.utm-stats {
    font-size: 11px;
    color: #6b7280;
    margin-top: 4px;
    padding: 2px 6px;
    background-color: rgba(243, 244, 246, 0.8);
    border-radius: 4px;
    display: inline-block;
}

/* Animation de focus pour accessibilité */
.utm-button:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Dark mode support (si jamais implémenté) */
@media (prefers-color-scheme: dark) {
    #utm-panel {
        background-color: rgba(31, 41, 55, 0.95);
        color: #f9fafb;
    }
    
    .utm-button {
        background-color: rgba(55, 65, 81, 0.8);
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .utm-button:hover {
        background-color: rgba(75, 85, 99, 0.9);
    }
}

/* ======================
   FIN STYLES UTM
   ====================== */

/* Styles pour les onglets de la modal événements */
.event-tab {
    border-bottom-color: transparent;
    color: #6b7280;
    transition: all 0.2s ease;
}

.event-tab.active {
    border-bottom-color: #3b82f6;
    color: #3b82f6;
}

.event-tab:hover {
    color: #1d4ed8;
}

.tab-content {
    min-height: 400px;
}

.tab-content.hidden {
    display: none;
}

/* Styles pour l'interface d'historique intégrée */
.historique-header {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 16px;
    margin-bottom: 16px;
}

.historique-filters {
    background: #f9fafb;
    padding: 12px;
    border-radius: 8px;
}

#historique-timeline {
    max-height: 500px;
    overflow-y: auto;
}

/* Adaptation des boutons pour l'interface intégrée */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

/* Fix pour assurer que la carte Leaflet est visible */
#map {
    z-index: 1 !important;
    position: relative;
    height: 100% !important;
    width: 100% !important;
}

/* S'assurer que le container de la carte est bien positionné */
main.flex-1 {
    z-index: 1;
    position: relative;
}

/* Indicateur de statut offline/online */
.status-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    cursor: pointer;
}

.status-indicator.online {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.status-indicator.offline {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    animation: pulse-warning 2s infinite;
}

.status-indicator.checking {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.status-indicator.offline .status-dot {
    animation: blink 1s infinite;
}

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

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

/* Tooltip pour l'indicateur de statut */
.status-tooltip {
    position: absolute;
    bottom: -35px;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
}

.status-indicator:hover .status-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Queue counter badge */
.queue-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 10px;
    min-width: 16px;
    text-align: center;
    margin-left: 4px;
}
