@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');
/* =========================================================
   Guest Map — full-screen MapLibre map + slide-in side panel
   ========================================================= */

/* Make html/body full height so the map can fill the viewport */
html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* Readable base font (Roboto) + slightly smaller text on the front */
#map-page-wrapper,
.map-panel {
    font-family: 'Roboto', -apple-system, "Segoe UI", Arial, sans-serif;
}
.map-panel__title {
    font-size: 16px;
    font-weight: 500;
}
.map-panel__body {
    font-size: 12px;
    line-height: 1.55;
}
.map-panel__body p {
    font-size: 12px;
    font-weight: 400;
    text-align: justify;
}
.map-panel__body .ql-editor {
    font-family: inherit;
    font-size: 12px;
    line-height: 1.55;
    padding: 0;
    height: auto;
    text-align: justify;
}

/* Wrapper fills the whole viewport below the fixed menu bar */
#map-page-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Menu bar is typically 60px — adjust to match your layout */
    top: 60px;
}

/* MapLibre container */
#guest-map {
    position: absolute;
    inset: 0;
    /* top/right/bottom/left: 0 */
    transition: right 0.35s ease;
}

/* ---- Side panel ---- */
.map-panel {
    position: absolute;
    top: 0;
    right: -420px;
    /* hidden off-screen */
    width: 400px;
    max-width: 100vw;
    bottom: 0;
    background: #fff;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    transition: right 0.35s ease;
    z-index: 10;
    border-radius: 0;
    overflow: hidden;
}

.map-panel.open {
    right: 0;
}

/* When panel is open, shrink map so markers aren't hidden behind it */
#map-page-wrapper:has(.map-panel.open) #guest-map {
    right: 400px;
}

/* Panel header */
.map-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 14px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
    background: #fff;
}

.map-panel__title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    max-width: calc(100% - 36px);
    /* allow up to two lines, then ellipsis */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
    line-height: 1.25;
}
/* long titles shrink a bit so they still fit in two lines */
.map-panel__title--long {
    font-size: 13px;
}

.map-panel__close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #666;
    padding: 4px 6px;
    line-height: 1;
    flex-shrink: 0;
}

.map-panel__close:hover {
    color: #333;
}

/* Panel body — scrollable */
.map-panel__body {
    flex: 1;
    overflow-y: auto;
    padding: 0 18px 24px;
    -webkit-overflow-scrolling: touch;
}

/* Hero image inside panel */
.map-panel__body .panel-hero-img {
    width: 100%;
    margin: 0 0 16px;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Loading spinner */
.panel-loading {
    text-align: center;
    padding: 48px 0;
    color: #aaa;
    font-size: 28px;
}

/* Map points are a NATIVE MapLibre symbol layer (see guest-map.js) — drawn on
   the map's WebGL canvas and projected to their coordinates by the map engine.
   There is deliberately NO CSS/HTML marker for them, so nothing can push a
   point off its location on zoom or layout change. Only the hover tooltip below
   is DOM, and it is a map-managed popup (anchored by MapLibre to the point). */

/* Hover tooltip (title next to the point) */
.rev-tip .maplibregl-popup-content {
    background: #fff;
    color: #1B1725;
    padding: 4px 10px;
    border-radius: 6px;
    font-family: 'Roboto', -apple-system, "Segoe UI", Arial, sans-serif;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
    /* wrap long titles to max 2 lines within a fixed width, then ellipsis (…);
       break a single over-long word so it never overflows the box */
    max-width: 220px;
    text-align: center;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.rev-tip .maplibregl-popup-tip {
    border-top-color: #fff;
    border-bottom-color: #fff;
}

/* Category legend (collapsible, bottom-left) */
.guest-legend { position: absolute; left: 12px; bottom: 12px; z-index: 5;
    font-family: 'Roboto', -apple-system, "Segoe UI", Arial, sans-serif; }
.guest-legend__btn { background: #fff; border: 1px solid #ddd; border-radius: 8px; padding: 6px 12px;
    font-size: 12px; font-weight: 500; cursor: pointer; box-shadow: 0 1px 5px rgba(0, 0, 0, .15); }
.guest-legend__body { display: none; margin-top: 6px; background: #fff; border-radius: 8px; padding: 8px 12px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .18); font-size: 12px; min-width: 130px; }
.guest-legend.open .guest-legend__body { display: block; }
.guest-legend__row { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.guest-legend__sw { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px;
    border-radius: 50%; flex: 0 0 auto; color: #fff; font-size: 10px; font-weight: 700; }

/* "Animacija" button in the side panel (above Navigate) */
.map-panel__story { background: #c0392b; border: none; margin-bottom: 8px; cursor: pointer; }
.map-panel__story:hover { background: #a93226; color: #fff; }

/* Story timeline bar shown on the map while an animation plays */
.guest-story { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
    display: none; align-items: center; gap: 10px; background: #fff; border-radius: 10px;
    padding: 8px 14px; box-shadow: 0 2px 12px rgba(0, 0, 0, .2); z-index: 6; width: 520px; max-width: 92%;
    box-sizing: border-box; font-family: 'Roboto', -apple-system, "Segoe UI", Arial, sans-serif; }
.guest-story.open { display: flex; }
.guest-story__play, .guest-story__close { border: none; width: 34px; height: 34px; border-radius: 50%;
    cursor: pointer; flex: 0 0 auto; font-size: 14px; }
.guest-story__play { background: #1b1725; color: #fff; }
.guest-story__close { background: #eee; color: #333; }
.guest-story__slider { flex: 1; accent-color: #c0392b; }
.guest-story__meta { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.guest-story__date { font-size: 13px; font-weight: 600; }
.guest-story__cap { font-size: 11px; color: #666; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* single-phase story = static legend only (no player controls) */
.guest-story.single .guest-story__play,
.guest-story.single .guest-story__slider { display: none; }
/* exit control: "✕" on desktop, "← Nazad" on mobile */
.guest-story__close .s-back { display: none; }
@media (max-width: 640px) {
    .guest-story { width: 96%; bottom: 12px; gap: 8px; padding: 8px 10px; }
    .guest-story__close { width: auto; border-radius: 8px; padding: 0 14px; font-size: 13px; }
    .guest-story__close .s-x { display: none; }
    .guest-story__close .s-back { display: inline; }
    .guest-story__date { font-size: 12px; }
}

/* User's current location marker (blue pulsing dot) */
.guest-user-marker {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #2d8cff;
    border: 3px solid #fff;
    box-shadow: 0 0 0 rgba(45, 140, 255, 0.5);
    animation: guest-user-pulse 2s infinite;
}

@keyframes guest-user-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(45, 140, 255, 0.5); }
    70%  { box-shadow: 0 0 0 14px rgba(45, 140, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(45, 140, 255, 0); }
}

/* Panel footer + Navigate button */
.map-panel__footer {
    flex-shrink: 0;
    padding: 12px 18px;
    border-top: 1px solid #eee;
    background: #fff;
}

.map-panel__nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 16px;
    background: #2d8cff;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    border-radius: 10px;
    text-decoration: none;
}

.map-panel__nav:hover {
    background: #1f7ae0;
    color: #fff;
}

/* ---- Mobile: large panel sliding in from the right ---- */
@media (max-width: 640px) {
    .map-panel {
        width: 92%;
        max-width: 92%;
        top: 0;
        bottom: 0;
        right: -100%;
        /* hidden off-screen to the right */
        left: auto;
        max-height: none;
        border-radius: 0;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
        transition: right 0.35s ease;
    }

    .map-panel.open {
        right: 0;
        bottom: 0;
    }

    /* Panel overlays the map on mobile (don't shrink the map) */
    #map-page-wrapper:has(.map-panel.open) #guest-map {
        right: 0;
        bottom: 0;
    }

    /* a touch more room for content on small screens */
    .map-panel__body {
        padding-bottom: 16px;
    }
}