/* ── Google Fonts ───────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --clr-gold-dark: #482913;
    --clr-gold-mid: #ff0000;
    --clr-gold-light: #ff0000;
    --clr-gold-pale: #ff0000;

    --clr-green-dark: #1b5e20;
    --clr-green-mid: #4caf50;
    --clr-green-light: #81c784;

    --clr-blue-dark: #0d47a1;
    --clr-blue-mid: #2196f3;
    --clr-blue-light: #64b5f6;

    --clr-purple-dark: #4a148c;
    --clr-purple-mid: #9c27b0;
    --clr-purple-light: #e1bee7;

    --clr-cream: #f9f6f0;
    --clr-text: #1a1a1a;
    --clr-text-muted: #5a5a5a;
    --clr-white: #ffffff;

    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;

    --shadow-flat: 0 4px 14px rgba(0, 0, 0, 0.06);
    --shadow-float: 0 16px 40px rgba(0, 0, 0, 0.15);
    --shadow-glow: 0 12px 40px rgba(139, 111, 71, 0.25);

    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', 'Segoe UI', -apple-system, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: transparent;
    font-family: var(--font-body);
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

#interactive-map {
    width: 100%;
    height: 100%;
    background-color: #FFE3BC;
    background-image: url('kazakh_bg.png');
    background-repeat: repeat;
    background-size: 250px;
    background-blend-mode: overlay;
    border-radius: var(--radius-xl);
    border: 4px solid var(--clr-white);
    box-shadow: var(--shadow-float);
    position: relative;
    z-index: 10;
}

/* ── Custom Marker Point ────────────────────────────── */
.custom-map-point {
    width: 24px;
    height: 24px;
    background: var(--point-color, var(--clr-gold-mid));
    border: 3px solid var(--clr-white);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.3s ease;
    position: relative;
}

/* Pulsing effect behind the marker */
.custom-map-point::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--point-glow, var(--clr-gold-light));
    opacity: 0.5;
    animation: pulse 3s infinite cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: -1;
}

.custom-map-point:hover {
    transform: scale(1.3);
    background: var(--point-dark, var(--clr-gold-dark));
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.7;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.6);
        opacity: 0;
    }
}


/* ── Custom Leaflet Popup Styles ─────────────────────── */
.leaflet-popup-content-wrapper {
    border-radius: var(--radius-md) !important;
    padding: 0 !important;
    overflow: hidden;
    box-shadow: var(--shadow-float) !important;
}

.leaflet-popup-content {
    margin: 0 !important;
}

.map-popup-inner {
    background: var(--clr-white);
    min-width: 320px;
    display: flex;
    flex-direction: column;
}

.map-popup-image-wrapper {
    width: 100%;
    height: 180px;
    overflow: hidden;
    position: relative;
    border-bottom: 2px solid var(--clr-gold-pale);
}

.map-popup-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.8s ease;
}

.leaflet-popup-content-wrapper:hover .map-popup-image {
    transform: scale(1.05);
    /* Gentle zoom on hover */
}

.map-popup-content-body {
    padding: 24px;
}

.map-popup-title {
    font-family: var(--font-body);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--clr-text);
    margin-bottom: 8px;
    border-bottom: 2px solid var(--clr-gold-pale);
    padding-bottom: 8px;
    line-height: 1.2;
}

.map-popup-desc {
    font-size: 0.95rem;
    color: var(--clr-text-muted);
    margin-bottom: 20px;
    line-height: 1.5;
}

.map-popup-tours h4 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--clr-gold-mid);
    margin-bottom: 12px;
}

.map-popup-tours ul {
    list-style: none;
}

.map-popup-tours li {
    margin-bottom: 10px;
}

.map-popup-tours li:last-child {
    margin-bottom: 0;
}

/* Make sure links inside the iframe correctly navigate the PARENT window */
.map-popup-tours a {
    color: var(--clr-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--clr-cream);
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
}

.map-popup-tours a::before {
    content: '\f105';
    /* FontAwesome angle-right */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--clr-gold-mid);
    font-size: 1.1rem;
    transition: transform 0.2s ease;
}

.map-popup-tours a:hover {
    color: var(--clr-gold-dark);
    background: #fff;
    border-color: var(--clr-gold-light);
    box-shadow: 0 2px 10px rgba(139, 111, 71, 0.1);
}

.map-popup-tours a:hover::before {
    transform: translateX(3px);
}

.leaflet-container {
    font-family: var(--font-body) !important;
}

/* ── Side Panel Styles ─────────────────────── */
.map-side-panel {
    position: absolute;
    top: 0;
    left: 0;
    transform: translateX(-100%);
    width: 400px;
    min-width: 300px;
    max-width: 90vw;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.5);
}

.map-side-panel.active {
    transform: translateX(0);
}

.close-panel-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--clr-white);
    color: var(--clr-text);
    border: 1px solid #eee;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.close-panel-btn:hover {
    background: var(--clr-gold-mid);
    color: var(--clr-white);
    transform: rotate(90deg);
}

.mobile-drag-pill {
    display: none;
}

.side-panel-content-body {
    padding: 30px 24px;
    display: flex;
    flex-direction: column;
}

.map-side-panel .map-popup-image-wrapper {
    height: 240px;
    flex-shrink: 0;
    border-bottom: none;
    border-radius: 0 0 24px 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.map-side-panel .map-popup-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.map-side-panel .map-popup-title {
    font-size: 1.6rem;
    margin-top: 20px;
    border-bottom: 2px solid var(--clr-gold-mid);
    padding-bottom: 12px;
}

.map-side-panel .map-popup-desc {
    font-size: 1.05rem;
    line-height: 1.6;
    margin-top: 15px;
}

/* Scrollbar styling for side panel */
.map-side-panel::-webkit-scrollbar {
    width: 6px;
}

.map-side-panel::-webkit-scrollbar-track {
    background: transparent;
}

.map-side-panel::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.map-side-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* ── Panel Resizer ── */
.panel-resizer {
    position: absolute;
    top: 0;
    right: 0;
    /* Right edge of the side panel */
    width: 8px;
    /* Slightly wider for easier grabbing */
    height: 100%;
    cursor: ew-resize;
    z-index: 2000;
    background-color: transparent;
    transition: background-color 0.2s ease;
}

.panel-resizer:hover,
.panel-resizer.is-resizing {
    background-color: rgba(0, 0, 0, 0.1);
    box-shadow: inset 2px 0 4px rgba(0, 0, 0, 0.05);
}

body.is-resizing {
    cursor: ew-resize !important;
    user-select: none;
}

@media (max-width: 768px) {
    .map-side-panel {
        width: 100% !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
        /* Forces absolute full width on mobile inside the iframe */
        height: 90vh !important;
        /* Allow panel to fill entire screen if dragged up */
        top: auto;
        bottom: 0px;
        left: 0px;
        right: 0px;
        margin: 0;
        transform: translateY(120%) !important;
        background: #ffffff;
        color: var(--clr-text);
        border-right: none;
        border-top: none;
        border-radius: 20px 20px 0 0;
        transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
        padding-top: 5px;
        /* Less space needed on top */
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.08);
        /* Soft shadow above */
        z-index: 2000;
        /* When not full screen, hide overflow so we don't double-scroll */
        overflow-y: hidden;
        overflow-x: hidden;
    }

    .map-side-panel.active {
        /* Default peek state */
        transform: translateY(50vh) !important;
        /* ~40vh peek view initially */
    }

    /* When expanded fully, allow internal scrolling */
    .map-side-panel.expanded {
        transform: translateY(0%) !important;
        /* Covers exactly 90% and touches the bottom */
        overflow-y: auto;
    }

    /* Disable transition when dragging for smooth feel */
    .map-side-panel.dragging {
        transition: none;
    }

    .mobile-drag-pill {
        display: block;
        width: 48px;
        height: 6px;
        background: rgba(0, 0, 0, 0.15);
        border-radius: 3px;
        margin: 15px auto 20px auto;
        flex-shrink: 0;
    }

    .panel-resizer {
        display: none;
        /* Hide resizer on mobile */
    }

    .close-panel-btn {
        display: none;
        /* Provide direct way to collapse on mobile */
    }

    .side-panel-content-body {
        padding: 5px 20px 25px 20px;
    }

    .map-side-panel .map-popup-image-wrapper {
        border-radius: 12px;
        height: 180px;
        margin: 0 20px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
        /* Restore soft shadow */
    }

    .map-side-panel .map-popup-title {
        color: var(--clr-text);
        border-bottom: none;
        margin-top: 18px;
        font-size: 1.4rem;
        padding-bottom: 5px;
    }

    .map-side-panel .map-popup-desc {
        color: var(--clr-text-muted);
        font-size: 1rem;
        margin-bottom: 20px;
    }

    .map-popup-tours h4 {
        color: var(--clr-gold-mid);
    }

    .map-popup-tours a {
        background: var(--clr-cream);
        color: var(--clr-text);
        border: 1px solid transparent;
    }

    .map-popup-tours a::before {
        color: var(--clr-gold-mid);
    }
}