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

[hidden] {
    display: none !important;
}

:root {
    --bg: #0f1e2b;
    --card: #162a3b;
    --ink: #eef3f6;
    --muted: #9fb3c2;
    --accent: #f2b544;
    --accent-ink: #1b1400;
    --border: #28445b;
    --error: #ff8a80;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
    background-color: var(--bg);
    color: var(--ink);
    line-height: 1.5;
}

.container {
    max-width: 760px;
    margin: 0 auto;
    padding: 32px 16px 48px;
}

.page-header {
    margin-bottom: 20px;
}

.page-header h1 {
    font-size: 1.8rem;
    color: var(--accent);
}

.subtitle,
.meta {
    color: var(--muted);
}

.card {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.search {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    align-items: end;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

label {
    font-size: 0.9rem;
    font-weight: 600;
}

input,
select,
button {
    font: inherit;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background-color: #0c1822;
    color: var(--ink);
    width: 100%;
}

button {
    background-color: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
    font-weight: 700;
    cursor: pointer;
}

.results h2 {
    font-size: 1.2rem;
}

.times {
    list-style: none;
    margin-top: 12px;
}

.times li {
    display: flex;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

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

.times .time {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.next {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    background-color: #0c1822;
}

.countdown {
    font-size: 1.8rem;
    font-variant-numeric: tabular-nums;
    color: var(--accent);
}

.times li.next {
    background-color: rgba(242, 181, 68, 0.14);
    border-radius: 8px;
    color: var(--accent);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.page-header {
    position: relative;
}

.lang-switch {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.lang-switch .lang-btn {
    width: auto;
    padding: 4px 12px;
    background-color: transparent;
    border-color: var(--border);
    color: var(--muted);
    font-weight: 600;
}

.lang-switch .lang-btn[aria-pressed="true"] {
    background-color: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
}

[dir="rtl"] body,
[lang="ar"] {
    font-family: "Noto Naskh Arabic", "Geeza Pro", "Segoe UI", Tahoma, sans-serif;
}

:focus-visible {
    outline: 3px solid #7fd1ff;
    outline-offset: 2px;
}

@media (max-width: 480px) {
    .container {
        padding: 20px 12px 32px;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }

    .card {
        padding: 16px;
    }

    .countdown {
        font-size: 1.5rem;
    }
}

.status {
    min-height: 1.5em;
    margin-bottom: 12px;
    color: var(--muted);
}

.status.error {
    color: var(--error);
    font-weight: 600;
}

[aria-invalid="true"] {
    border-color: var(--error);
}

button:disabled {
    opacity: 0.6;
    cursor: wait;
}

.cache-note {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    background-color: rgba(127, 209, 255, 0.12);
    color: #bfe6ff;
    font-size: 0.9rem;
}
