/* =================================
   FULL-PAGE EXPLORE MAP STYLES
   ================================= */

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
}

/* --- Top Bar --- */
.full-map-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    z-index: 2000;
}

.full-map-topbar__logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.full-map-topbar__logo img {
    height: 24px;
    width: auto;
}

.full-map-topbar__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.full-map-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.9rem;
    background: #229966;
    color: #fff;
    border: none;
    border-radius: 20px;
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    cursor: pointer;
    transition: background 0.2s;
}

.full-map-share-btn:hover {
    background: #1a7a50;
}

.full-map-share-btn.copied {
    background: #191919;
}

/* --- Map Container --- */
.full-map-wrapper {
    position: fixed;
    top: 48px;
    left: 0;
    right: 0;
    bottom: 0;
}

#full-map {
    height: 100%;
    width: 100%;
}

/* --- Filter Panel --- */
.filter-panel {
    position: absolute;
    top: 10px;
    bottom: 10px;
    right: 58px;
    z-index: 1000;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    border: 2px solid #E9F2EE;
    height: fit-content;
    max-height: calc(100% - 20px);
    overflow-y: auto;
    width: 220px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.filter-panel.collapsed {
    display: none;
}

.filter-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #eee;
    background: #f3f3f3;
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-sm);
    color: #333;
}

.filter-panel__close {
    background: #fff;
    border: 2px solid #E9F2EE;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 1rem;
    cursor: pointer;
    color: #333;
    padding: 0 0 2px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.filter-panel__close:hover {
    background: #e9ecef;
    color: #495057;
    border-color: #adb5bd;
}

.filter-toggle-btn {
    display: none !important;
    position: absolute;
    bottom: 44px;
    left: 10px;
    z-index: 999;
    width: 42px;
    height: 42px;
    background: #fff;
    border: 2px solid #E9F2EE;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #333;
    transition: background 0.15s, border-color 0.15s;
}

.filter-toggle-btn:hover {
    background: #f5f5f5;
    border-color: rgba(0, 0, 0, 0.4);
}

.filter-toggle-btn.hidden {
    display: none;
}

/* Filter Groups */
.filter-group {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #f0f0f0;
}

.filter-group:last-child {
    border-bottom: none;
}

.filter-group__title {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    margin-bottom: 0.35rem;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 0;
    cursor: pointer;
    font-size: var(--font-size-sm);
    color: #333;
    user-select: none;
}

.filter-checkbox input[type="checkbox"] {
    display: none;
}

.filter-checkbox__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.15);
}

.filter-checkbox__name {
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.filter-checkbox.inactive {
    opacity: 0.4;
}

.filter-checkbox.inactive .filter-checkbox__dot {
    background: #ccc !important;
}

/* --- Sidebar --- */
.full-map-sidebar {
    position: absolute;
    top: 10px;
    left: 10px;
    bottom: 10px;
    width: 340px;
    max-width: 90%;
    background: #fff;
    border-radius: 12px;
    border: 2px solid #E9F2EE;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow: hidden;
    transform: translateX(calc(-100% - 20px));
    transition: transform 0.3s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.full-map-sidebar.open {
    transform: translateX(0);
}

.full-map-sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eee;
    background: #f3f3f3;
    flex-shrink: 0;
}

.full-map-sidebar__title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    margin: 0;
    line-height: var(--line-height-tight);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 260px;
}

.full-map-sidebar__close {
    background: #fff;
    border: 2px solid #E9F2EE;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    font-size: 1.1rem;
    cursor: pointer;
    color: #333;
    padding: 0 0 2px;
    line-height: 1;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.full-map-sidebar__close:hover {
    background: #e9ecef;
    color: #495057;
    border-color: #adb5bd;
}

.full-map-sidebar__body {
    padding: 1rem;
    flex: 1;
    overflow-y: auto;
}

/* Sidebar content elements */
.sidebar-image {
    width: 100%;
    border-radius: 8px;
    object-fit: cover;
    max-height: 200px;
    margin-bottom: 0.75rem;
}

.sidebar-desc {
    font-size: var(--font-size-sm);
    color: #555;
    line-height: var(--line-height-normal);
    margin-bottom: 1rem;
    white-space: pre-line;
}

.sidebar-meta {
    font-size: var(--font-size-sm);
    color: #666;
    margin-bottom: 0.35rem;
}

.sidebar-meta strong {
    color: #333;
}

.sidebar-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    color: #229966;
    text-decoration: none;
    margin-right: 0.75rem;
}

.sidebar-link:hover {
    color: #1a7a50;
    text-decoration: underline;
}

.sidebar-gpx {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    background: #fff;
    color: #333;
    border: 2px solid #E9F2EE;
    border-radius: 8px;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
    margin-top: 0.5rem;
}

.sidebar-gpx:hover {
    background: #e9ecef;
    border-color: rgba(0, 0, 0, 0.4);
    color: #333;
    text-decoration: none;
}

.sidebar-detail-link {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.4rem 0.85rem;
    background: #229966;
    color: #fff;
    border-radius: 20px;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    text-decoration: none;
    transition: background 0.2s;
}

.sidebar-detail-link:hover {
    background: #1a7a50;
    color: #fff;
    text-decoration: none;
}

.sidebar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.sidebar-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #27ae60;
    color: #fff;
    margin-bottom: 0.5rem;
}

/* --- Zoom controls (widget style) --- */
.maplibregl-ctrl-top-right {
    top: 8px;
    right: 8px;
}

.maplibregl-ctrl-top-right .maplibregl-ctrl-group {
    background: none;
    box-shadow: none;
    border-radius: 0;
}

.maplibregl-ctrl-group button.maplibregl-ctrl-zoom-in,
.maplibregl-ctrl-group button.maplibregl-ctrl-zoom-out {
    width: 42px;
    height: 42px;
    background-color: #fff;
    border: 2px solid #E9F2EE;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px 18px;
    transition: background-color 0.15s, border-color 0.15s;
    touch-action: manipulation;
}

.maplibregl-ctrl-group button.maplibregl-ctrl-zoom-in {
    border-radius: 20px 20px 0 0;
    background-image: url("/static/widget_app/images/zoomin.d613d87422fb.svg");
}

.maplibregl-ctrl-group button.maplibregl-ctrl-zoom-out {
    border-radius: 0 0 20px 20px;
    background-image: url("/static/widget_app/images/zoomout.02ab1b3f4f68.svg");
}

.maplibregl-ctrl-group button.maplibregl-ctrl-zoom-in:hover,
.maplibregl-ctrl-group button.maplibregl-ctrl-zoom-out:hover {
    background-color: #f5f5f5;
    border-color: rgba(0, 0, 0, 0.4);
}

.maplibregl-ctrl-group button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon,
.maplibregl-ctrl-group button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon {
    display: none;
}

/* --- Ruter Logo (bottom-right on map) --- */
.full-map-logo {
    position: absolute;
    bottom: 4px;
    left: 10px;
    z-index: 1000;
    display: block;
    line-height: 0;
}

.full-map-logo .ruterdk-logo {
    width: 100px;
    height: 40px;
    padding: 0 10px;
}

/* --- Custom Attribution --- */
.map-attribution {
    position: absolute;
    bottom: 8px;
    right: 8px;
    z-index: 1000;
    background: #fff;
    border: 1px solid #E9F2EE;
    border-radius: 20px;
    display: flex;
    align-items: center;
    flex-direction: row-reverse;
    overflow: hidden;
    width: 28px;
    height: 28px;
    transition: width 0.3s ease;
}

.map-attribution.expanded {
    width: 320px;
}

.attribution-info-btn {
    background: #fff;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    padding: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    z-index: 2;
}

.attribution-info-btn:hover { background: #f5f5f5; }

.attribution-info-btn img {
    width: 18px;
    height: 18px;
}

.attribution-text {
    display: none;
    padding: 0 8px;
    font-size: 0.75rem;
    color: #666;
    white-space: nowrap;
}

.map-attribution.expanded .attribution-text { display: block; }

.attribution-text a { color: #666; }

/* --- Responsive --- */
@media (max-width: 767px) {
    .filter-panel {
        width: 180px;
        font-size: 0.85rem;
    }

    .full-map-sidebar {
        position: absolute;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        height: 55%;
        max-height: 55%;
        transform: translateY(100%);
        box-shadow: 0 -3px 12px rgba(0, 0, 0, 0.15);
        border-radius: 12px 12px 0 0;
    }

    .full-map-sidebar.open {
        transform: translateY(0);
    }

    .full-map-topbar {
        padding: 0 0.75rem;
    }
}


/* ── MapLibre controls styled like the site's Leaflet controls ─────── */

.maplibregl-ctrl-group {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

.maplibregl-ctrl-group button {
    width: 38px !important;
    height: 38px !important;
    background-color: #fff !important;
    border: 2px solid #E9F2EE !important;
    box-sizing: border-box;
}

.maplibregl-ctrl-group button:hover {
    background-color: #f5f5f5 !important;
    border-color: rgba(0, 0, 0, 0.4) !important;
}

.maplibregl-ctrl-group button + button {
    border-top: none !important;
    margin-top: -2px;
}

.maplibregl-ctrl-zoom-in {
    border-radius: 20px 20px 0 0 !important;
}

.maplibregl-ctrl-zoom-out {
    border-radius: 0 0 20px 20px !important;
}

.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon {
    background-image: url("/static/widget_app/images/zoomin.d613d87422fb.svg") !important;
    background-size: 18px 18px !important;
    background-repeat: no-repeat;
    background-position: center;
}

.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon {
    background-image: url("/static/widget_app/images/zoomout.02ab1b3f4f68.svg") !important;
    background-size: 18px 18px !important;
    background-repeat: no-repeat;
    background-position: center;
}

/* Funnel filter button in the control stack (below zoom) */
.map-filter-ctrl-btn {
    width: 38px !important;
    height: 38px !important;
    border-radius: 50% !important;
    background-color: #fff !important;
    border: 2px solid #E9F2EE !important;
    box-sizing: border-box;
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: #229966;
    cursor: pointer;
}

.map-filter-ctrl-btn:hover,
.map-filter-ctrl-btn.active {
    background-color: #E9F2EE !important;
    border-color: rgba(0, 0, 0, 0.4) !important;
}

/* ── Filter panel: site chip design ─────────────────────────────────── */

.filter-panel {
    padding: 10px 12px;
    min-width: 230px;
}

.filter-panel__header {
    padding: 0 0 6px;
    border-bottom: none;
}

.filter-panel__header span {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #888;
}

.filter-group {
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
}

.filter-group:last-child { border-bottom: none; }

.filter-group__title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #888;
    margin: 4px 0 6px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    margin: 3px 0;
    background: #fff;
    border: 1px solid #229966;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: opacity 0.15s, background 0.15s;
}

.filter-checkbox:hover { background: #f4f7f5; }

.filter-checkbox.inactive { opacity: 0.45; }

.filter-checkbox__icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.filter-checkbox__dot {
    width: 10px;
    height: 10px;
    border-radius: 5px;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.15);
}

.filter-checkbox__name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filter-checkbox__check {
    color: #229966;
    visibility: hidden;
}

.filter-checkbox:not(.inactive) .filter-checkbox__check {
    visibility: visible;
}
