/* -*- coding: utf-8 -*- */
/* Styles pour les traversées pour le public (TVP) */

/* Marqueurs TVP */
.tvp-marker {
    background: rgba(255, 255, 255, 0.95) !important;
    border-radius: 50%;
    border: 3px solid #333 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 6px rgba(0,0,0,0.5) !important;
    transition: all 0.2s ease;
    z-index: 1000 !important;
    position: relative;
    width: 24px !important;
    height: 24px !important;
}

.tvp-marker:hover {
    transform: scale(1.2) !important;
    box-shadow: 0 5px 10px rgba(0,0,0,0.6) !important;
}

/* Assurer que les icônes TVP sont visibles */
.tvp-marker i {
    font-size: 16px !important;
    z-index: 1001 !important;
}

/* Clusters TVP */
.marker-cluster.marker-cluster-normal div {
    background-color: rgba(40, 167, 69, 0.8);
    border: 2px solid #28a745;
}

.marker-cluster.marker-cluster-warning div {
    background-color: rgba(255, 193, 7, 0.8);
    border: 2px solid #ffc107;
}

.marker-cluster.marker-cluster-danger div {
    background-color: rgba(220, 53, 69, 0.8);
    border: 2px solid #dc3545;
}

.marker-cluster div {
    width: 36px;
    height: 36px;
    margin-left: 2px;
    margin-top: 2px;
    text-align: center;
    border-radius: 50%;
    font-size: 11px;
    font-weight: bold;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.marker-cluster span {
    line-height: 1;
}

/* Popups TVP */
.tvp-popup-content {
    max-width: 300px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

.tvp-popup-content h3 {
    margin: 0 0 12px 0;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 5px;
}

.tvp-popup-content .grid {
    display: grid;
    gap: 8px;
    margin-bottom: 10px;
}

.tvp-popup-content .grid-cols-2 {
    grid-template-columns: 1fr 1fr;
}

.tvp-popup-content strong {
    color: #34495e;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tvp-popup-content button {
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    font-size: 12px;
}

.tvp-popup-content button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Loader TVP */
.tvp-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 12px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

.tvp-loader .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Bouton toggle TVP */
#toggle-tvp {
    background: linear-gradient(135deg, #8e44ad, #9b59b6);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

#toggle-tvp:hover {
    background: linear-gradient(135deg, #7d3c98, #8e44ad);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

#toggle-tvp.active {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.4);
}

#toggle-tvp.active:hover {
    background: linear-gradient(135deg, #219a52, #27ae60);
}

/* Légende TVP */
#tvp-legend {
    position: absolute;
    bottom: 60px;
    right: 10px;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    font-size: 12px;
    min-width: 200px;
    z-index: 1000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

#tvp-legend h4 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 14px;
    font-weight: 600;
    border-bottom: 1px solid #ecf0f1;
    padding-bottom: 5px;
}

#tvp-legend .legend-item {
    display: flex;
    align-items: center;
    margin: 6px 0;
    gap: 8px;
}

#tvp-legend .legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid #34495e;
}

#tvp-legend .legend-color.normal {
    background-color: #28a745;
}

#tvp-legend .legend-color.warning {
    background-color: #ffc107;
}

#tvp-legend .legend-color.danger {
    background-color: #dc3545;
}

/* Responsive */
@media (max-width: 768px) {
    .tvp-popup-content {
        max-width: 250px;
    }
    
    .tvp-popup-content .grid-cols-2 {
        grid-template-columns: 1fr;
    }
    
    #tvp-legend {
        bottom: 80px;
        right: 5px;
        min-width: 180px;
        font-size: 11px;
    }
    
    #toggle-tvp {
        padding: 6px 12px;
        font-size: 13px;
    }
}

/* Tooltip des TVP */
.tvp-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;
}

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