/* ==========================================================================
   HOZIR Map Styles
   Restrained, Minimalist, High-Precision Map UI
   ========================================================================== */

.map-page {
    position: relative;
    height: calc(100vh - 64px);
    width: 100%;
    overflow: hidden;
}

.map-container {
    width: 100%;
    height: 100%;
}

/* Filter Bar (Top Floating Control) */
.map-filter-bar {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 1200;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 6px 10px;
    border-radius: var(--radius-lg, 12px);
    border: 1px solid var(--color-border, #e4e4e7);
    box-shadow: var(--shadow-card, 0 4px 12px rgba(0, 0, 0, 0.06));
    max-width: calc(100% - 32px);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.filter-separator {
    width: 1px;
    height: 18px;
    background-color: var(--color-border, #e4e4e7);
    margin: 0 2px;
}

.filter-btn {
    font-family: var(--font-sans);
    border: 1px solid transparent;
    background: transparent;
    color: var(--color-text-muted, #71717a);
    padding: 6px 12px;
    border-radius: var(--radius-md, 8px);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.filter-btn:hover {
    color: var(--color-text-main, #09090b);
    background-color: var(--color-border-subtle, #f4f4f5);
}

.filter-btn.active {
    background-color: var(--color-primary, #18181b);
    color: #ffffff;
}

.filter-select {
    font-family: var(--font-sans);
    border: 1px solid var(--color-border, #e4e4e7);
    background-color: #ffffff;
    color: var(--color-text-main, #09090b);
    padding: 5px 8px;
    border-radius: var(--radius-sm, 6px);
    font-size: 0.8125rem;
    outline: none;
    cursor: pointer;
}

.filter-select:focus {
    border-color: var(--color-primary, #18181b);
}

/* Map Overlays */
.map-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 400;
    background: #ffffff;
    padding: 1.5rem 2rem;
    border-radius: var(--radius-lg, 12px);
    border: 1px solid var(--color-border, #e4e4e7);
    box-shadow: var(--shadow-elevated, 0 10px 15px -3px rgba(0, 0, 0, 0.05));
    text-align: center;
    max-width: 340px;
    width: 90%;
}

.overlay-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text-main, #09090b);
    margin-bottom: 0.25rem;
}

.overlay-subtitle {
    font-size: 0.8125rem;
    color: var(--color-text-muted, #71717a);
}

.overlay-text {
    font-size: 0.875rem;
    color: var(--color-text-muted, #71717a);
}

.overlay-error {
    color: var(--color-danger, #dc2626);
    margin-bottom: 0.75rem;
}

.spinner {
    width: 28px;
    height: 28px;
    border: 2px solid #e4e4e7;
    border-top-color: #18181b;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 0 auto 0.75rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Custom Vector Markers (High Precision, No Blurry Bitmaps)
   ========================================================================== */
.custom-map-marker {
    background: transparent !important;
    border: none !important;
}

/* ==========================================================================
   Teardrop Location Pin Markers with Photo / Category Icon
   ========================================================================== */
.hozir-pin-container {
    position: relative;
    width: 44px;
    height: 56px;
    cursor: pointer;
    transition: transform 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25));
}

.hozir-pin-container:hover {
    transform: scale(1.18) translateY(-6px);
    z-index: 1000 !important;
}

.hozir-pin-pulse {
    position: absolute;
    top: 2px;
    left: 4px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.45);
    animation: hozir-pin-radar 2s cubic-bezier(0, 0, 0.2, 1) infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes hozir-pin-radar {
    0% { transform: scale(0.6); opacity: 0.9; }
    75%, 100% { transform: scale(2.2); opacity: 0; }
}

.hozir-pin-svg {
    display: block;
    width: 44px;
    height: 56px;
    position: relative;
    z-index: 1;
}

.hozir-pin-icon-overlay {
    position: absolute;
    top: 10px;
    left: 12px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    pointer-events: none;
}

/* Leaflet Custom Popup (Clean, Human, High-End) */
.leaflet-popup-content-wrapper {
    border-radius: var(--radius-lg, 12px) !important;
    padding: 0 !important;
    overflow: hidden;
    box-shadow: var(--shadow-floating, 0 20px 25px -5px rgba(0, 0, 0, 0.1)) !important;
    border: 1px solid var(--color-border, #e4e4e7) !important;
}

.leaflet-popup-content {
    margin: 0 !important;
    line-height: 1.4 !important;
    max-width: 280px;
}

.leaflet-container a.leaflet-popup-close-button {
    top: 8px !important;
    right: 8px !important;
    padding: 4px !important;
    color: #71717a !important;
    font-size: 16px !important;
    width: 20px !important;
    height: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(255, 255, 255, 0.8) !important;
    border-radius: 50% !important;
    z-index: 10 !important;
}

.event-popup-card {
    padding: 14px 16px;
}

.event-popup-cover {
    width: 100%;
    height: 120px;
    background: #18181b;
    overflow: hidden;
}

.event-popup-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.event-popup-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.event-popup-category {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted, #71717a);
}

.event-popup-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text-main, #09090b);
    line-height: 1.35;
    margin-bottom: 6px;
}

.event-popup-location {
    font-size: 0.8125rem;
    color: var(--color-text-muted, #71717a);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 10px;
}

.event-popup-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid var(--color-border, #e4e4e7);
}

.event-popup-price {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text-main, #09090b);
}

.event-popup-link {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-accent, #2563eb);
    text-decoration: none;
    transition: opacity 0.15s ease;
}

.event-popup-link:hover {
    text-decoration: underline;
}

/* ==========================================================================
   User Geolocation Marker (Pulsing Blue Dot - Apple Maps Style)
   ========================================================================== */
.user-geo-marker {
    background: transparent !important;
    border: none !important;
}

.user-geo-container {
    position: relative;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-geo-pulse {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.35);
    animation: user-geo-ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes user-geo-ping {
    0% { transform: scale(0.6); opacity: 0.9; }
    75%, 100% { transform: scale(2.6); opacity: 0; }
}

.user-geo-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #2563eb;
    border: 2.5px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

/* Locate Me Button */
.btn-locate {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #ffffff;
    border: 1px solid var(--color-border, #e4e4e7);
    border-radius: var(--radius-md, 8px);
    color: var(--color-text-main, #09090b);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-locate:hover {
    background: var(--color-border-subtle, #f4f4f5);
    border-color: #d4d4d8;
}

.btn-locate.active {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.btn-locate.locating svg {
    animation: spin 1s linear infinite;
}

/* ==========================================================================
   Nearby Events Drawer (Floating Left Panel)
   ========================================================================== */
.nearby-drawer {
    position: absolute;
    bottom: 20px;
    left: 16px;
    z-index: 1200;
    width: 340px;
    max-width: calc(100% - 32px);
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.15), 0 0 0 1px rgba(15, 23, 42, 0.05);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nearby-drawer.collapsed .nearby-drawer-body {
    display: none;
}

.nearby-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #ffffff;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    user-select: none;
}

.nearby-drawer-header:hover {
    background: #f8fafc;
}

.nearby-drawer-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nearby-header-icon {
    color: #2563eb;
    flex-shrink: 0;
}

.nearby-drawer-title {
    font-size: 0.84rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.01em;
}

.nearby-badge-count {
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 9999px;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.nearby-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    color: #64748b;
}

.nearby-drawer.collapsed .nearby-toggle-icon {
    transform: rotate(180deg);
}

.nearby-drawer-body {
    max-height: 260px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #f8fafc;
}

.nearby-drawer-body::-webkit-scrollbar {
    width: 4px;
}
.nearby-drawer-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

/* Compact Nearby Event Row */
.nearby-event-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    color: inherit;
    box-sizing: border-box;
    width: 100%;
}

.nearby-event-row:hover {
    border-color: #94a3b8;
    background: #ffffff;
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.06);
    transform: translateY(-1px);
}

.nearby-event-row:active {
    transform: translateY(0);
}

/* Status Badge - Single Line Always */
.nearby-status-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 3px 7px;
    border-radius: 6px;
    white-space: nowrap;
    line-height: 1;
}

.nearby-status-badge .nearby-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.nearby-status-badge.status-live {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}
.nearby-status-badge.status-live .nearby-status-dot {
    background: #10b981;
    animation: nearby-pulse 1.8s infinite;
}

.nearby-status-badge.status-ending {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}
.nearby-status-badge.status-ending .nearby-status-dot {
    background: #f59e0b;
}

.nearby-status-badge.status-upcoming {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}
.nearby-status-badge.status-upcoming .nearby-status-dot {
    background: #3b82f6;
}

@keyframes nearby-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.3); }
}

/* Event Info */
.nearby-event-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.nearby-event-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}

.nearby-event-sub {
    font-size: 0.72rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    margin-top: 2px;
}

/* Distance Chip */
.nearby-dist-chip {
    flex-shrink: 0;
    font-size: 0.72rem;
    font-weight: 700;
    color: #1e40af;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    padding: 3px 8px;
    border-radius: 9999px;
    white-space: nowrap;
    line-height: 1;
}

.nearby-prompt-box {
    padding: 16px 12px;
    text-align: center;
    background: #ffffff;
    border-radius: 8px;
    border: 1px dashed #cbd5e1;
}

.nearby-prompt-text {
    font-size: 0.8125rem;
    color: #64748b;
    margin-bottom: 10px;
    line-height: 1.4;
}

/* Mobile Adjustments */
@media (max-width: 640px) {
    .map-page {
        height: calc(100vh - 56px);
    }

    .map-filter-bar {
        left: 8px;
        right: 8px;
        top: 8px;
        max-width: calc(100% - 16px);
        overflow-x: auto;
        white-space: nowrap;
        padding: 5px 8px;
    }

    .filter-btn {
        padding: 5px 8px;
        font-size: 0.75rem;
    }

    .filter-select {
        font-size: 0.75rem;
    }

    .nearby-drawer {
        bottom: 12px;
        left: 8px;
        right: 8px;
        width: auto;
        max-width: calc(100% - 16px);
    }
}
