/**
 * Styles CSS pour la carte Elementor YannJarno
 */

/* Styles de base pour le conteneur de carte */
.yannjarno-map-wrapper {
    position: relative;
    margin-bottom: 20px;
    width: 100%;
}

/* Styles pour le conteneur de carte */
.yannjarno-map-container {
    display: flex;
    position: relative;
    min-height: 500px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    width: 100%;
}

/* Styles pour la carte elle-même */
.yannjarno-map {
    min-height: 500px;
    width: 70%;
    z-index: 1;
}

/* Styles pour la liste des posts */
.yannjarno-post-list {
    width: 30%;
    overflow-y: auto;
    height: 500px;
    border-right: 1px solid #ddd;
    padding: 10px;
    background-color: #ffffff;
    color: #333333;
}

/* Styles pour les éléments de la liste */
.yannjarno-post-list .post-item {
    margin-bottom: 15px;
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.3s ease;
    border-radius: 4px;
}

.yannjarno-post-list .post-item:hover {
    background-color: #f8f9fa;
}

.yannjarno-post-list .post-item:last-child {
    border-bottom: none;
}

.yannjarno-post-list .post-item h3 {
    font-size: 16px;
    margin: 5px 0 10px 0;
    color: #333;
    font-weight: 600;
}

.yannjarno-post-list .post-item .post-image {
    width: 100%;
    height: 150px;
    overflow: hidden;
    border-radius: 4px;
    margin-bottom: 10px;
}

.yannjarno-post-list .post-item .post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.yannjarno-post-list .post-item:hover .post-image img {
    transform: scale(1.05);
}

.yannjarno-post-list .post-item .post-categories {
    margin: 8px 0;
    font-size: 12px;
}

.yannjarno-post-list .post-item .category-badge {
    display: inline-block;
    padding: 2px 6px;
    background-color: #e9ecef;
    border-radius: 3px;
    font-size: 11px;
    margin-right: 4px;
    color: #495057;
}

.yannjarno-post-list .post-item .post-commune {
    margin: 5px 0;
    font-size: 13px;
    color: #666;
}

.yannjarno-post-list .post-item .post-commune i {
    margin-right: 4px;
    color: #007bff;
}

.yannjarno-post-list .post-item .post-excerpt {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    margin: 8px 0;
}

.yannjarno-post-list .post-item .see-more {
    display: inline-block;
    color: #007bff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    margin-top: 5px;
}

.yannjarno-post-list .post-item .see-more:hover {
    color: #0056b3;
    text-decoration: underline;
}

.yannjarno-post-list .no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

.yannjarno-post-list .error-message {
    text-align: center;
    padding: 20px;
    color: #dc3545;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 10px 0;
}

/* Styles pour les formulaires de filtres */
.yannjarno-map-filters {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.yannjarno-filter-select {
    padding: 10px 15px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    min-width: 200px;
    background-color: white;
    font-size: 14px;
    color: #495057;
}

.yannjarno-filter-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.radio-button {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

/* Style personnalisé pour les boutons radio */
.radio-button div {
    position: relative;
    display: flex;
    align-items: center;
}

.radio-button input[type="radio"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
}

.radio-button label {
    font-size: 14px;
    color: #495057;
    cursor: pointer;
    user-select: none;
}

.radio-button input[type="radio"]:checked + label {
    color: #007bff;
    font-weight: 500;
}

/* Style pour le loader */
#loader-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.85);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Animation du loader */
.loader {
    width: 50px;
    aspect-ratio: 1;
    color: #007bff;
    border-radius: 50%;
    display: grid;
    background: 
        conic-gradient(from 90deg at 4px 4px,#0000 90deg,currentColor 0)
        -4px -4px/calc(50% + 2px) calc(50% + 2px),
        radial-gradient(farthest-side,currentColor 6px,#0000 7px calc(100% - 6px),currentColor calc(100% - 5px)) no-repeat;
    animation: spin 2s infinite linear;
    position: relative;
}

.loader:before {
    content: "";
    border-radius: inherit;
    background: inherit;
    transform: rotate(45deg);
}

@keyframes spin {
    to { transform: rotate(0.5turn); }
}

/* Styles pour les popups Leaflet */
.leaflet-popup-content {
    min-width: 200px;
    margin: 0;
    padding: 0;
}

.leaflet-popup-content .markertext-content {
    padding: 10px;
}

.leaflet-popup-content h3 {
    font-size: 18px;
    margin: 0 0 10px 0;
    color: #30317A;
    font-weight: 700;
}

.leaflet-popup-content p {
    margin: 5px 0;
    font-size: 14px;
    color: #333;
}

.leaflet-popup-content .localisation_text a {
    color: #30317A;
    text-decoration: underline;
}

.leaflet-popup-content img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px 4px 0 0;
    margin-bottom: 10px;
}

/* Styles pour les marqueurs personnalisés */
.custom-marker-icon,
.custom-marker-icon-hover {
    background: transparent !important;
    border: none !important;
}

.gite-icon {
    background-color: #EEC65C;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-align: center;
    font-size: 14px;
    font-weight: bold;
}

/* Scrollbar personnalisée pour la liste */
.yannjarno-post-list::-webkit-scrollbar {
    width: 8px;
}

.yannjarno-post-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.yannjarno-post-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.yannjarno-post-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Styles pour les clusters de marqueurs */
.marker-cluster {
    background-clip: padding-box;
    border-radius: 20px;
    background-color: rgba(0,62,98,0.8);
}

.marker-cluster div {
    width: 30px;
    height: 30px;
    margin-left: 5px;
    margin-top: 5px;
    text-align: center;
    border-radius: 15px;
    font-weight: bold;
    background-color: rgba(0,62,98,0.8);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.marker-cluster:hover {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

/* Styles responsifs */
@media (max-width: 768px) {
    .yannjarno-map-container {
        flex-direction: column-reverse;
    }
    
    .yannjarno-map,
    .yannjarno-post-list {
        width: 100% !important;
    }
    
    .yannjarno-post-list {
        height: 300px !important;
        border-right: none !important;
        border-top: 1px solid #ddd;
    }
    
    .yannjarno-map-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .yannjarno-filter-select {
        width: 100%;
        min-width: auto;
    }
    
    .radio-button {
        justify-content: space-between;
        gap: 15px;
    }
    
    .radio-button div {
        flex: 1;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .radio-button {
        flex-direction: column;
        gap: 10px;
    }
    
    .radio-button div {
        justify-content: flex-start;
    }
    
    .yannjarno-post-list .post-item {
        padding: 8px;
    }
    
    .yannjarno-post-list .post-item h3 {
        font-size: 14px;
    }
    
    .yannjarno-post-list .post-item .post-image {
        height: 120px;
    }
}

/* Masquer les contrôles Leaflet par défaut si souhaité */
.leaflet-control-attribution.leaflet-control {
    display: none;
}

.leaflet-control-zoom.leaflet-bar.leaflet-control {
    display: none;
}