/* ===== ČNB Exchange Rates (Kurzy ČNB) — TechTools.cz =====
   Public tool, account:none, bilingual EN/CS. Dark theme, mobile-first.
   Loaded AFTER /shared-topnav.css so this :root seeds --tt-topnav-h. */

:root {
    --primary-bg: #0a0a0f;
    --secondary-bg: #141419;
    --card-bg: #1a1a24;
    --card-bg-2: #20202c;
    --border-color: rgba(255, 255, 255, 0.10);
    --border-strong: rgba(255, 255, 255, 0.18);
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --ok: #34d399;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.72);
    --text-muted: rgba(255, 255, 255, 0.50);
    --radius-sm: 0.45rem;
    --radius-md: 0.7rem;
    --radius-lg: 1.1rem;
    --transition: 0.2s ease;
    --tt-topnav-h: 64px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; overflow-x: clip; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--primary-bg);
    color: var(--text-primary);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-secondary); }

.page { min-height: calc(100vh - var(--tt-topnav-h)); }
.app { max-width: 880px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }

/* hero */
.hero { text-align: center; padding: 1.5rem 0 1.2rem; }
.hero-badge {
    display: inline-flex; align-items: center; gap: 0.45rem;
    font-size: 0.78rem; font-weight: 600; color: var(--accent-secondary);
    background: rgba(139, 92, 246, 0.12); border: 1px solid rgba(139, 92, 246, 0.3);
    padding: 0.32rem 0.75rem; border-radius: 999px; margin-bottom: 1rem;
}
.hero h1 {
    font-size: clamp(1.7rem, 5vw, 2.6rem); font-weight: 800; letter-spacing: -0.02em; margin: 0 0 0.6rem;
    background: linear-gradient(120deg, #fff 30%, #c7d2fe 100%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.lead { color: var(--text-secondary); font-size: 1.02rem; max-width: 38rem; margin: 0 auto; }
.lead strong { color: var(--text-primary); }

/* converter */
.converter {
    background: var(--card-bg); border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg); padding: 1.3rem; margin-bottom: 1.8rem;
}
.conv-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.7rem; }
.conv-field { flex: 1 1 8rem; min-width: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.conv-field label { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; }
.conv-field input, .conv-field select {
    width: 100%; background: var(--card-bg-2); color: var(--text-primary);
    border: 1px solid var(--border-color); border-radius: var(--radius-sm);
    padding: 0.7rem 0.8rem; font-size: 1rem; font-family: inherit; min-height: 48px;
    transition: border-color var(--transition);
}
.conv-field input:focus, .conv-field select:focus { outline: none; border-color: var(--accent-primary); }
.conv-field select { cursor: pointer; 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='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 0.7rem center; padding-right: 2rem; }
.swap-btn {
    flex: 0 0 auto; width: 48px; height: 48px; border-radius: 50%;
    background: var(--accent-gradient); color: #fff; border: none; cursor: pointer;
    font-size: 1rem; display: grid; place-items: center; align-self: flex-end;
    transition: transform var(--transition), filter var(--transition);
}
.swap-btn:hover { filter: brightness(1.1); }
.swap-btn:active { transform: rotate(180deg); }
.conv-result {
    margin-top: 1.1rem; font-size: clamp(1.4rem, 4vw, 2rem); font-weight: 700;
    letter-spacing: -0.01em; word-break: break-word;
}
.conv-result .res-num { color: var(--ok); }
.conv-rate { margin-top: 0.4rem; color: var(--text-muted); font-size: 0.85rem; }

/* rates table */
.rates-head {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 0.8rem; margin-bottom: 0.5rem;
}
.rates-head h2 { font-size: 1.2rem; font-weight: 700; margin: 0; }
.rates-controls { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: flex-end; }
.date-field { display: flex; flex-direction: column; gap: 0.25rem; }
.date-field label { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; }
.date-field input {
    background: var(--card-bg-2); color: var(--text-primary); border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); padding: 0.5rem 0.6rem; font-family: inherit; font-size: 0.9rem;
    min-height: 40px; color-scheme: dark;
}
.filter-field { position: relative; display: flex; align-items: center; }
.filter-field i { position: absolute; left: 0.7rem; color: var(--text-muted); font-size: 0.85rem; pointer-events: none; }
.filter-field input {
    background: var(--card-bg-2); color: var(--text-primary); border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); padding: 0.5rem 0.7rem 0.5rem 2rem; font-family: inherit; font-size: 0.9rem;
    min-height: 40px; width: 11rem; max-width: 100%;
}
.filter-field input:focus, .date-field input:focus { outline: none; border-color: var(--accent-primary); }
.published { color: var(--text-muted); font-size: 0.82rem; margin: 0 0 0.7rem; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border-color); border-radius: var(--radius-md); }
.rate-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.rate-table th, .rate-table td { padding: 0.6rem 0.8rem; text-align: left; white-space: nowrap; }
.rate-table thead th {
    color: var(--text-muted); font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
    background: var(--card-bg-2); position: sticky; top: 0; border-bottom: 1px solid var(--border-color);
}
.rate-table th.num, .rate-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.rate-table tbody tr { border-bottom: 1px solid var(--border-color); transition: background var(--transition); }
.rate-table tbody tr:last-child { border-bottom: none; }
.rate-table tbody tr:hover { background: var(--card-bg-2); }
.code-badge {
    display: inline-block; font-weight: 700; color: var(--accent-secondary);
    background: rgba(139, 92, 246, 0.12); border-radius: 0.3rem; padding: 0.1rem 0.4rem; font-size: 0.82rem;
}
.ccy-name { color: var(--text-secondary); }
.ccy-country { color: var(--text-muted); font-size: 0.8rem; }

.status { text-align: center; padding: 1rem; font-size: 0.9rem; }
.status.error { color: #f87171; }
.spinner {
    display: inline-block; width: 1.1em; height: 1.1em;
    border: 2px solid rgba(255,255,255,0.25); border-top-color: var(--accent-secondary);
    border-radius: 50%; margin-right: 0.5rem; vertical-align: -0.18em; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* about / footer */
.about { margin-top: 2.5rem; padding-top: 1.6rem; border-top: 1px solid var(--border-color); }
.about h2 { font-size: 1.1rem; font-weight: 700; margin: 0 0 0.6rem; }
.about p { color: var(--text-secondary); font-size: 0.92rem; max-width: 46rem; }
.foot { margin-top: 1.5rem; color: var(--text-muted); font-size: 0.82rem; text-align: center; }
.foot a { color: var(--text-secondary); }

/* responsive */
@media (max-width: 560px) {
    .app { padding: 1rem 0.85rem 2.5rem; }
    .conv-field { flex-basis: 100%; }
    .swap-btn { align-self: center; transform: rotate(90deg); }
    .swap-btn:active { transform: rotate(270deg); }
    .rates-head { flex-direction: column; align-items: stretch; }
    .rates-controls { justify-content: space-between; }
    .filter-field input { width: 100%; }
    .filter-field { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Dark-theme dropdown fix (fleet sweep 2026-06-30): native <option>s do NOT inherit
   the dark theme — the OS paints the open list white, so without explicit colours the
   options are white-on-white (invisible). Literal hex per .claude/rules/coding-standards.md. */
select option { background-color: #1a1a24; color: #ffffff; }
