:root {
    --sidebar-width: 440px;
    --header-height: 58px;
}

body, html {
    height: 100%;
    margin: 0;
    overflow: hidden;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f8f9fa;
}

#app-header {
    height: var(--header-height);
    z-index: 1030;
    cursor: pointer;
    user-select: none;
}

#main-container {
    height: calc(100vh - var(--header-height));
    display: flex;
    position: relative;
    overflow: hidden;
}

#sidebar {
    width: var(--sidebar-width);
    min-width: 320px;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-right: 1px solid #dee2e6;
    z-index: 1020;
    transition: transform 0.25s ease-in-out;
}

#filter-pane {
    border-bottom: 1px solid #dee2e6;
    background: #fdfdfd;
}

#results-pane {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}

#map-container {
    flex: 1;
    height: 100%;
    position: relative;
    overflow: hidden;
    background: #ddd;
}

#map {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: #ddd;
}

.result-card {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    border-left: 4px solid #ced4da;
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #0d6efd;
}

.result-card.active {
    background-color: #f1f7ff;
}

.result-card.type-E { border-left-color: #198754; }
.result-card.type-T { border-left-color: #c25e00; }
.result-card.type-L { border-left-color: #0d6efd; }
.result-card.type-S { border-left-color: #6f42c1; }
.result-card.type-H { border-left-color: #087990; }

.type-badge {
    min-width: 28px;
    height: 18px;
    padding: 0 6px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    line-height: 1;
}

.type-badge-E { background-color: #198754; }
.type-badge-T { background-color: #c25e00; }
.type-badge-L { background-color: #0d6efd; }
.type-badge-S { background-color: #6f42c1; }
.type-badge-H { background-color: #087990; }

.btn-panel-toggle {
    font-size: 0.76rem;
    padding: 2px 7px;
    border-radius: 4px;
    background: #f1f3f5;
    border: 1px solid #ced4da;
    color: #495057;
    line-height: 1.2;
    transition: all 0.15s ease;
}

.btn-panel-toggle:hover,
.btn-panel-toggle.active {
    background: #e7f1ff;
    border-color: #9ec5fe;
    color: #0d6efd;
}

.dropdown-popup-box {
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 0.78rem;
    cursor: default;
}

.events-list {
    margin: 0;
    padding-left: 1.25rem;
}

.events-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 0;
    font-size: 0.76rem;
    border-bottom: 1px dashed #e9ecef;
}

.events-list-item:last-child {
    border-bottom: none;
}

.btn-time-link,
.btn-coord-link {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 3px;
    color: #0d6efd;
    font-size: 0.72rem;
    padding: 1px 6px;
    cursor: pointer;
    line-height: 1.2;
    transition: all 0.12s ease;
}

.btn-time-link:hover,
.btn-coord-link:hover {
    background: #e7f1ff;
    border-color: #9ec5fe;
}

.marker-wrapper {
    width: 32px;
    height: 42px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    cursor: pointer;
}

.marker-wrapper.cluster-wrapper {
    height: 32px;
    align-items: center;
}

.custom-pin {
    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 6px rgba(0,0,0,0.3);
    border: 2px solid white;
    transition: transform 0.15s ease;
}

.custom-pin span {
    transform: rotate(45deg);
    font-size: 10px;
    font-weight: 700;
    color: #fff;
}

.marker-cluster-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #495057;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.35);
    transition: transform 0.15s ease;
}

.marker-wrapper.highlighted .custom-pin {
    transform: rotate(-45deg) scale(1.3);
    z-index: 999 !important;
}

.marker-wrapper.highlighted .marker-cluster-circle {
    transform: scale(1.3);
    z-index: 999 !important;
}

.pin-E { background-color: #198754; }
.pin-T { background-color: #c25e00; }
.pin-L { background-color: #0d6efd; }
.pin-S { background-color: #6f42c1; }
.pin-H { background-color: #087990; }

.maplibregl-popup-content {
    max-height: 300px;
    overflow-y: auto;
    font-family: sans-serif;
    font-size: 13px;
}

#mobile-toggle-btn {
    display: none;
}

@media (max-width: 768px) {
    #sidebar {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }

    #sidebar.mobile-hidden {
        transform: translateX(-100%);
    }

    #mobile-toggle-btn {
        display: inline-block !important;
    }
}
