/**
 * Discovery Map - Styles
 */

/* Container principal */
.discovery-map-container {
    position: relative;
    width: 100%;
    margin: 20px 0;
}

/* Loading */
.discovery-map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 1000;
}

.discovery-map-loading .spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 10px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #d20a11;
    border-radius: 50%;
    animation: discovery-spin 1s linear infinite;
}

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

/* La carte */
#discovery-map {
    width: 100%;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

/* Popup personnalisée */
.discovery-popup {
    min-width: 250px;
    max-width: 300px;
}

.discovery-popup-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 10px;
}

.discovery-popup-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
}

.discovery-popup-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
    line-height: 1.4;
}

.discovery-popup-dates {
    font-size: 12px;
    color: #999;
    margin-bottom: 12px;
}

.discovery-popup-status {
    font-size: 13px;
    font-weight: bold;
    padding: 6px 10px;
    border-radius: 4px;
    margin-bottom: 12px;
    text-align: center;
}

.discovery-popup-status-accessible {
    background-color: #ffffff;
    color: #00896a;
}

.leaflet-container a {
    color: #fff;
    background-color: #d20a11;
}
.leaflet-touch .leaflet-control-layers, .leaflet-touch .leaflet-bar {
    border: 0px !important;
    border-radius: 5px !important;
}

.discovery-popup-status-not-started {
    background-color: #8a8989;
    color: white;
}

.leaflet-control-attribution.leaflet-control {
    display: none;
  }
  
.discovery-popup-status-finished {
    background-color: #8a8989;
    color: white;
}

.discovery-popup-button {
    display: inline-block;
    background: #d20a11;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background 0.3s;
    text-align: center;
    width: 100%;
}

.discovery-popup-button:hover {
    background: #d20a11;
    color: white;
}

.discovery-popup-button-disabled {
    background: #8a8989 !important;
    color: #cccccc !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

.discovery-popup-button-disabled:hover {
    background: #8a8989 !important;
    color: #cccccc !important;
}

/* Marqueur personnalisé */
.discovery-marker {
    background: white;
    border: 3px solid #d20a11;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: block;
    position: relative;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.discovery-marker::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #d20a11;
}

/* Marqueur accessible (rouge) */
.discovery-marker-accessible {
    border-color: #d20a11;
}

.discovery-marker-accessible::after {
    border-top-color: #d20a11;
}

/* Marqueur pas encore accessible ou terminé (gris) */
.discovery-marker-not-started,
.discovery-marker-finished {
    border-color: #8a8989;
}

.discovery-marker-not-started::after,
.discovery-marker-finished::after {
    border-top-color: #8a8989;
}

/* Cluster de marqueurs */
.discovery-cluster {
    background: #d20a11;
    color: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* Cluster accessible (rouge) */
.discovery-cluster-accessible {
    background: #d20a11;
}

/* Cluster pas encore accessible ou terminé (gris) */
.discovery-cluster-not-started,
.discovery-cluster-finished {
    background: #8a8989;
}

/* Contrôles de la carte */
.discovery-map-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    padding: 10px;
}

.discovery-map-search {
    width: 200px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* Liste des parcours (optionnel) */
.discovery-map-list {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.discovery-map-list-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    transition: box-shadow 0.3s;
    cursor: pointer;
}

.discovery-map-list-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.discovery-map-list-item h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
}

.discovery-map-list-item p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .discovery-popup {
        min-width: 200px;
        max-width: 250px;
    }
    
    .discovery-map-list {
        grid-template-columns: 1fr;
    }
    
    .discovery-map-controls {
        top: auto;
        bottom: 10px;
        right: 10px;
    }
}

/* Thème sombre (optionnel) */
.discovery-map-dark #discovery-map {
    background: #1a1a1a;
    border-color: #333;
}

.discovery-map-dark .discovery-popup {
    background: #2a2a2a;
    color: #fff;
}

.discovery-map-dark .discovery-popup-title {
    color: #fff;
}

.discovery-map-dark .discovery-popup-description {
    color: #ccc;
}