/* ============================================
   Real-e-stats | Shared Styles
   Map, markers, and common elements
   ============================================ */

/* === Font Import (shared across pages) === */
@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap");

/* === Base resets (shared) === */
body {
    margin: 0;
    font-family: Arial, sans-serif;
}

/* === Map core === */
#map {
    height: 100vh;
    width: 100%;
    z-index: 0;
}

#filter-controls {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1000;
    background-color: white;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
    font-family: sans-serif;
}

/* === Custom map markers === */
.custom-marker {
    background-color: #337ab7;
    color: white;
    border-radius: 4px;
    padding: 2px 4px;
    width: 58px;
    min-width: 58px;
    height: 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.34);
    border: 1px solid white;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
    z-index: 10;
    font-size: 9px;
    line-height: 1.08;
    padding-top: 3px;
    padding-bottom: 2px;
    overflow: visible;
}

.custom-marker.good {
    background: linear-gradient(180deg, #3dbf73 0%, #1e8f50 100%);
    border-color: #e4fff0;
    box-shadow: 0 3px 8px rgba(8, 71, 35, 0.45);
}

.custom-marker.fair {
    background: linear-gradient(180deg, #3d97e8 0%, #2e66be 100%);
    border-color: #e4efff;
    box-shadow: 0 3px 8px rgba(15, 49, 110, 0.42);
}

.custom-marker.high {
    background: linear-gradient(180deg, #e86986 0%, #c73d5d 100%);
    border-color: #ffe5ec;
    box-shadow: 0 3px 8px rgba(117, 20, 43, 0.42);
}

.custom-marker.unknown {
    background: linear-gradient(180deg, #a3adbd 0%, #6f7b90 100%);
    border-color: #f1f3f7;
    box-shadow: 0 3px 8px rgba(55, 63, 79, 0.38);
}

.custom-marker.price-drop {
    border: 2px solid #f59e0b !important;
    box-shadow: 0 3px 10px rgba(245, 158, 11, 0.55) !important;
}
.custom-marker.price-drop .price {
    color: #fff59e;
}

.custom-marker .price {
    font-size: 10px;
    margin-bottom: 0;
}

.custom-marker .area {
    font-size: 7px;
    opacity: 0.92;
}

.custom-marker .tip {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    margin-left: -6px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid #337ab7;
}

.custom-marker.good .tip { border-top-color: #1e8f50; }
.custom-marker.fair .tip { border-top-color: #2e66be; }
.custom-marker.high .tip { border-top-color: #c73d5d; }
.custom-marker.unknown .tip { border-top-color: #6f7b90; }

/* === Leaflet popups === */
.leaflet-popup-content {
    font-size: 14px;
}

.leaflet-popup-content img {
    border-radius: 5px;
    margin-bottom: 5px;
}

.popup-container {
    display: flex;
    flex-direction: row;
    gap: 10px;
    max-width: 400px;
}

.popup-image {
    width: 150px;
    height: auto;
    object-fit: cover;
    flex-shrink: 0;
}

.popup-details {
    display: flex;
    flex-direction: column;
    font-size: 12px;
}

/* === Utility === */
#edit-form-container { 
    overflow: hidden; 
    transition: max-height 0.4s ease; 
    max-height: 0; 
}

#edit-form-container.open { 
    max-height: 1000px;
}

.chart-container { 
    height: 150px; 
}
