/* SaveBite – Leaflet Map Overrides & Map View Container */

/* ── Leaflet Dark Mode Overrides ── */
.leaflet-container { background: #0b0f19; font-family: 'Inter', sans-serif; }

.leaflet-control-zoom a { background: rgba(30,41,59,0.9) !important; color: #f8fafc !important; border-color: rgba(255,255,255,0.08) !important; backdrop-filter: blur(8px); transition: all 0.2s; }
.leaflet-control-zoom a:hover { background: rgba(30,41,59,1) !important; color: #10b981 !important; }
.leaflet-bar { border: 1px solid rgba(255,255,255,0.08) !important; box-shadow: 0 4px 16px rgba(0,0,0,0.4) !important; border-radius: 10px !important; overflow: hidden; }
.leaflet-control-attribution { background: rgba(11,15,25,0.7) !important; color: rgba(148,163,184,0.6) !important; font-size: 0.65rem !important; backdrop-filter: blur(6px); border-radius: 6px 0 0 0 !important; }
.leaflet-control-attribution a { color: rgba(148,163,184,0.7) !important; }

.leaflet-popup-content-wrapper { background: rgba(15,23,42,0.97) !important; border: 1px solid rgba(255,255,255,0.1) !important; border-radius: 14px !important; box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 0 1px rgba(16,185,129,0.2) !important; backdrop-filter: blur(12px); padding: 0 !important; overflow: hidden; }
.leaflet-popup-tip-container { margin-top: -1px; }
.leaflet-popup-tip { background: rgba(15,23,42,0.97) !important; box-shadow: none !important; }
.leaflet-popup-close-button { color: rgba(148,163,184,0.7) !important; font-size: 1.2rem !important; top: 8px !important; right: 10px !important; z-index: 10; }
.leaflet-popup-close-button:hover { color: #f8fafc !important; }
.leaflet-popup-content { margin: 0 !important; width: 240px !important; }

/* Map Popup Card */
.map-popup-card { overflow: hidden; border-radius: 14px; }
.map-popup-img  { width: 100%; height: 120px; object-fit: cover; display: block; }
.map-popup-body { padding: 0.85rem 1rem 1rem; }
.map-popup-badge { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 50px; font-size: 0.72rem; font-weight: 700; margin-bottom: 0.45rem; text-transform: uppercase; letter-spacing: 0.3px; }
.map-popup-badge.free { background: rgba(16,185,129,0.15); color: #10b981; border: 1px solid rgba(16,185,129,0.3); }
.map-popup-badge.sell { background: rgba(249,115,22,0.15); color: #f97316; border: 1px solid rgba(249,115,22,0.3); }
.map-popup-title { font-size: 0.9rem; font-weight: 700; color: #f8fafc; margin-bottom: 0.3rem; line-height: 1.3; }
.map-popup-meta { font-size: 0.75rem; color: #94a3b8; margin-bottom: 0.75rem; display: flex; flex-direction: column; gap: 0.2rem; }
.map-popup-meta span { display: flex; align-items: center; gap: 0.3rem; }
.map-popup-btn { width: 100%; background: linear-gradient(135deg, #10b981, #059669); border: none; border-radius: 8px; color: white; padding: 0.55rem; font-weight: 700; font-size: 0.82rem; cursor: pointer; transition: all 0.2s; }
.map-popup-btn.sell-btn { background: linear-gradient(135deg, #f97316, #ea580c); }
.map-popup-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(16,185,129,0.3); }
.map-popup-btn.sell-btn:hover { box-shadow: 0 4px 12px rgba(249,115,22,0.3); }

/* User location pulse */
@keyframes userPulse { 0% { transform: scale(1); opacity: 0.8; } 100% { transform: scale(2.5); opacity: 0; } }
.user-location-marker {
    width: 16px; height: 16px; background: #3b82f6;
    border-radius: 50%; border: 2px solid rgba(255,255,255,0.8);
    box-shadow: 0 0 8px rgba(59,130,246,0.8); position: relative;
}
.user-location-marker::after {
    content: ''; position: absolute; top: -4px; left: -4px; width: 24px; height: 24px;
    border: 2px solid rgba(59,130,246,0.6); border-radius: 50%;
    animation: userPulse 2s ease-out infinite;
}

/* Leaflet tile dark filter */
.map-view-container { position: relative; width: 100%; height: calc(100vh - 180px); min-height: 600px; border-radius: var(--radius-md); overflow: hidden; }
.leaflet-tile-pane { filter: brightness(0.6) invert(1) contrast(3) hue-rotate(200deg) saturate(0.3) brightness(0.7); }

/* Legacy canvas map view */
.map-view-container { height: 550px; background: rgba(30,41,59,0.2); border: 1px solid var(--border-color); border-radius: var(--radius-lg); overflow: hidden; position: relative; backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); }
#map-canvas { width: 100%; height: 100%; cursor: grab; }
#map-canvas:active { cursor: grabbing; }

.map-overlay-info { position: absolute; bottom: 1.5rem; left: 1.5rem; background: rgba(15,23,42,0.85); border: 1px solid var(--border-color); backdrop-filter: blur(8px); padding: 1.25rem; border-radius: var(--radius-md); max-width: 320px; display: flex; flex-direction: column; gap: 0.75rem; box-shadow: var(--shadow-lg); animation: fadeIn 0.4s ease-out; }
.map-info-title  { font-size: 1rem; font-weight: 700; }
.map-info-detail { font-size: 0.85rem; color: var(--text-muted); line-height: 1.4; }
.map-info-btn    { align-self: flex-start; padding: 0.4rem 0.8rem; font-size: 0.8rem; }

/* Map loading overlay spinner */
@keyframes spin { to { transform: rotate(360deg); } }
