/* Achieve Tutorials Test Tracker — Custom Styles */

:root {
    --at-navy:  #163960;
    --at-gold:  #E8AE44;
    --at-navy-dark: #0f2740;
    --at-gold-hover: #f0c060;
}

/* ── Body ─────────────────────────────────────────────────── */
body {
    background-color: #f4f6f9;
}

/* ── Navbar ───────────────────────────────────────────────────
   Two rows: row 1 is brand + search + utility, row 2 is the main menu.
   Sticky/background/border live on the wrapper so the two rows read as one
   bar; each row is transparent and contributes only its own height. */
.at-header {
    background-color: var(--at-navy);
    border-bottom: 3px solid var(--at-gold);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.at-navbar {
    background-color: transparent !important;
    padding-top: 0;
    padding-bottom: 0;
}

/* Row 1 sits a shade darker so the two rows separate without a rule line —
   a border here would still show when row 2 is collapsed to zero height. */
.at-row1 { background-color: rgba(0, 0, 0, 0.18) !important; }

.at-brand {
    padding: 5px 0;
    margin-right: 1rem;
    line-height: 1;
}

/* Smaller than the one-row layout: two rows means the logo no longer has to
   carry the bar's whole height. */
.at-logo {
    height: 36px;
    width: auto;
    display: block;
}

/* Nav links — every top-level item is labeled. Each row stays compact so the
   two together aren't much taller than the old single row. */
.at-navbar .nav-link {
    color: rgba(255,255,255,0.85) !important;
    white-space: nowrap;
    transition: color 0.15s;
}
.at-row1 .nav-link {
    font-size: 0.92rem;
    padding: 0.5rem 0.6rem !important;
}
.at-row2 .nav-link {
    font-size: 1rem;
    padding: 0.6rem 0.85rem !important;
}
/* First item flush with the logo above it */
.at-row2 .navbar-nav > .nav-item:first-child > .nav-link { padding-left: 0 !important; }
.at-navbar .nav-link:hover,
.at-navbar .nav-link:focus,
.at-navbar .nav-link.active {
    color: var(--at-gold) !important;
}
.at-navbar .dropdown-toggle::after {
    opacity: 0.6;
}

/* Dropdown menus */
.at-navbar .dropdown-menu {
    border: none;
    border-top: 2px solid var(--at-gold);
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.at-navbar .dropdown-item:hover {
    background-color: #f0f4f8;
    color: var(--at-navy);
}
.at-navbar .dropdown-item-text {
    font-size: 0.8rem;
}

/* ── Nav search (students + parents) ──────────────────────────
   Row 1 has the whole width to itself now, so the field grows into it. */
.at-search {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 38rem;
    margin-right: 1rem;
}
.at-search-input {
    width: 100%;
    padding-left: 2rem;
    background-color: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.25);
    color: #fff;
}
.at-search-input::placeholder { color: rgba(255,255,255,0.6); }
.at-search-input:focus {
    background-color: #fff;
    color: var(--at-navy);
    border-color: var(--at-gold);
    box-shadow: 0 0 0 0.15rem rgba(232,174,68,0.35);
}
.at-search-input:focus::placeholder { color: #9aa5b1; }
.at-search-icon {
    position: absolute;
    left: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
    pointer-events: none;
    z-index: 4;
}
.at-search-input:focus ~ .at-search-icon,
.at-search .position-relative:focus-within .at-search-icon { color: #6b7280; }
.at-search-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 22rem;
    max-width: 80vw;
    max-height: 24rem;
    overflow-y: auto;
    padding: 0.25rem 0;
}
.at-search-menu.show { display: block; }
.at-search-menu .dropdown-item { white-space: normal; }
.at-search-empty {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    color: #6b7280;
}
/* Below lg the rows collapse. The search field stays visible in row 1 rather
   than hiding behind the toggler — it's the fastest way to reach a student on
   a phone — and drops onto its own full-width line under the brand. */
@media (max-width: 991.98px) {
    .at-row1 .container { flex-wrap: wrap; }
    .at-brand    { order: 1; }
    .at-toggler  { order: 2; margin-left: auto; }
    .at-search   { order: 3; flex: 0 0 100%; max-width: 100%;
                   margin: 0 0 0.5rem; }
    .at-utility  { order: 4; }
    .at-search-menu { width: 100%; }
    /* Stacked menus need breathing room between rows */
    .at-row1 .navbar-nav,
    .at-row2 .navbar-nav { padding-bottom: 0.4rem; }
    .at-row2 .navbar-nav > .nav-item:first-child > .nav-link { padding-left: 0.85rem !important; }
    .at-row1 .nav-link,
    .at-row2 .nav-link { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
    /* Collapsed row 2 must contribute no height at all */
    .at-row2 { padding: 0; }
    .at-row2 .navbar-collapse.show { border-top: 1px solid rgba(255,255,255,0.12); }
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.card-header {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn-primary {
    background-color: var(--at-navy);
    border-color: var(--at-navy);
}
.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--at-navy-dark);
    border-color: var(--at-navy-dark);
}
.btn-primary:focus-visible {
    box-shadow: 0 0 0 0.2rem rgba(22,57,96,0.4);
}

.btn-outline-primary {
    color: var(--at-navy);
    border-color: var(--at-navy);
}
.btn-outline-primary:hover {
    background-color: var(--at-navy);
    border-color: var(--at-navy);
    color: #fff;
}

/* Gold accent button */
.btn-gold {
    background-color: var(--at-gold);
    border-color: var(--at-gold);
    color: var(--at-navy);
    font-weight: 600;
}
.btn-gold:hover {
    background-color: var(--at-gold-hover);
    border-color: var(--at-gold-hover);
    color: var(--at-navy);
}

/* ── Form controls ────────────────────────────────────────── */
.form-check-input:checked {
    background-color: var(--at-navy);
    border-color: var(--at-navy);
}
.form-control:focus,
.form-select:focus {
    border-color: var(--at-gold);
    box-shadow: 0 0 0 0.2rem rgba(232,174,68,0.25);
}

/* ── Tables ───────────────────────────────────────────────── */
.table th {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #555;
}

/* ── Misc ─────────────────────────────────────────────────── */
.badge {
    font-weight: 500;
}

.progress {
    border-radius: 4px;
}

.font-monospace {
    font-family: 'SF Mono', 'Fira Code', monospace;
}

/* Gold highlight for nav active state (used in report pages etc.) */
.at-gold-text { color: var(--at-gold); }
.at-navy-text { color: var(--at-navy); }
