/* ═══════════════════════════════════════════════════════════════════════
   MAP FEATURE — Styles for search/category map view
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── Map Container ─────────────────────────────────────────────────── */
#mapContainer {
    width: 100%;
    height: 70vh;
    min-height: 400px;
    border-radius: 12px;
    overflow: hidden;
    margin: 20px auto;
    position: relative;
    z-index: 1;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

#mapContainer.hidden {
    display: none;
}

/* ─── View Toggle ───────────────────────────────────────────────────── */
.view-toggle {
    display: inline-flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    padding: 3px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-left: 12px;
    vertical-align: middle;
}

.view-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.view-btn:hover {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.05);
}

.view-btn.active {
    color: #fff;
    background: rgba(99, 102, 241, 0.35);
    box-shadow: 0 1px 4px rgba(99, 102, 241, 0.2);
}

.view-btn i {
    font-size: 0.9rem;
}

/* ─── Custom Pin Icons ──────────────────────────────────────────────── */
.map-pin-icon {
    background: none !important;
    border: none !important;
}

.map-pin-default {
    width: 28px;
    height: 28px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    border: 2px solid rgba(255, 255, 255, 0.9);
}

.map-pin-default i {
    transform: rotate(45deg);
    color: #fff;
    font-size: 12px;
}

.map-pin-golden {
    width: 34px;
    height: 34px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.9);
    position: relative;
}

.map-pin-golden i {
    transform: rotate(45deg);
    color: #fff;
    font-size: 14px;
}

.map-pin-star {
    position: absolute;
    top: -6px;
    right: -6px;
    font-size: 10px;
    color: #fff;
    transform: rotate(45deg);
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
}

.map-pin-icon-golden {
    z-index: 1000 !important;
}

/* ─── Marker Cluster Styles ─────────────────────────────────────────── */
.marker-cluster {
    border-radius: 50%;
}

.marker-cluster div {
    width: 32px;
    height: 32px;
    margin-left: 4px;
    margin-top: 4px;
    text-align: center;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.marker-cluster-small {
    background-color: rgba(99, 102, 241, 0.3);
}
.marker-cluster-small div {
    background-color: rgba(99, 102, 241, 0.7);
    color: #fff;
}

.marker-cluster-medium {
    background-color: rgba(59, 130, 246, 0.3);
}
.marker-cluster-medium div {
    background-color: rgba(59, 130, 246, 0.7);
    color: #fff;
}

.marker-cluster-large {
    background-color: rgba(239, 68, 68, 0.3);
}
.marker-cluster-large div {
    background-color: rgba(239, 68, 68, 0.7);
    color: #fff;
}

.marker-cluster-golden {
    background-color: rgba(167, 139, 250, 0.3) !important;
}
.marker-cluster-golden div {
    background-color: rgba(167, 139, 250, 0.8) !important;
}

/* ─── Popup Styles ──────────────────────────────────────────────────── */
.map-popup-wrapper .leaflet-popup-content-wrapper {
    background: #1a1a2e;
    color: #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0;
}

.map-popup-wrapper .leaflet-popup-tip {
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.map-popup-wrapper .leaflet-popup-content {
    margin: 0;
    line-height: 1.4;
}

.map-popup-wrapper.map-popup-golden .leaflet-popup-content-wrapper {
    border: 1px solid rgba(245, 158, 11, 0.3);
    box-shadow: 0 8px 32px rgba(245, 158, 11, 0.15);
}

.map-popup-card {
    padding: 20px;
    min-width: 200px;
    background-color:#06060f;
    border-radius: 12px;
}

.map-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.map-popup-stars {
    font-size: 0.75rem;
    color: #f59e0b;
}

.map-popup-stars span {
    color: #999;
    margin-left: 4px;
    font-weight: 600;
}

.map-popup-badge-golden {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #a78bfa;
    background: rgba(167, 139, 250, 0.12);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(167, 139, 250, 0.25);
}

.map-popup-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.map-popup-meta {
    font-size: 0.78rem;
    color: #888;
    margin-bottom: 6px;
}

.map-popup-category {
    text-transform: capitalize;
}

.map-popup-tagline {
    font-size: 0.8rem;
    color: #aaa;
    font-style: italic;
    margin: 6px 0;
    line-height: 1.4;
}

.map-popup-phone {
    font-size: 0.8rem;
    margin: 8px 0;
}

.map-popup-phone i {
    color: #22c55e;
    margin-right: 4px;
}

.map-popup-phone a {
    color: #60a5fa;
    text-decoration: none;
}

.map-popup-phone a:hover {
    text-decoration: underline;
}

.map-popup-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.map-popup-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    min-height: 38px;
    padding: 8px 10px;
    color: #fff8e7 !important;
    background: #21282f;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
    border: 1px solid #37444a;
}

.map-popup-cta:hover {
    background: #2a3a39;
    border-color: #43575a;
    transform: translateY(-1px);
}

.map-popup-cta--maps {
    background: #212c2f;
    border-color: #37454a;
    color: #fff8e7;
}

.map-popup-cta--maps:hover {
    background: #2a3a38;
    border-color: #435a56;
}

.map-popup-actions .map-popup-cta:only-child {
    grid-column: 1 / -1;
}

/* ─── Loading Indicator ─────────────────────────────────────────────── */
.map-loading-indicator {
    background: rgba(26, 26, 46, 0.85);
    color: #6366f1;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 1.1rem;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

/* ─── Leaflet Overrides (Dark Theme) ────────────────────────────────── */
.leaflet-control-zoom a {
    background: #1a1a2e !important;
    color: #e0e0e0 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.leaflet-control-zoom a:hover {
    background: #252547 !important;
}

.leaflet-control-attribution {
    background: rgba(26, 26, 46, 0.8) !important;
    color: #888 !important;
    font-size: 0.65rem !important;
}

.leaflet-control-attribution a {
    color: #60a5fa !important;
}

/* ─── Mobile Responsiveness ─────────────────────────────────────────── */
@media (max-width: 768px) {
    #mapContainer {
        height: 60vh;
        min-height: 350px;
        border-radius: 8px;
        margin: 10px 0;
    }

    .view-toggle {
        margin-left: 8px;
    }

    .view-btn {
        padding: 5px 10px;
        font-size: 0.78rem;
    }

    .view-btn span.view-label {
        display: none;
    }
}

@media (max-width: 480px) {
    #mapContainer {
        height: 55vh;
        min-height: 300px;
        border-radius: 0;
        margin: 0;
    }

    .map-popup-card {
        padding: 10px 12px;
        min-width: 180px;
    }

    .map-popup-title {
        font-size: 0.88rem;
    }

    .map-popup-actions {
        grid-template-columns: 1fr;
    }

    /* Floating map toggle for mobile */
    .view-toggle-mobile-float {
        position: fixed;
        bottom: 20px;
        right: 20px;
        z-index: 1000;
        background: rgba(99, 102, 241, 0.85);
        color: #fff;
        border: none;
        border-radius: 50%;
        width: 52px;
        height: 52px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.2rem;
        box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
        cursor: pointer;
        backdrop-filter: blur(8px);
    }
}

/* ─── Light Mode ─────────────────────────────────────────────────────── */
body.light-mode .view-toggle {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .view-btn {
    color: rgba(0, 0, 0, 0.45);
}

body.light-mode .view-btn:hover {
    color: rgba(0, 0, 0, 0.75);
    background: rgba(0, 0, 0, 0.05);
}

body.light-mode .view-btn.active {
    color: #fff;
    background: rgba(99, 102, 241, 0.8);
    box-shadow: 0 1px 6px rgba(99, 102, 241, 0.35);
}
