@import url('https://fonts.googleapis.com/css?family=Roboto:400,600,700&subset=latin-ext');

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #f1f5f9;
    --card: #ffffff;
    --border: #e2e8f0;
    --border-inner: #f1f5f9;
    --th-bg: #f8fafc;
    --text: #1e293b;
    --text-sub: #475569;
    --text-muted: #94a3b8;
    --text-label: #64748b;
    --nav-bg: #ffffff;
    --pill-bg: #e2e8f0;
    --pill-text: #475569;
    --badge-bg: #f1f5f9;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f172a;
        --card: #1e293b;
        --border: #334155;
        --border-inner: #273549;
        --th-bg: #162032;
        --text: #f1f5f9;
        --text-sub: #cbd5e1;
        --text-muted: #64748b;
        --text-label: #94a3b8;
        --nav-bg: #1e293b;
        --pill-bg: #334155;
        --pill-text: #94a3b8;
        --badge-bg: #334155;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    background: var(--bg);
    color: var(--text);
    padding-bottom: 72px;
}

/* ── Content ── */
.content {
    padding: 16px;
}

/* ── Camera cards ── */
.camera-card {
    background: var(--card);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
    margin-bottom: 12px;
}

.camera-card img {
    display: block;
    width: 100%;
    margin: 0;
}

.camera-label {
    padding: 10px 14px;
    font-size: 12px;
    color: var(--text-label);
    font-weight: 500;
}

/* ── Video cards ── */
.section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-label);
    text-transform: uppercase;
    letter-spacing: .6px;
    margin: 20px 0 8px;
}

.video-card {
    background: var(--card);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
    margin-bottom: 12px;
}

.video-card video {
    display: block;
    width: 100%;
}

.video-label {
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

/* ── Traffic items (Slovenian police) ── */
.traffic-item {
    background: var(--card);
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
    margin-bottom: 10px;
}

.traffic-item .meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.traffic-item h5 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.traffic-item .wait-time {
    font-size: 22px;
    font-weight: 700;
}

.label {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.label-primary {
    background: #dbeafe;
    color: #1d4ed8;
}

.label-info {
    background: #f0f9ff;
    color: #0369a1;
}

@media (prefers-color-scheme: dark) {
    .label-primary {
        background: #1e3a5f;
        color: #93c5fd;
    }

    .label-info {
        background: #0c2d48;
        color: #7dd3fc;
    }
}

.text-success {
    color: #16a34a;
}

.text-warning {
    color: #d97706;
}

.text-danger {
    color: #dc2626;
}

/* ── AMSS items ── */
.amss.item {
    border-left: 3px solid #2563eb;
}

.item {
    background: var(--card);
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
    margin-bottom: 10px;
}

.item time {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.item h5 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.item p {
    font-size: 12px;
    color: var(--text-sub);
    line-height: 1.5;
}

.item p:last-of-type {
    margin-bottom: 0;
}

/* ── HAK table ── */
.hak-table {
    background: var(--card);
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
    overflow-x: auto;
}

.hak-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: block;
}

.hak-table time {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

/* HAK gpStatus table styles */
.hak-table .gpTitle {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    margin: 20px 0 8px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.hak-table > div:first-child .gpTitle {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.hak-table .gptable {
    width: 100%;
    font-size: 12px;
    margin-bottom: 4px;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    border-collapse: separate;
    border-spacing: 0;
}

.hak-table .gptable th {
    color: var(--text-label);
    font-size: 11px;
    text-transform: uppercase;
    padding: 6px 8px;
    background: var(--th-bg);
    border-bottom: 1px solid var(--border);
    text-align: center;
    border-right: 1px solid var(--border);
}

.hak-table .gptable th:last-child {
    border-right: none;
}

.hak-table .gptable .thNoBorder {
    background: none;
    border-bottom-color: transparent;
}

.hak-table .gptable td {
    padding: 8px;
    border-bottom: 1px solid var(--border-inner);
    border-right: 1px solid var(--border-inner);
    color: var(--text-sub);
}

.hak-table .gptable td:last-child {
    border-right: none;
}

.hak-table .gptable tr:last-child td {
    border-bottom: none;
}

.hak-table .gpime {
    font-weight: 600;
    color: var(--text);
}

.hak-table .gpUnos {
    text-align: center;
}

.hak-table .gpvehcar::before {
    content: "🚗";
}

.hak-table .gpvehtruck::before {
    content: "🚚";
}

.hak-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.hak-table th {
    text-align: left;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    padding: 4px 6px;
    border-bottom: 1px solid var(--border);
}

.hak-table td {
    padding: 8px 6px;
    border-bottom: 1px solid var(--border-inner);
    color: var(--text-sub);
}

.hak-table tr:last-child td {
    border-bottom: none;
}

/* ── External links ── */
.external-link {
    display: block;
    background: var(--card);
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
    color: #2563eb;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    margin-bottom: 10px;
}

@media (prefers-color-scheme: dark) {
    .external-link {
        color: #60a5fa;
    }
}

/* ── Source badges ── */
.source-badge {
    display: inline-block;
    background: var(--badge-bg);
    color: var(--text-label);
    font-size: 10px;
    font-weight: 700;
    border-radius: 6px;
    padding: 2px 7px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.source-badge + .source-badge,
.hak-table + .source-badge,
.item + .source-badge,
.traffic-item + .source-badge {
    margin-top: 20px;
}

/* ── Tab panels ── */
.tab-panel {
    display: none;
    max-width: 600px;
    margin: 0 auto;
}

.tab-panel.active {
    display: block;
}

/* ── Bottom pill nav ── */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    border-top: 1px solid var(--border);
    padding: 10px 12px 14px;
    z-index: 10;
}

.pill-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    max-width: 600px;
    margin: 0 auto;
}

.pill-nav::-webkit-scrollbar {
    display: none;
}

.pill {
    background: var(--pill-bg);
    color: var(--pill-text);
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    border: none;
    flex-shrink: 0;
    transition: background .15s, color .15s;
}

.pill.active {
    background: #2563eb;
    color: #fff;
}

.pill.data-pill.active {
    background: #15803d;
    color: #fff;
}