* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1a1a2e;
    overflow: hidden;
}

.navbar { height: 56px; }
#mapContainer {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
}
#map { width: 100%; height: 100%; }

/* Custom Leaflet styles */
.leaflet-popup-content-wrapper {
    border-radius: 12px;
    padding: 0;
}
.leaflet-popup-content { margin: 0; }

/* Parcel styles */
.parcel-selling {
    fill: #28a745;
    fill-opacity: 0.35;
    stroke: #28a745;
    stroke-width: 2;
}
.parcel-selling:hover {
    fill-opacity: 0.55;
    stroke-width: 3;
}
.parcel-sold {
    fill: #6c757d;
    fill-opacity: 0.25;
    stroke: #6c757d;
    stroke-width: 1.5;
}
.parcel-pending {
    fill: #ffc107;
    fill-opacity: 0.35;
    stroke: #ffc107;
    stroke-width: 2;
}
.parcel-not_for_sale {
    fill: transparent;
    stroke: #666;
    stroke-width: 1;
    stroke-dasharray: 4 3;
}
.parcel-highlighted {
    fill-opacity: 0.6 !important;
    stroke-width: 3 !important;
}

/* Parcel labels */
.parcel-label {
    font-size: 10px;
    font-weight: 600;
    color: #333;
    text-shadow: 0 0 3px #fff, 0 0 3px #fff;
    pointer-events: none;
    white-space: nowrap;
}
.parcel-label.selling { color: #28a745; }
.parcel-label.sold { color: #6c757d; }
.parcel-label.pending { color: #856404; }
.parcel-label.not_for_sale { color: #666; }

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

/* Search panel */
#searchPanel {
    transition: transform 0.3s ease;
}
#searchPanel.d-none {
    display: block !important;
    transform: translateX(100%);
}
#searchPanel:not(.d-none) {
    transform: translateX(0);
}

/* Info card */
#parcelInfo {
    transition: opacity 0.3s ease, transform 0.3s ease;
}
#parcelInfo.d-none {
    opacity: 0;
    transform: translate(-50%, 20px);
}

/* Loading overlay */
.loading-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.3);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive */
@media (max-width: 768px) {
    #searchPanel { width: 100% !important; }
    #statsOverlay { display: none !important; }
    #legend { font-size: 10px !important; }
    .parcel-label { font-size: 8px; }
}

/* Data layer tooltips */
.data-layer-tooltip {
    background: rgba(0,0,0,0.8) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 4px !important;
    padding: 4px 8px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}
.data-layer-tooltip::before {
    border-top-color: rgba(0,0,0,0.8) !important;
}

/* Layer control */
.leaflet-control-layers {
    border-radius: 8px !important;
    border: 1px solid #ddd !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
}
.leaflet-control-layers label {
    font-size: 12px !important;
}

/* Geolocation button */
.leaflet-bar a[title="Định vị vị trí của tôi"] {
    background: #fff;
    color: #333;
    transition: all 0.2s;
}
.leaflet-bar a[title="Định vị vị trí của tôi"]:hover {
    background: #e8f0fe;
    color: #4285f4;
    border-color: #4285f4;
}

/* User location marker */
.user-location-pulse {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: rgba(66,133,244,0.3);
    position: relative;
}
.user-location-pulse::after {
    content: '';
    position: absolute;
    top: 4px; left: 4px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: #4285f4;
    border: 2px solid #fff;
    animation: pulse-loc 2s infinite;
}
@keyframes pulse-loc {
    0% { box-shadow: 0 0 0 0 rgba(66,133,244,0.4); }
    70% { box-shadow: 0 0 0 12px rgba(66,133,244,0); }
    100% { box-shadow: 0 0 0 0 rgba(66,133,244,0); }
}

/* Stats panel */
#statsOverlay .bg-opacity-10 { transition: transform 0.2s; }
#statsOverlay .bg-opacity-10:hover { transform: translateY(-1px); }

/* Leaflet draw overrides */
.leaflet-draw-toolbar a { background-image: none !important; }
.leaflet-control-zoom { border: none !important; }
.leaflet-control-zoom a {
    background: #fff !important;
    color: #333 !important;
    border: 1px solid #ccc !important;
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
    font-size: 18px !important;
}
