:root {
    /* ── Heatmap aktivnosti (bucket 0–4) ───────────────────────────── */
    --color-heatmap-0:      #22c55e;
    --color-heatmap-1:      #84cc16;
    --color-heatmap-2:      #facc15;
    --color-heatmap-3:      #f97316;
    --color-heatmap-4:      #ef4444;
    --color-heatmap-none:   #334155;

    /* ── Časovno obdobje ───────────────────────────────────────────── */
    --color-measured:       #166534;
    --color-forecast:       #f97316;

    /* ── Barve mejnih layerjev ─────────────────────────────────────── */
    --color-slo-outline:    #60cdee;
    --color-ggo-outline:    #4ade80;

    /* ── Barve odsekov ─────────────────────────────────────────────── */
    --color-odseki-fill:    #045010;
    --color-odseki-border:  #111827;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    width: 100%;
    height: 100%;
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    color: #0f172a;
}

.panel-logo {
    width: auto;
    height: 1em;
    display: block;
    object-fit: contain;
}

.app-shell {
    display: flex;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.left-panel {
    width: 430px;
    min-width: 430px;
    height: 100vh;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
}

.panel-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    min-height: 0;
}

.panel-credits {
    padding: 10px 16px;
    font-size: 0.75rem;
    color: #94a3b8;
    text-align: center;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    flex-shrink: 0;
}

.panel-header h1 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.7rem;
    line-height: 1;
}

.panel-header h1 .brand {
    display: inline-flex;
    gap: 0;
}

h1 .watch { color: #166534; }

.panel-subtitle {
    margin: 6px 0 0 0;
    color: #475569;
    font-size: 0.92rem;
}

.search-block,
.info-block {
    margin-top: 16px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px;
}

.search-block label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
}

/* ── Custom GGO dropdown ─────────────────────────────────────── */
.ggo-custom-select {
    position: relative;
    width: 100%;
    margin-bottom: 10px;
}

.ggo-select-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 1px solid #166534;
    border-radius: 8px;
    padding: 9px 10px;
    font-size: 0.95rem;
    font-family: inherit;
    background: #fff;
    color: #0f172a;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.ggo-select-trigger.ggo-placeholder {
    color: #94a3b8;
}

.ggo-select-trigger:focus {
    outline: none;
    border-color: #166534;
    box-shadow: 0 0 0 3px rgba(22, 101, 52, 0.16);
}

.ggo-select-trigger[aria-expanded="true"] {
    border-color: #166534;
    box-shadow: 0 0 0 3px rgba(22, 101, 52, 0.16);
}

#ggo-select-display {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ggo-select-arrow {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #64748b;
    flex-shrink: 0;
    transition: transform 0.15s;
}

.ggo-select-trigger[aria-expanded="true"] .ggo-select-arrow {
    transform: rotate(180deg);
}

.ggo-select-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 200;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.13);
    max-height: 240px;
    overflow-y: auto;
    padding: 4px;
}

.ggo-select-list[hidden] {
    display: none;
}

.ggo-select-option {
    display: block;
    width: 100%;
    padding: 8px 10px;
    text-align: left;
    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.93rem;
    font-family: inherit;
    color: #0f172a;
    transition: background 0.1s, color 0.1s;
}

.ggo-select-option.selected {
    background: #dcfce7;
    color: #166534;
    font-weight: 600;
}

.ggo-select-option.highlighted {
    background: #166534;
    color: #fff;
}

#odsek-search:focus {
    outline: none;
    border-color: #166534;
    box-shadow: 0 0 0 3px rgba(22, 101, 52, 0.16);
}

.search-row {
    display: flex;
    gap: 8px;
}

#odsek-search {
    flex: 1;
    min-width: 0;
    border: 1px solid #d2e1cb;
    border-radius: 8px;
    padding: 9px 10px;
    font-size: 0.95rem;
}

#odsek-search:not(:disabled) {
    border-color: #166534;
}

#search-btn {
    border: none;
    background: #166534;
    color: white;
    border-radius: 8px;
    padding: 9px 12px;
    cursor: pointer;
}

#search-btn:hover {
    background: #1d7e42;
}

#odsek-search:disabled,
#search-btn:disabled {
    background: #f1f5f9;
    color: #94a3b8;
    border-color: #e2e8f0;
    cursor: not-allowed;
}

.suggestions {
    margin-top: 8px;
    max-height: 180px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.suggestion-item {
    border: 1px solid #e2e8f0;
    background: #fff;
    text-align: left;
    border-radius: 8px;
    padding: 7px 9px;
    cursor: pointer;
}

.suggestion-item:hover,
.suggestion-item.active {
    background: #f0ffef;
    border-color: #2aca67;
}

.info-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.info-block h2 {
    margin: 0;
    font-size: 1rem;
}

.deselect-odsek-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 5px;
    font-size: 0.85rem;
    color: #64748b;
    border-radius: 4px;
    line-height: 1;
}
.deselect-odsek-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.selected-odsek {
    margin-top: 8px;
    font-weight: 700;
    color: #166534;
}

.posek-info {
    margin-top: 10px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 9px 11px;
    font-size: 0.88rem;
    line-height: 1.5;
}

.posek-info.hidden {
    display: none;
}

.posek-info .posek-title {
    font-weight: 700;
    color: #166534;
    margin-bottom: 4px;
}

.posek-info .posek-total {
    font-size: 1.05rem;
    font-weight: 700;
    color: #15803d;
}

.posek-info .posek-none {
    color: #64748b;
    font-style: italic;
}

.posek-info .posek-breakdown {
    margin-top: 4px;
    color: #374151;
}

/* ── "Analiziraj" gumb v posek-info ────────────────────────── */
.posek-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.posek-analyze-btn {
    flex-shrink: 0;
    border: 1px solid #166534;
    background: #f0fdf4;
    color: #166534;
    border-radius: 6px;
    padding: 3px 9px;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    white-space: nowrap;
}

.posek-analyze-btn:hover {
    background: #166534;
    color: #fff;
}

/* ── Analysis modal ─────────────────────────────────────────── */
.analysis-modal {
    position: absolute;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(2px);
}

.analysis-modal.hidden {
    display: none;
}

.analysis-modal-box {
    background: #fff;
    border-radius: 14px;
    padding: 22px 26px 20px;
    width: min(96%, 946px);
    height: min(96%, 520px);
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 16px 52px rgba(15, 23, 42, 0.22);
}

.analysis-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.analysis-modal-title {
    margin: 0;
    font-size: 1.05rem;
    color: #0f172a;
}

.analysis-subtitle {
    margin: 3px 0 0;
    font-size: 0.82rem;
    color: #64748b;
}

.analysis-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
    flex-shrink: 0;
}

.analysis-close:hover {
    color: #0f172a;
}

.analysis-legend {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: #374151;
}

.analysis-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.forecast-dot {
    background: #f97316;
    margin-left: 12px;
}

.analysis-chart-wrap {
    flex: 1;
    min-height: 0;
    position: relative;
}

.odsek-details {
    margin-top: 10px;
    font-size: 0.92rem;
    line-height: 1.45;
}

.odsek-details.empty {
    color: #64748b;
}

.details-table {
    width: 100%;
    border-collapse: collapse;
}

.details-table th,
.details-table td {
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    vertical-align: top;
    padding: 6px 4px;
    word-break: break-word;
}

.details-table th {
    width: 42%;
    color: #33553b;
    font-weight: 600;
}

.map-area {
    position: relative;
    flex: 1;
    min-width: 0;
}

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

.time-slider-overlay {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(203, 213, 225, 0.5);
    border-radius: 10px;
    padding: 10px 12px;
    min-width: 560px;
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}

.time-slider-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.time-slider-title {
    font-size: 0.84rem;
    color: #1e242c;
    font-weight: 600;
    white-space: nowrap;
}

.dataset-toggle {
    display: flex;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #cbd5e1;
    flex-shrink: 0;
}

.dataset-btn {
    flex: 0 0 auto;
    min-width: 105px;
    padding: 3px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.dataset-btn:first-child {
    border-right: 1px solid #cbd5e1;
}

.dataset-btn-active {
    background: #166534;
    color: #fff;
}

.dataset-btn:not(.dataset-btn-active):hover {
    background: #e2e8f0;
    color: #166534;
}

.time-slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

#month-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 999px;
    background: #cbd5e1;
    outline: none;
}

#month-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 6px rgba(15, 23, 42, 0.3);
    background: #166534;
    cursor: pointer;
}

#month-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 6px rgba(15, 23, 42, 0.3);
    background: #166534;
    cursor: pointer;
}

#month-slider.slider-historical::-webkit-slider-thumb { background: #166534; }
#month-slider.slider-historical::-moz-range-thumb { background: #166534; }

#month-slider.slider-forecast::-webkit-slider-thumb { background: #f97316; }
#month-slider.slider-forecast::-moz-range-thumb { background: #f97316; }

#month-label {
    width: 90px;
    text-align: center;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
}

.month-nav-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #334155;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.month-nav-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.month-nav-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ── Legenda ────────────────────────────────────────────────────── */
.legend-wrapper {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.legend-btn {
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(203, 213, 225, 0.5);
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.legend-btn:hover {
    background: rgba(255, 255, 255, 0.65);
}

.legend-panel {
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(203, 213, 225, 0.5);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 0.84rem;
    color: #1e293b;
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
    min-width: 190px;
}

.legend-panel.hidden {
    display: none;
}

.legend-section-title {
    font-weight: 700;
    font-size: 0.8rem;
    color: #1e242c;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.legend-rows {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 2px;
}

.legend-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.84rem;
}

.legend-row-text {
    color: #374151;
    padding-left: 2px;
}

.legend-swatch {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,0.1);
}

.legend-swatch-round {
    border-radius: 50%;
}

.legend-swatch-line {
    width: 18px;
    height: 3px;
    border-radius: 2px;
    border: none;
    align-self: center;
}

.legend-row-toggle {
    margin: 0 0 0 auto;
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: #2563eb;
    flex-shrink: 0;
}

.legend-divider {
    height: 1px;
    background: rgba(203, 213, 225, 0.7);
    margin: 8px 0;
}

/* ── Custom map controls (reset, help) ─────────────────────────── */
.map-ctrl-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 29px;
    height: 29px;
    background: #fff;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: #333;
    line-height: 1;
    padding: 0;
}

.map-ctrl-btn:hover:not(:disabled) {
    background: #f0f0f0;
}

.map-ctrl-btn:disabled {
    color: #bbb;
    cursor: default;
}

/* ── Help modal ─────────────────────────────────────────────────── */
.help-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.5);
    padding: 16px;
}

.help-modal.hidden {
    display: none;
}

.help-modal-box {
    background: #fff;
    border-radius: 14px;
    width: min(96%, 760px);
    height: min(94vh, 860px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 52px rgba(15, 23, 42, 0.28);
    overflow: hidden;
}

.help-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 26px 16px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.help-modal-title {
    margin: 0;
    font-size: 1.1rem;
    color: #0f172a;
}

.help-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 26px 24px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.help-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
    flex-shrink: 0;
}

.help-close:hover {
    color: #0f172a;
}

.help-section {
    display: flex;
    gap: 14px;
    padding: 16px 0;
}

.help-section-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
    width: 32px;
    text-align: center;
    padding-top: 2px;
}

.help-section-title {
    margin: 0 0 8px 0;
    font-size: 0.97rem;
    color: #166534;
}

.help-section p {
    margin: 0 0 8px 0;
    font-size: 0.9rem;
    color: #1e293b;
    line-height: 1.6;
}

.help-section p:last-child {
    margin-bottom: 0;
}

.help-list {
    margin: 6px 0 8px 0;
    padding-left: 18px;
    font-size: 0.9rem;
    color: #1e293b;
    line-height: 1.65;
}

.help-list li {
    margin-bottom: 4px;
}

.help-note {
    font-size: 0.84rem !important;
    color: #64748b !important;
    background: #f8fafc;
    border-left: 3px solid #cbd5e1;
    padding: 6px 10px !important;
    border-radius: 0 6px 6px 0;
    margin-top: 8px !important;
}

.help-divider {
    height: 1px;
    background: #f1f5f9;
    flex-shrink: 0;
}

.help-color-grid {
    display: grid;
    grid-template-columns: 20px 1fr;
    gap: 5px 10px;
    align-items: center;
    margin: 8px 0;
    font-size: 0.9rem;
    color: #1e293b;
}

.help-color-dot {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.1);
    display: block;
}

code {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 0.85em;
    font-family: monospace;
}

@media (max-width: 960px) {
    .left-panel {
        width: 360px;
        min-width: 360px;
    }

    .time-slider-overlay {
        min-width: 420px;
    }
}

/* ─── Page-enter transition (from landing page) ──────────────── */
#page-enter-overlay {
    position: fixed;
    inset: 0;
    background: #0a1a0d;
    z-index: 9999;
    pointer-events: none;
    animation: page-enter 0.55s ease-out 0.05s forwards;
}

@keyframes page-enter {
    from { opacity: 1; }
    to   { opacity: 0; }
}
