/**
 * Styles pour MapBox Properties
 */

/* Container principal de la carte */
#mapbox-properties-map {
    width: 100%;
    height: 600px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

/* Style pour les marqueurs et clusters */
.mapboxgl-marker {
    cursor: pointer;
}

/* Style des popups */
.mapboxgl-popup {
    max-width: 300px !important;
    font-family: inherit;
}

.mapboxgl-popup-content {
    padding: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.property-popup {
    width: 100%;
}

.property-popup img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

.property-popup h4 {
    margin: 0;
    padding: 10px 15px 5px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.property-popup p {
    margin: 0;
    padding: 0 15px 10px;
    font-size: 14px;
    color: #3b82f6;
    font-weight: 500;
}

.property-popup .view-property {
    display: block;
    margin: 0 15px 15px;
    padding: 8px 12px;
    background-color: #3b82f6;
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.property-popup .view-property:hover {
    background-color: #2563eb;
}

/* Contrôles de calques POI */
.property-layers-control {
    position: absolute;
    top: 10px;
    right: 10px;
    background: white;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    padding: 10px;
    width: 220px;
    z-index: 2;
}

.control-title {
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 14px;
    color: #333;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

.control-item {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    font-size: 13px;
    cursor: pointer;
}

.control-item input {
    margin-right: 8px;
}

.control-item:hover span {
    color: #3b82f6;
}

/* Liste des propriétés */
.mapbox-properties-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 10px;
}

.mapbox-properties-list::-webkit-scrollbar {
    width: 6px;
}

.mapbox-properties-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.mapbox-properties-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.mapbox-properties-list::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

.property-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    border: 1px solid #e5e7eb;
}

.property-item:hover,
.property-item.active {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(59, 130, 246, 0.15);
    border-color: #3b82f6;
}

.property-image {
    width: 120px;
    min-width: 120px;
    height: 100px;
    position: relative;
    overflow: hidden;
}

.property-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.property-item:hover .property-image img {
    transform: scale(1.05);
}

.property-details {
    flex: 1;
    padding: 10px 15px;
    display: flex;
    flex-direction: column;
}

.property-details h3 {
    margin: 0 0 5px;
    font-size: 15px;
    color: #333;
    font-weight: 600;
    line-height: 1.3;
    /* Limiter à 2 lignes */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.property-meta {
    color: #3b82f6;
    font-weight: 600;
    font-size: 14px;
    margin: 0 0 5px;
}

.property-excerpt {
    font-size: 13px;
    color: #666;
    margin: 0 0 auto;
    line-height: 1.4;
    /* Limiter à 2 lignes */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.property-link {
    align-self: flex-start;
    display: inline-block;
    margin-top: 8px;
    font-size: 13px;
    background: #3b82f6;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.2s;
}

.property-link:hover {
    background-color: #2563eb;
}

/* Responsive pour petits écrans */
@media (max-width: 768px) {
    .mapbox-properties-container {
        flex-direction: column-reverse;
    }
    
    #mapbox-properties-map {
        height: 400px;
        margin-bottom: 20px;
    }
    
    .mapbox-properties-list {
        max-height: none;
    }
    
    .property-layers-control {
        width: 180px;
        font-size: 12px;
    }
}

/* Style pour le marqueur personnalisé */
.marker {
    background-color: #3b82f6;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    font-size: 12px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    border: 2px solid white;
}

.marker.active {
    background-color: #ef4444;
    transform: scale(1.2);
    z-index: 10;
}

/* Style pour les clusters */
.mapboxgl-canvas-container .mapboxgl-marker.cluster {
    background-color: #3b82f6;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    cursor: pointer;
    border: 3px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.mapboxgl-canvas-container .mapboxgl-marker.cluster-large {
    background-color: #2563eb;
    width: 50px;
    height: 50px;
}

/* Animation de zoom sur la carte */
.mapboxgl-canvas-container.mapboxgl-interactive {
    cursor: default;
}

/* Personnalisation des contrôles de navigation */
.mapboxgl-ctrl-top-right .mapboxgl-ctrl {
    margin: 10px 10px 0 0;
}

.mapboxgl-ctrl-group {
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.mapboxgl-ctrl button {
    width: 32px;
    height: 32px;
}

/* Style d'effet 3D renforcé pour les bâtiments */
.mapboxgl-canvas {
    outline: none;
}

/* Filtre avancé pour les propriétés */
.mapbox-properties-filter {
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.mapbox-properties-filter form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-group {
    flex: 1;
    min-width: 150px;
}

.filter-group label {
    display: block;
    font-size: 13px;
    margin-bottom: 5px;
    color: #666;
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    font-size: 14px;
}

.filter-submit {
    display: flex;
    align-items: flex-end;
}

.filter-submit button {
    padding: 8px 15px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.filter-submit button:hover {
    background-color: #2563eb;
}

/* Style pour la disposition à deux colonnes */
.mapbox-properties-container {
    display: flex;
    gap: 20px;
}

.mapbox-properties-sidebar {
    width: 40%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
}

.mapbox-properties-main {
    flex: 1;
}

/* Loader pour les chargements de données */
.mapbox-properties-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.8);
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 14px;
    color: #3b82f6;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(59, 130, 246, 0.3);
    border-radius: 50%;
    border-top-color: #3b82f6;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Style pour le bouton de basculement 3D */
.toggle-3d-view {
    position: absolute;
    bottom: 20px;
    right: 10px;
    background: white;
    border: none;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    cursor: pointer;
    z-index: 5;
}

.toggle-3d-view:hover {
    background: #f8f8f8;
}

.toggle-3d-view svg {
    width: 16px;
    height: 16px;
}

.toggle-3d-view.active {
    background: #3b82f6;
    color: white;
}