/* ============================================
   MAP CONTAINER
============================================ */
.map-section {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    margin: 0 auto;
    max-width: 1100px;
}

.map-controls {
    position: absolute;
    top: var(--space-md);
    left: var(--space-md);
    right: var(--space-md);
    z-index: 500;
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

#map {
    width: 100%;
    height: 500px;
}

.map-section:fullscreen,
.map-section.is-fullscreen {
    max-width: none;
    border-radius: 0;
    background: var(--white);
}

.map-section:fullscreen #map,
.map-section.is-fullscreen #map {
    height: 100vh;
}

@media (max-width: 768px) {
    #btnFullscreen {
        display: none;
    }
}

/* ============================================
   SEARCH BOX
============================================ */
.search-box {
    flex: 1;
    min-width: 200px;
    max-width: 350px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: none;
    border-radius: var(--radius-lg);
    background: var(--white);
    box-shadow: var(--shadow-md);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: box-shadow var(--transition-fast);
}

.search-box input:focus {
    box-shadow: var(--shadow-lg), 0 0 0 3px var(--orange-bg);
}

.search-box svg {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--gray-500);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: var(--space-xs);
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-height: 250px;
    overflow-y: auto;
    display: none;
}

.search-results.active {
    display: block;
}

.search-result-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background var(--transition-fast);
    border-bottom: 1px solid var(--gray-100);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--orange-bg);
}

.search-result-item strong {
    display: block;
    font-size: 0.9rem;
    color: var(--gray-800);
}

.search-result-item span {
    font-size: 0.8rem;
    color: var(--gray-500);
}

/* ============================================
   MAP BUTTONS
============================================ */
.map-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.map-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.map-btn svg {
    width: 22px;
    height: 22px;
    color: var(--gray-700);
}

/* ============================================
   MAP LEGEND
============================================ */
.map-legend {
    position: absolute;
    bottom: var(--space-md);
    left: var(--space-md);
    background: var(--white);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    z-index: 500;
    display: flex;
    gap: var(--space-md);
    font-size: 0.8rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-dot.high { background: var(--green); }
.legend-dot.medium { background: var(--yellow); }
.legend-dot.low { background: var(--red); }

/* ============================================
   CUSTOM LEAFLET MARKERS
============================================ */
.custom-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
}

.custom-marker span {
    transform: rotate(45deg);
    font-size: 12px;
    font-weight: 700;
    color: var(--white);
}

.marker-high { background: var(--green); }
.marker-medium { background: var(--yellow); }
.marker-low { background: var(--red); }

/* ============================================
   REGISTRATION LOCATION MARKER
============================================ */
.registration-marker-wrapper {
    background: transparent !important;
}

.registration-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #E91E63, #FF5722);
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 4px 15px rgba(233, 30, 99, 0.5);
    animation: pulse-registration 2s infinite;
}

.registration-marker svg {
    transform: rotate(45deg);
    color: white;
    width: 20px;
    height: 20px;
}

@keyframes pulse-registration {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(233, 30, 99, 0.5);
    }
    50% {
        box-shadow: 0 4px 25px rgba(233, 30, 99, 0.8);
    }
}

.registration-popup {
    padding: var(--space-sm);
    text-align: center;
}

/* ============================================
   CUSTOM POPUP STYLES
============================================ */
.leaflet-popup-content-wrapper {
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-lg) !important;
    padding: 0 !important;
}

.leaflet-popup-content {
    margin: 0 !important;
    min-width: 220px !important;
}

.leaflet-popup-tip {
    box-shadow: none !important;
}

.station-popup {
    padding: var(--space-md);
}

.station-popup h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: var(--space-xs);
}

.station-popup .address {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: var(--space-md);
}

.station-popup .availability {
    display: flex;
    gap: var(--space-sm);
}

.station-popup .avail-item {
    flex: 1;
    text-align: center;
    padding: var(--space-sm);
    background: var(--gray-50);
    border-radius: var(--radius-md);
}

.station-popup .avail-item .count {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
}

.station-popup .avail-item .label {
    font-size: 0.7rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.station-popup .avail-item.ebikes .count { color: var(--green); }

/* ============================================
   POPUP BUTTONS
============================================ */
.report-problem-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-top: var(--space-md);
    padding: 8px 12px;
    background: var(--gray-100);
    color: #1a5276;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: background var(--transition-fast);
}

.report-problem-btn:hover {
    background: var(--orange-velok);
    color: var(--white);
}

.report-problem-btn svg {
    flex-shrink: 0;
}

.directions-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-top: var(--space-sm);
    padding: 8px 12px;
    background: var(--gray-100);
    color: #1a5276;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: background var(--transition-fast);
}

.directions-btn:hover {
    background: var(--orange-velok);
    color: var(--white);
}

.directions-btn svg {
    flex-shrink: 0;
}
