* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; font-size: 14px; overflow: hidden; }

#filter-panel {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 300px;
    max-height: calc(100% - 20px);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    overflow: hidden;
}

.filter-panel-collapsed {
    width: 44px;
    min-width: 44px;
}

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

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

.filter-panel-collapsed .filter-header {
    padding: 10px 8px;
    justify-content: center;
    border-bottom: none;
}

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

.filter-panel-collapsed .header-buttons {
    gap: 0;
}

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

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 2px solid #0078d4;
    background: #fff;
    flex-shrink: 0;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.bps-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
}

.filter-header h2 {
    font-size: 13px;
    color: #333;
    margin: 0;
    font-weight: 600;
    line-height: 1.3;
}

.header-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-close-filter {
    background: none;
    border: none;
    font-size: 18px;
    color: #666;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.btn-close-filter:hover {
    color: #333;
}

.btn-toggle-filter {
    background: #0078d4;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 14px;
    cursor: pointer;
    line-height: 1.5;
}

.btn-toggle-filter:hover {
    background: #005a9e;
}

.filter-content {
    overflow-y: auto;
    flex: 1;
}

#map-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

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

.filter-section {
    padding: 16px;
    border-bottom: 1px solid #eee;
}

.filter-section label {
    display: block;
    font-size: 12px;
    color: #555;
    margin-bottom: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-section select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
    background: #fff;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

.filter-section select:disabled {
    background: #f5f5f5;
    color: #999;
    border-color: #ddd;
}

.btn-group {
    padding: 16px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
    display: flex;
    gap: 8px;
}

#btn-location {
    width: 100%;
    padding: 10px;
    background: #28a745;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

#btn-location:hover { background: #218838; }
#btn-location:disabled { background: #aaa; cursor: not-allowed; }

#btn-view {
    flex: 1;
    padding: 10px;
    background: #0078d4;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

#btn-view:hover {
    background: #005a9e;
}

#btn-view:disabled {
    background: #aaa;
    cursor: not-allowed;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.btn-inline-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.btn-inline-group button {
    width: 36px;
    height: 36px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    color: #333;
    flex-shrink: 0;
}

.btn-inline-group button:hover { background: #f0f0f0; }
.btn-inline-group button:active { background: #e0e0e0; }

.btn-inline-group #marker-size-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
    color: #333;
    background: #f8f8f8;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    font-weight: normal;
    text-transform: none;
    letter-spacing: normal;
}

.checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.info-count {
    margin-top: 10px;
    font-size: 12px;
    color: #666;
    text-align: center;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 4px;
}

.info-bku {
    margin-top: 5px;
    font-size: 11px;
    text-align: center;
    padding: 5px 8px;
    background: #f0f0f0;
    border-radius: 4px;
    line-height: 1.6;
}

#btn-toggle-filter {
    flex-shrink: 0;
}

.ol-popup {
    position: absolute;
    background: #fff;
    border-radius: 6px;
    padding: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    min-width: 200px;
    max-width: 280px;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.ol-popup:empty {
    display: none;
}

.ol-popup-closer {
    text-decoration: none;
    position: absolute;
    top: 4px;
    right: 8px;
    font-weight: bold;
    color: #999;
}

.ol-popup-closer:hover {
    color: #333;
}

.ol-popup-content p {
    margin: 3px 0;
    font-size: 12px;
}

.ol-popup-content strong {
    font-weight: 600;
    color: #333;
}

.ol-layer-switcher {
    font-size: 14px;
}

/* Scrollbar styling */
.filter-content::-webkit-scrollbar {
    width: 6px;
}

.filter-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.filter-content::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.filter-content::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}
