:root {
    --app-navbar-height: 56px;
    --app-sidebar-bg: #f8f9fa;
}

body.page-map {
    overflow: hidden;
}

.app-navbar {
    min-height: var(--app-navbar-height);
}

/* Layout Kartenseite */
.app-sidebar {
    background: var(--app-sidebar-bg);
    border-right: 1px solid #dee2e6;
}

.sidebar-scroll {
    height: calc(100vh - var(--app-navbar-height));
    overflow-y: auto;
    overscroll-behavior: contain;
}

.app-map-column {
    position: relative;
}

.app-map {
    height: calc(100vh - var(--app-navbar-height));
    min-height: 320px;
    background: #e9ecef;
}

@media (max-width: 991.98px) {
    body.page-map {
        overflow: auto;
    }
    .app-map {
        height: 55vh;
    }
    .sidebar-scroll {
        height: auto;
        overflow: visible;
    }
    .map-legend {
        display: none;
    }
}

/* Kalender */
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.72rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}

.cal-day {
    position: relative;
    border: 1px solid transparent;
    background: #fff;
    border-radius: 0.375rem;
    padding: 0.35rem 0 1rem;
    font-size: 0.85rem;
    line-height: 1;
    color: #212529;
    cursor: pointer;
    transition: background-color 0.1s, border-color 0.1s;
}

.cal-day:hover,
.cal-day:focus-visible {
    border-color: #0d6efd;
    outline: none;
}

.cal-day.is-other-month {
    color: #adb5bd;
    background: transparent;
}

.cal-day.is-past .cal-day-num {
    opacity: 0.6;
}

.cal-day.is-today .cal-day-num {
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cal-day.is-in-range {
    background: #cfe2ff;
}

.cal-day.is-selected {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

.cal-day.is-selected .cal-day-num {
    opacity: 1;
}

.cal-day-count {
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6rem;
    font-weight: 600;
    line-height: 1.25;
    min-width: 1.1rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: #198754;
    color: #fff;
}

.cal-day.is-selected .cal-day-count {
    background: #fff;
    color: #0d6efd;
}

.cal-day.is-other-month .cal-day-count {
    opacity: 0.6;
}

.calendar-card .btn-group .btn {
    flex: 1 1 auto;
}

/* Filter */
.cat-dot {
    display: inline-block;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.category-menu {
    min-width: 290px;
    max-height: 60vh;
    overflow-y: auto;
}

/* Ergebnisliste */
.event-day-header {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6c757d;
    margin: 0.85rem 0 0.35rem;
}

.event-item {
    display: block;
    background: #fff;
    border: 1px solid #dee2e6;
    border-left-width: 5px;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: box-shadow 0.15s, border-color 0.15s;
}

.event-item:hover,
.event-item.active {
    box-shadow: 0 0.25rem 0.6rem rgba(0, 0, 0, 0.12);
}

.event-item.active {
    outline: 2px solid #0d6efd;
    outline-offset: 0;
}

.event-item .event-title {
    font-weight: 600;
    line-height: 1.25;
}

.event-item .event-title a {
    color: inherit;
    text-decoration: none;
}

.event-item .event-title a:hover {
    text-decoration: underline;
}

.event-item .event-meta {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.15rem;
}

.event-cat {
    font-weight: 500;
}

/* Karte */
.event-pin svg {
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35));
}

.map-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    display: none;
    background: #fff;
    padding: 0.35rem 0.5rem;
    border-radius: 0.375rem;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
}

.map-overlay.is-visible {
    display: block;
}

.map-legend {
    position: absolute;
    bottom: 22px;
    left: 10px;
    z-index: 1000;
    max-width: 240px;
    font-size: 0.78rem;
    background: rgba(255, 255, 255, 0.93);
    padding: 0.4rem 0.6rem;
    border-radius: 0.375rem;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25);
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin: 0.1rem 0.5rem 0.1rem 0;
    cursor: pointer;
    white-space: nowrap;
}

.legend-item.is-off {
    opacity: 0.4;
}

.leaflet-popup-content {
    margin: 0.75rem 0.85rem;
    line-height: 1.35;
}

.event-popup .title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.2rem;
}

.event-popup .title a {
    color: inherit;
    text-decoration: none;
}

/* Detailseite */
.event-map {
    position: relative;
    height: 340px;
    background: #e9ecef;
}

.event-map-empty {
    position: absolute;
    inset: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.75);
    color: #6c757d;
}

.event-meta dt {
    color: #6c757d;
    font-weight: 500;
}

.event-description {
    line-height: 1.6;
}
