/* Button */
.filter-toggle-button {
    position: fixed;
    top: 110px;
    right: 100px;
    z-index: 3000;
    background: hsl(var(--primary));
    color: white;
    padding: 14px 24px;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(253, 204, 13, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 15px;
    border: none;
}

.filter-toggle-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px hsl(45, 90%, 60%);
}

.filter-summary {
    font-size: 11px;
    opacity: 0.95;
    background: rgba(255, 255, 255, 0.25);
    padding: 3px 10px;
    border-radius: 12px;
    margin-left: 5px;
}

/* Panel */
.filter-panel {
    position: fixed;
    top: 170px;
    right: 100px;
    width: 340px;
    bottom: 20px;
    max-height: none;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 2999;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: top right;
    display: flex;
    flex-direction: column;
}

.filter-panel.collapsed {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
    pointer-events: none;
}

.filter-panel-header {
    background: hsl(var(--primary));
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-panel-header h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    transition: background 0.2s;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.filter-panel-content {
    padding: 16px;
    flex: 1;
    overflow-y: auto;
    max-height: none;
}

/* Sections */
.filter-section {
    margin-bottom: 16px;
}

.filter-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.category-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.category-option {
    color: #0b1021;
    display: flex;
    align-items: center;
    padding: 8px 10px;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
}

.category-option:hover {
    background: #e9ecef;
    transform: translateX(2px);
}

.category-option input[type="checkbox"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: hsl(45, 90%, 60%);
}

.level-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.level-selector .btn {
    flex: 1;
    min-width: 90px;
}

.apply-filters-btn {
    width: 100%;
    margin-top: 8px;
    padding: 10px;
    font-weight: 600;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
}

/* States */
.state.selected {
    stroke: hsl(45, 90%, 60%);
    stroke-width: 3 !important;
    filter: drop-shadow(0 0 8px hsl(45, 90%, 60%))
}

.metro-label-main {
    font-size: 11px;
    fill: #333;
    font-weight: 600;
    text-anchor: middle;
}

.metro-label-sub {
    font-size: 9px;
    fill: #666;
    font-style: italic;
    text-anchor: middle;
}

/* Tooltip */
.map-tooltip {
    position: absolute;
    pointer-events: none !important;
    background: white;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    font-size: 13px;
    z-index: 4000;
    min-width: 220px;
    opacity: 0;
    transition: opacity 0.2s;
}

.map-tooltip.show {
    opacity: 1;
}

.tooltip-header {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 10px;
    color: #222;
    border-bottom: 2px solid hsl(45, 90%, 60%);
    padding-bottom: 6px;
}

.tooltip-row {
    display: flex;
    justify-content: space-between;
    margin: 6px 0;
}

.tooltip-label {
    color: #666;
}

.tooltip-value {
    color: #222;
    font-weight: 600;
}

.tooltip-comparison {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.tooltip-diff {
    font-weight: 700;
}

.tooltip-diff.positive {
    color: #dc3545;
}

.tooltip-diff.negative {
    color: #28a745;
}

.tooltip-categories {
    margin-top: 8px;
    padding: 6px 8px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 11px;
    color: #555;
}

/* Responsive */
@media (max-width: 768px) {
    .filter-panel {
        width: calc(100% - 40px);
    }

    .filter-toggle-button {
        padding: 10px 15px;
    }

    .filter-summary {
        display: none;
    }
}