﻿/* ==========================================
   MAP.CSS - Map Page Styles
   ========================================== */

:root {
    /* Palette */
    --map-bg-start: #F5F5F5;
    --map-bg-end: #FAFAFA;
    --primary: #E84E1B;
    --primary-dark: #D04317;
    --accent: #f97316;
    --yellow: #FFC107;
    --teal: #06B6D4;
    --danger: #EF4444;
    --purple: #7C3AED;
    --blue: #4285F4;
    --muted: #6b7280;
}

.map-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 80px);
    background: linear-gradient(135deg, var(--map-bg-start) 0%, var(--map-bg-end) 100%);
    overflow: hidden;
    margin: -1rem -1rem -80px -1rem;
}

/* Map Header */
.map-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1.5rem 1rem;
    box-shadow: 0 4px 12px rgba(232, 78, 27, 0.2);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.map-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.map-header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
}

.map-title-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.map-icon-badge {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 0.75rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.map-title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.map-subtitle {
    margin: 0.5rem 0 0 0;
    font-size: 0.9rem;
    opacity: 0.95;
    font-weight: 400;
}

.map-help-btn {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.75rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.map-help-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Info Toast Notification */
.map-info-toast {
    position: absolute;
    top: 4rem;
    right: 1rem;
    z-index: 10001;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    min-width: 280px;
    max-width: 340px;
    animation: toastSlideIn 0.3s ease-out;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.toast-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem 0.75rem 0 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toast-header svg {
    flex-shrink: 0;
}

.toast-header strong {
    flex: 1;
    font-size: 0.9375rem;
    font-weight: 600;
}

.toast-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 0.25rem;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.toast-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast-tip {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: #2B2B2B;
    line-height: 1.4;
}

.tip-icon {
    flex-shrink: 0;
    color: #f97316;
    width: 18px;
    height: 18px;
}

@media (max-width: 768px) {
    .map-info-toast {
        top: 3.5rem;
        right: 0.75rem;
        min-width: 260px;
        max-width: calc(100vw - 1.5rem);
    }

    .toast-header {
        padding: 0.625rem 0.875rem;
    }

    .toast-header strong {
        font-size: 0.875rem;
    }

    .toast-body {
        padding: 0.875rem;
        gap: 0.625rem;
    }

    .toast-tip {
        font-size: 0.8125rem;
    }

    .tip-icon {
        width: 16px;
        height: 16px;
    }
}

/* Stats Bar */
.map-stats-bar {
    background: white;
    padding: 1rem 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid #E0E0E0;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.map-stats-bar.has-selection {
    background: linear-gradient(135deg, #fff7ed 0%, #ffffff 100%);
    border-bottom: 2px solid #f97316;
}

.map-stats-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

/* Selected Appointment Info */
.selected-appointment-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    background: white;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.15);
    border: 2px solid #f97316;
    position: relative;
}

.close-selection-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: #f3f4f6;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: #6b7280;
}

.close-selection-btn:hover {
    background: #e5e7eb;
    color: #111827;
    transform: rotate(90deg);
}

.selection-badge {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(249, 115, 22, 0.3);
}

.selection-badge svg {
    width: 14px;
    height: 14px;
}

.selection-content {
    flex: 1;
    min-width: 0;
}

.selection-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.selection-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
}

.selection-time {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
}

.selection-details {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.selection-location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.selection-location svg {
    flex-shrink: 0;
    color: #f97316;
}

.selection-distance-badge {
    background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
    color: #E84E1B;
    font-weight: 700;
    font-size: 1rem;
    padding: 0.375rem 0.875rem;
    border-radius: 1rem;
    border: 1px solid rgba(232, 78, 27, 0.2);
    white-space: nowrap;
}

/* Compact Selection Badge */
.selection-badge-compact {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
    padding: 0.375rem 0.625rem;
    border-radius: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(249, 115, 22, 0.3);
}

/* Compact Close Button */
.close-selection-btn-compact {
    background: #f3f4f6;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: #6b7280;
    flex-shrink: 0;
}

.close-selection-btn-compact:hover {
    background: #e5e7eb;
    color: #111827;
    transform: rotate(90deg);
}

/* Selection Time Badge */
.selection-time-badge {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: #f3f4f6;
    border-radius: 1rem;
    color: #374151;
    font-size: 0.8125rem;
    font-weight: 500;
    flex-shrink: 0;
}

.selection-time-badge svg {
    flex-shrink: 0;
}

/* Default Location Tracking Info */
.location-track-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
    justify-content: center;
}

.track-location,
.track-destination {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: #2B2B2B;
    font-weight: 600;
    font-size: 0.9375rem;
}

.location-text {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.location-main {
    font-weight: 600;
    color: #2B2B2B;
    font-size: 0.9375rem;
    line-height: 1.2;
}

.location-street {
    font-weight: 400;
    color: #666;
    font-size: 0.75rem;
    line-height: 1.2;
}

.track-distance {
    color: #E84E1B;
    font-weight: 700;
    font-size: 1.125rem;
    white-space: nowrap;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
    border-radius: 1rem;
    border: 1px solid rgba(232, 78, 27, 0.2);
}

.arrow-icon {
    color: #A5A5A5;
    flex-shrink: 0;
}

.location-disclaimer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #E84E1B;
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
    padding: 0.5rem 1rem;
    background: #FFF3E0;
    border-radius: 1.5rem;
    border: 1px solid rgba(232, 78, 27, 0.2);
    box-shadow: 0 2px 4px rgba(232, 78, 27, 0.1);
}

.location-disclaimer svg {
    flex-shrink: 0;
}

/* Modern Map Container */
.modern-map-container {
    flex: 1;
    position: relative;
    margin: 1rem;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    background: white;
}

#map {
    height: 100%;
    width: 100%;
}

/* Map Controls Panel */
.map-controls-panel {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 1000;
}

/* Map View Dropdown */
.map-view-dropdown {
    position: relative;
}

.map-view-dropdown .map-control-btn {
    padding: 0.75rem 1rem;
    min-width: 140px;
    justify-content: space-between;
}

/* Ensure the layers (map view) button has no harsh border and has rounded corners */
.map-view-dropdown .map-control-btn {
    border: none; /* remove default browser border */
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    color: #2B2B2B;
}

#current-layer-text {
    margin-left: 0.5rem;
    font-weight: 600;
}

/* Dropdown Menu */
.map-view-menu {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 0.5rem;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    min-width: 180px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.map-view-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.map-view-item {
    padding: 0.875rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    color: #2B2B2B;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.2s;
    border-bottom: 1px solid #f3f4f6;
}

.map-view-item:last-child {
    border-bottom: none;
}

.map-view-item:hover {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
}

.layer-icon {
    flex-shrink: 0;
    color: #6b7280;
    transition: color 0.2s;
}

.map-view-item:hover .layer-icon {
    color: #f97316;
}

.map-view-radio {
    margin-left: auto;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    background: white;
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.map-view-radio.selected {
    border-color: #f97316;
    background: white;
}

.map-view-radio.selected::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #f97316;
}

.map-view-item:hover .map-view-radio {
    border-color: #f97316;
    transform: scale(1.1);
}


/* Map Legend - Mobile First (Compact Design) */
.map-legend {
    position: absolute;
    bottom: 0.5rem;
    left: 0.5rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 0.625rem 0.75rem;
    border-radius: 0.625rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    min-width: auto;
    max-width: 140px;
    z-index: 1000;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.map-legend .legend-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
}

/* Collapsed legend sizing to match the layer dropdown button */
.map-legend.collapsed {
    min-width: 140px;
}

.map-legend .legend-header {
    padding: 0.25rem 0.5rem;
}

.map-legend.collapsed .legend-header {
    padding: 0.75rem 1rem;
}

.map-legend .legend-toggle {
    font-size: 12px;
    color: #6b7280;
}

.map-legend .legend-body {
    margin-top: 8px;
}

.legend-section-title {
    font-size: 0.65rem;
    color: #9ca3af;
    font-weight: 700;
    text-transform: uppercase;
    margin-top: 6px;
    margin-bottom: 6px;
}

.legend-marker.blaaswerk { background: #FFC107; border: 2px solid white; }
.legend-marker.voorwerk { background: #06B6D4; border: 2px solid white; }
.legend-marker.schadeherstel { background: #EF4444; border: 2px solid white; }
.legend-marker.hoogwerker { background: #7C3AED; border: 2px solid white; }

.map-legend.collapsed .legend-body { display: none; }

.legend-title {
    font-weight: 600;
    color: #2B2B2B;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.375rem;
    font-size: 0.75rem;
    color: #666;
}

.legend-item:last-child {
    margin-bottom: 0;
}

.legend-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.legend-marker {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.6875rem;
    flex-shrink: 0;
}

/* common marker chrome */
.legend-marker {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.6875rem;
    flex-shrink: 0;
    border: 2px solid white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.legend-marker.numbered { background-color: var(--primary); color: white; }
.legend-marker.you { background-color: var(--blue); color: white; }

/* Mobile Fullscreen Mode (iOS and fallback) */
.mobile-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    border-radius: 0 !important;
    z-index: 9999 !important;
}

.mobile-fullscreen #map {
    height: 100vh !important;
    border-radius: 0 !important;
}

/* iOS-specific fixes for mobile fullscreen */
@supports (-webkit-touch-callout: none) {
    .mobile-fullscreen {
        /* iOS Safari */
        height: -webkit-fill-available !important;
    }
    
    .mobile-fullscreen #map {
        height: -webkit-fill-available !important;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .map-page {
        height: calc(100vh - 60px);
        overflow: hidden;
        margin: -1rem -1rem -80px -1rem;
    }

    .map-header {
        padding: 1rem;
    }

    .map-title {
        font-size: 1.25rem;
    }

    .map-subtitle {
        font-size: 0.75rem;
    }

    .map-icon-badge {
        padding: 0.5rem;
    }

    .map-icon-badge svg {
        width: 20px;
        height: 20px;
    }

    .map-stats-bar {
        padding: 0.875rem 1rem;
    }

    .map-stats-container {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .location-track-info {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .track-location,
    .track-destination {
        font-size: 0.8125rem;
    }

    .location-main {
        font-size: 0.8125rem;
    }

    .location-street {
        font-size: 0.6875rem;
    }

    .track-distance {
        font-size: 1rem;
    }

    .arrow-icon {
        display: none;
    }

    .location-disclaimer {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
        text-align: center;
        justify-content: center;
    }

    .modern-map-container {
        margin: 0.5rem;
        border-radius: 0.75rem;
    }

    .map-controls-panel {
        bottom: 0.5rem;
        right: 0.5rem;
    }

    .map-fullscreen-control {
        top: 0.5rem;
        right: 0.5rem;
    }

    .map-legend {
        max-width: 130px;
    }
    
    /* Dropdown on mobile - position above button */
    .map-view-menu {
        bottom: 100%;
        right: 0;
        left: auto;
        min-width: 160px;
    }
}

@media (max-width: 480px) {
    .map-title-section {
        gap: 0.5rem;
    }

    .map-title {
        font-size: 1.1rem;
    }

    .map-subtitle svg {
        display: none;
    }
}

/* Selected Appointment - Redesigned Layout (MOBILE FIRST) */
.selected-appointment-redesigned {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    max-width: 1200px;
    background: linear-gradient(135deg, #fff7ed 0%, #ffffff 100%);
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.15);
    border: 2px solid #f97316;
    position: relative;
}

/* Top Row: Badge, Flow, Close Button */
.selection-top-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}


/* Center Flow: Current — Distance — Destination */
.selection-flow-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex: 1;
    flex-wrap: wrap;
    font-size: 0.875rem;
    padding-right: 2rem; /* Space for close button */
}

/* Current Location */
.flow-location {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: #374151;
    font-weight: 500;
}

.flow-location svg {
    color: #6b7280;
    flex-shrink: 0;
}

/* Flow Separator */
.flow-separator {
    color: #9ca3af;
    font-weight: 400;
    margin: 0 0.125rem;
}

/* Distance */
.distance-center {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
    padding: 0.375rem 0.875rem;
    border-radius: 1.25rem;
    font-weight: 700;
    font-size: 0.875rem;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(249, 115, 22, 0.3);
}

/* Destination Name */
.flow-destination-name {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: #111827;
    font-weight: 600;
}

.flow-destination-name svg {
    color: #f97316;
    flex-shrink: 0;
}

/* Close Button - Highlighted Round Background (Top Right) */
.close-btn-highlighted {
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    border: 3px solid white;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 3px 8px rgba(249, 115, 22, 0.4);
    z-index: 2;
}

.close-btn-highlighted:hover {
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.5);
}

/* Address Row */
.selection-address-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: #6b7280;
}

.selection-address-row svg {
    flex-shrink: 0;
    color: #9ca3af;
}

/* Dates Row */
.selection-dates-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.selection-dates-row svg {
    flex-shrink: 0;
    color: #9ca3af;
}

.time-separator {
    color: #d1d5db;
    font-weight: 400;
    margin: 0 0.25rem;
}

/* Tablet (768px+) */
@media (min-width: 768px) {
    .selected-appointment-redesigned {
        padding: 1rem 1.25rem;
    }

    .selection-flow-center {
        font-size: 0.9375rem;
        gap: 0.625rem;
    }

    .distance-center {
        font-size: 0.9375rem;
        padding: 0.5rem 1.125rem;
    }

    .selection-address-row {
        font-size: 0.875rem;
    }

    .selection-dates-row {
        font-size: 0.8125rem;
    }

    /* Larger legend on tablet */
    .map-legend {
        max-width: 160px;
    }

    .legend-title {
        font-size: 0.8125rem;
    }

    .legend-item {
        font-size: 0.8125rem;
    }

    .legend-marker {
        width: 26px;
        height: 26px;
    }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
    .selection-flow-center {
        font-size: 1rem;
        gap: 0.75rem;
    }

    .distance-center {
        font-size: 1rem;
        padding: 0.625rem 1.25rem;
    }

    .selection-address-row {
        font-size: 0.9375rem;
    }

    .selection-dates-row {
        font-size: 0.875rem;
    }

    /* Full-size legend on desktop */
    .map-legend {
        bottom: 1rem;
        left: 1rem;
        max-width: 180px;
    }

    .legend-title {
        font-size: 0.875rem;
    }

    .legend-item {
        font-size: 0.875rem;
        gap: 0.625rem;
        margin-bottom: 0.5rem;
    }

    .legend-marker {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
}

/* Old styles - keeping for backwards compatibility during transition */
.selected-appointment-compact {
    display: flex;
    flex-direction: column;
    justify-content:center;
    gap: 0.625rem;
    width: 100%;
    max-width: 1200px;
    background: linear-gradient(135deg, #fff7ed 0%, #ffffff 100%);
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.15);
    border: 2px solid #f97316;
    position: relative;
}

.close-selection-btn-mini {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: #6b7280;
    z-index: 1;
}

.close-selection-btn-mini:hover {
    background: white;
    color: #f97316;
    transform: rotate(90deg);
}

.selection-badge-mini {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

/* Row 1: Location Flow */
.selected-location-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.875rem;
    font-weight: 500;
}

.location-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: #374151;
}

.location-item svg {
    flex-shrink: 0;
    color: #6b7280;
}

.location-item.destination {
    color: #111827;
    font-weight: 600;
    gap: 0.5rem;
}

.location-item.destination svg {
    color: #f97316;
    flex-shrink: 0;
}

.destination-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.destination-title {
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
}

.destination-address {
    font-weight: 400;
    color: #6b7280;
    font-size: 0.8125rem;
    line-height: 1.2;
}

.flow-arrow {
    color: #9ca3af;
    flex-shrink: 0;
}

.distance-value {
    color: #f97316;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
    border-radius: 0.5rem;
    font-size: 0.8125rem;
}

/* Row 2: Dates */
.selected-dates-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.8125rem;
    color: #6b7280;
    padding-left: 1.875rem; /* Align with location row (after badge) */
}

.date-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.date-item svg {
    flex-shrink: 0;
    color: #9ca3af;
}

.date-separator {
    color: #d1d5db;
    font-weight: 600;
}

/* Tablet (768px+) - Keep rows but increase spacing */
@media (min-width: 768px) {
    .selected-appointment-compact {
        padding: 1rem 1.25rem;
        gap: 0.75rem;
    }

    .selected-location-row {
        font-size: 0.9375rem;
        gap: 0.625rem;
    }

    .selected-dates-row {
        font-size: 0.875rem;
        gap: 0.625rem;
    }

    .distance-value {
        font-size: 0.875rem;
    }

    .destination-address {
        font-size: 0.875rem;
    }
}

/* Desktop (1024px+) - Larger text */
@media (min-width: 1024px) {
    .selected-location-row {
        font-size: 1rem;
    }

    .selected-dates-row {
        font-size: 0.9375rem;
    }

    .distance-value {
        font-size: 0.9375rem;
        padding: 0.375rem 0.625rem;
    }

    .destination-title {
        font-size: 1.0625rem;
    }

    .destination-address {
        font-size: 0.9375rem;
    }
}

/* Hide on mobile if too cramped (< 400px) */
@media (max-width: 400px) {
    .flow-arrow {
        display: none;
    }
    
    .selected-dates-row {
        padding-left: 0;
    }
}

/* Custom Numbered Map Markers */

.numbered-marker {
    /* marker color is driven by --marker-color; fallback to orange */
    background-color: var(--marker-color, #E84E1B);
    color: white;
    border: 3px solid var(--marker-border-color, white);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    position: relative;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.numbered-marker::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid var(--marker-color, #E84E1B);
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2));
}

.numbered-marker.selected {
    transform: scale(1.15);
    z-index: 1000 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.numbered-marker.selected::after { border-top-color: var(--marker-color, #E84E1B); }

.leaflet-marker-icon.numbered-marker-icon { background: transparent; border: none; }

.numbered-marker.closest-1 { width: 42px; height: 42px; font-size: 1rem; border-width: 4px; }
.numbered-marker.closest-2 { width: 40px; height: 40px; font-size: 0.9375rem; }
.numbered-marker.closest-3 { width: 38px; height: 38px; font-size: 0.9rem; }

.numbered-marker.closest-1::before {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border-radius: 50%;
    border: 2px solid #E84E1B;
    animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

.leaflet-popup-content-wrapper {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.leaflet-popup-content {
    margin: 1rem;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* Center tags row in the selection bar */
.selection-tags-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

.leaflet-popup-tip {
    background-color: white;
}

.marker-popup-title {
    font-weight: 600;
    color: #2B2B2B;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.current-location-marker {
    animation: locationPulse 2s ease-in-out infinite;
}

@keyframes locationPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}
