@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Outfit:wght@400;600;700&display=swap');

/* ── Design tokens ───────────────────────────────────────────────── */
:root {
    --color-brand:        #0d6efd;
    --color-brand-light:  #6ea8fe;
    --color-accent:       #f59e0b;
    --color-success:      #10b981;
    --color-danger:       #ef4444;
    --color-bg-light:     #f8fafc;
    --color-card-bg:      #ffffff;
    --radius-lg:  16px;
    --radius-md:   8px;
    --shadow-sm:  0 1px 3px rgba(0,0,0,.10);
    --shadow-md:  0 4px 6px -1px rgba(0,0,0,.10), 0 2px 4px -1px rgba(0,0,0,.06);
    --shadow-lg:  0 10px 15px -3px rgba(0,0,0,.10), 0 4px 6px -2px rgba(0,0,0,.05);
}

/* ── Base ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--color-bg-light);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', system-ui, sans-serif;
}

/* Tabular numbers for inputs and question cells */
input[type="number"],
.am-num,
#questionsTable td:first-child {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

/* ── Site Header ─────────────────────────────────────────────────── */
.am-site-header {
    background: rgba(13, 110, 253, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-md);
    padding: 0.5rem 0;
    text-align: center;
}

.am-site-header a {
    color: #fff;
    text-decoration: none;
    display: inline-block;
    padding: 0.3rem 1rem;
    border-radius: var(--radius-md);
    transition: background 0.2s ease;
}

.am-site-header a h4 {
    margin: 0;
    color: #fff;
    font-family: 'Outfit', sans-serif;
}

.am-site-header a:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Keep the header area sized while JS injects */
#am-header {
    min-height: 56px;
    background: rgba(13, 110, 253, 0.92);
}

/* ── Topic nav bar ───────────────────────────────────────────────── */
nav.am-topic-nav {
    background: rgba(248, 250, 252, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(13, 110, 253, 0.15);
    min-height: 48px;
}

/* ── Site Footer ─────────────────────────────────────────────────── */
.am-site-footer {
    background: rgba(13, 110, 253, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, .08);
    padding: 0.75rem 0;
    margin-top: 2rem;
}

.am-site-footer .btn-outline-light {
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
}

#am-footer {
    min-height: 48px;
    background: rgba(13, 110, 253, 0.92);
    margin-top: 2rem;
}

/* ── Cards ───────────────────────────────────────────────────────── */
.card {
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-lg);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* ── Global transitions ──────────────────────────────────────────── */
a, button, .btn {
    transition: all 0.2s ease;
}

/* ── Tab styles ──────────────────────────────────────────────────── */
.nav-tabs .nav-link {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--color-brand);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border: 2px solid transparent;
    letter-spacing: 0.02em;
}

.nav-tabs .nav-link:not(.active) {
    background: rgba(13, 110, 253, 0.07);
    border: 2px solid rgba(13, 110, 253, 0.25);
    border-bottom-color: transparent;
}

.nav-tabs .nav-link.active {
    color: var(--color-brand);
    border: 2px solid var(--color-brand);
    border-bottom-color: #fff;
    background: #fff;
}

/* ── Streak widget ───────────────────────────────────────────────── */
.am-streak-card {
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(245,158,11,.07), rgba(79,70,229,.04));
    box-shadow: var(--shadow-sm);
}

.am-streak-badge {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-accent);
    white-space: nowrap;
}

.am-week-day {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    background: #e2e8f0;
    color: #64748b;
    line-height: 1.2;
    flex-shrink: 0;
}

.am-week-day.practiced {
    background: #000;
    color: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,.3);
}

.am-week-day.today {
    outline: 2px solid #000;
    outline-offset: 2px;
}

/* ── Streak badge in topic nav ───────────────────────────────────── */
.am-streak-nav-badge {
    background: var(--color-accent);
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
}
