:root {
    --bg: #0f172a;
    --panel: #1e293b;
    --text: #f1f5f9;
    --muted: #cbd5e1;
    --line: #334155;
    --accent: #60a5fa;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
}

.page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
}

.header {
    margin-bottom: 1.5rem;
}

.back-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.back-link:hover {
    text-decoration: underline;
}

h1 {
    margin: 0.5rem 0 0.25rem;
    font-size: 2rem;
}

h2 {
    margin: 0 0 0.75rem;
}

p {
    margin: 0.25rem 0 0.75rem;
    color: var(--muted);
}

.content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.map-wrapper {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1rem;
}

.study-map {
    width: 100%;
    height: auto;
    min-height: 500px;
    background: #0b1220;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.municipality {
    fill: #334155;
    stroke: var(--accent);
    stroke-width: 1;
    transition: all 0.2s ease;
    cursor: pointer;
}

.municipality:hover {
    fill: var(--accent);
    stroke: #3b82f6;
    stroke-width: 2;
}

.municipality.highlighted {
    fill: #10b981;
    stroke: #059669;
    stroke-width: 2.5;
}

.tooltip {
    position: fixed;
    background: rgba(15, 23, 42, 0.95);
    border: 2px solid var(--accent);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    pointer-events: none;
    z-index: 1000;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.info-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1.5rem;
}

.info-panel ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
    color: var(--muted);
}

.info-panel li {
    margin: 0.25rem 0;
}

.hint {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #1e3a5f;
    border-left: 3px solid var(--accent);
    border-radius: 4px;
    font-size: 0.9rem;
}

.municipality-list-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.search-input {
    width: 100%;
    padding: 0.65rem 0.75rem;
    margin-bottom: 1rem;
    background: #0b1220;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
}

.municipality-list-wrapper {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #0b1220;
}

.municipality-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.municipality-list li {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.municipality-list li:last-child {
    border-bottom: none;
}

.municipality-list li:hover {
    background: #1e293b;
    color: var(--accent);
}

.municipality-list li.highlighted {
    background: #10b981;
    color: white;
    font-weight: 600;
}

.municipality-list li .muni-type {
    font-size: 0.75rem;
    color: var(--muted);
    margin-left: 0.5rem;
}

.municipality-list li.highlighted .muni-type {
    color: rgba(255, 255, 255, 0.8);
}

@media (min-width: 980px) {
    .content {
        grid-template-columns: 1fr 350px;
    }
}

@media (max-width: 979px) {
    .study-map {
        min-height: 400px;
    }

    .municipality-list-wrapper {
        max-height: 300px;
    }
}