/* Parent/Student portal top-tab navigation — visible from the lg breakpoint up, where the
   bottom nav bar (below) is hidden. See _ParentLayout.cshtml / _StudentPortalLayout.cshtml. */
.portal-tabbar .nav {
    gap: 0.25rem;
}

.portal-tabbar .nav-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.75rem 0.9rem;
    color: var(--bs-secondary-color);
    border-bottom: 3px solid transparent;
    font-size: 0.925rem;
}

.portal-tabbar .nav-link:hover {
    color: var(--bs-body-color);
}

.portal-tabbar .nav-link.active {
    color: var(--ahis-navy);
    border-bottom-color: var(--ahis-gold-dark);
    font-weight: 600;
}

[data-bs-theme="dark"] .portal-tabbar .nav-link.active {
    color: var(--ahis-gold);
    border-bottom-color: var(--ahis-gold);
}

/*
  Bottom tab bar — the mobile counterpart to .portal-tabbar above, shown only below the lg
  breakpoint (see the d-lg-none on the <nav> itself in each layout) for a native-app feel on a
  parent or student's phone, where a fixed bottom bar is a far more natural reach-zone than a
  top strip. Fixed to the viewport, with safe-area padding so it clears the iOS home-indicator
  gesture bar instead of sitting under it.

  Pairs with two things each layout applies itself: <body class="has-bottom-nav"> (raises the
  PWA install banner's --ahis-bottom-inset so the two never overlap — see theme.css) and
  <main class="ahis-bottom-nav-spacer"> (reserves room at the bottom of the page so content
  isn't hidden behind the fixed bar). Both self-cancel at the lg breakpoint alongside the bar.
*/
.ahis-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1030;
    background: var(--ahis-paper);
    border-top: 1px solid var(--bs-border-color);
    box-shadow: var(--ahis-shadow-md);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.ahis-bottom-nav .nav {
    display: flex;
}

.ahis-bottom-nav .nav-item {
    flex: 1 1 0;
    min-width: 0;
}

.ahis-bottom-nav .nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.5rem 0.25rem;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--bs-secondary-color);
    text-align: center;
    border-top: 2px solid transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ahis-bottom-nav .nav-link .bi {
    font-size: 1.3rem;
    line-height: 1;
}

.ahis-bottom-nav .nav-link.active {
    color: var(--ahis-navy);
    border-top-color: var(--ahis-gold-dark);
}

[data-bs-theme="dark"] .ahis-bottom-nav .nav-link.active {
    color: var(--ahis-gold);
    border-top-color: var(--ahis-gold);
}

.ahis-bottom-nav-spacer {
    padding-bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
}

body.has-bottom-nav {
    --ahis-bottom-inset: 4.75rem;
}

@media (min-width: 992px) {
    .ahis-bottom-nav {
        display: none !important;
    }
    .ahis-bottom-nav-spacer {
        padding-bottom: 0;
    }
    body.has-bottom-nav {
        --ahis-bottom-inset: 0px;
    }
}

/* "More" bottom sheet opened by the last tab of the mobile bottom bar. */
.ahis-bottom-nav button.nav-link {
    width: 100%;
    background: none;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
}

.ahis-more-sheet {
    border-radius: 1rem 1rem 0 0;
    --bs-offcanvas-height: auto;
    max-height: 85vh;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.ahis-more-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.ahis-more-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.85rem 0.25rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
    color: var(--bs-body-color);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
}

.ahis-more-tile .bi {
    font-size: 1.5rem;
    color: var(--ahis-gold-dark);
}

.ahis-more-account {
    border-top: 1px solid var(--bs-border-color);
    padding-top: 0.5rem;
}

.ahis-more-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    min-height: 48px;
    padding: 0.5rem 0.25rem;
    background: none;
    border: 0;
    color: inherit;
    text-decoration: none;
    text-align: left;
    font-size: 0.95rem;
}

.ahis-more-row .bi {
    font-size: 1.15rem;
    width: 1.5rem;
    text-align: center;
}

/* ───────── Dashboard components (Student, Parent, Admin) ───────── */
.portal-hero {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    color: #fff;
    background: linear-gradient(135deg, var(--ahis-navy) 0%, #1f3d5f 100%);
    border-radius: var(--ahis-radius);
    box-shadow: var(--ahis-shadow-md);
    position: relative;
    overflow: hidden;
}
.portal-hero::after {
    content: "";
    position: absolute;
    right: -2.5rem;
    top: -2.5rem;
    width: 9rem;
    height: 9rem;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(242, 183, 5, 0.28), transparent 70%);
    pointer-events: none;
}
.portal-hero h1 { color: #fff; margin: 0; }
.portal-hero .ahis-eyebrow { color: var(--ahis-gold); }
.portal-hero .portal-hero-meta { color: rgba(255, 255, 255, 0.78); font-size: 0.85rem; margin: 0.15rem 0 0; }
.portal-avatar {
    width: 56px; height: 56px; flex-shrink: 0;
    border-radius: 50%; object-fit: cover;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.15rem;
    background: var(--ahis-gold); color: var(--ahis-navy-dark);
    border: 2px solid rgba(255, 255, 255, 0.6);
}

.portal-section-title {
    display: flex; align-items: center; justify-content: space-between;
    margin: 1.5rem 0 0.6rem;
    font: 700 0.78rem/1 var(--bs-body-font-family);
    letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--bs-secondary-color);
}
.portal-section-title a { font-size: 0.8rem; text-transform: none; letter-spacing: 0; font-weight: 600; }

/* Quick-action tiles */
.portal-quick {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
    gap: 0.75rem;
}
.portal-quick a {
    display: flex; flex-direction: column; align-items: flex-start; gap: 0.4rem;
    padding: 0.9rem 1rem;
    background: var(--ahis-paper);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--ahis-radius);
    color: var(--bs-body-color);
    text-decoration: none;
    font-weight: 600; font-size: 0.9rem;
    transition: box-shadow 0.15s var(--ahis-ease), transform 0.15s var(--ahis-ease), border-color 0.15s;
}
.portal-quick a:hover { box-shadow: var(--ahis-shadow-md); transform: translateY(-2px); border-color: var(--ahis-gold-dark); }
.portal-quick .bi { font-size: 1.4rem; color: var(--ahis-gold-dark); }
.portal-quick small { font-weight: 500; color: var(--bs-secondary-color); font-size: 0.75rem; }

/* Attendance ring: --pct is set inline (0-100). */
.portal-ring {
    --pct: 0;
    --size: 5.5rem;
    width: var(--size); height: var(--size); flex-shrink: 0;
    border-radius: 50%;
    background: conic-gradient(var(--bs-success) calc(var(--pct) * 1%), var(--bs-secondary-bg) 0);
    display: grid; place-items: center;
}
.portal-ring > span {
    width: calc(var(--size) - 0.9rem); height: calc(var(--size) - 0.9rem);
    border-radius: 50%; background: var(--ahis-paper);
    display: grid; place-items: center;
    font: 800 1.25rem/1 var(--bs-body-font-family);
}
.portal-ring small { display: block; font-size: 0.6rem; font-weight: 600; letter-spacing: 0.05em; color: var(--bs-secondary-color); text-align: center; }

.portal-panel {
    background: var(--ahis-paper);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--ahis-radius);
    padding: 1rem 1.1rem;
}
.portal-legend { display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; font-size: 0.82rem; color: var(--bs-secondary-color); }
.portal-legend i { display: inline-block; width: 0.6rem; height: 0.6rem; border-radius: 50%; margin-right: 0.3rem; }

/* Timetable list: highlights the lesson in progress / up next (set by dashboard script). */
.portal-lesson {
    display: flex; align-items: center; gap: 1rem;
    padding: 0.85rem 1rem;
    background: var(--ahis-paper);
    border: 1px solid var(--bs-border-color);
    border-left: 4px solid var(--ahis-maroon);
    border-radius: var(--ahis-radius-sm);
    margin-bottom: 0.5rem;
}
.portal-lesson.is-now { border-left-color: var(--bs-success); box-shadow: var(--ahis-shadow-sm); background: var(--bs-success-bg-subtle); }
.portal-lesson.is-next { border-left-color: var(--ahis-gold-dark); }
.portal-lesson.is-done { opacity: 0.55; }
.portal-lesson .portal-lesson-time { width: 3.6rem; flex-shrink: 0; text-align: center; font-weight: 700; font-size: 0.85rem; }
.portal-lesson .portal-lesson-time small { display: block; font-weight: 500; font-size: 0.72rem; color: var(--bs-secondary-color); }
.portal-lesson .portal-lesson-tag { margin-left: auto; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }

.portal-empty { text-align: center; color: var(--bs-secondary-color); padding: 1.75rem 1rem; }
.portal-empty .bi { display: block; font-size: 1.8rem; margin-bottom: 0.4rem; color: var(--ahis-gold-dark); }

/* Setup progress (Admin) */
.portal-progress { height: 0.5rem; background: var(--bs-secondary-bg); border-radius: 999px; overflow: hidden; }
.portal-progress > div { height: 100%; background: linear-gradient(90deg, var(--ahis-gold-dark), var(--ahis-gold)); border-radius: inherit; }

[data-bs-theme="dark"] .portal-hero { background: linear-gradient(135deg, #0c1a2b 0%, #16304d 100%); border: 1px solid rgba(255,255,255,0.08); }
[data-bs-theme="dark"] .portal-quick a,
[data-bs-theme="dark"] .portal-panel,
[data-bs-theme="dark"] .portal-lesson { background: var(--bs-tertiary-bg); }
[data-bs-theme="dark"] .portal-ring > span { background: var(--bs-tertiary-bg); }
[data-bs-theme="dark"] .portal-quick .bi { color: var(--ahis-gold); }

/* Public-site bottom bar: a highlighted centre "Apply" action, and the floating WhatsApp /
   back-to-top buttons lifted clear of the bar on phones. */
.ahis-public-bottom-nav .nav-item-primary .nav-link {
    color: var(--ahis-navy-dark);
    position: relative;
}
.ahis-public-bottom-nav .nav-item-primary .nav-link .bi {
    background: var(--ahis-gold);
    color: var(--ahis-navy-dark);
    width: 2.6rem;
    height: 2.6rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    margin-top: -1.1rem;
    box-shadow: var(--ahis-shadow-md);
    font-size: 1.2rem;
}
[data-bs-theme="dark"] .ahis-public-bottom-nav .nav-item-primary .nav-link { color: var(--ahis-gold); }

@media (max-width: 991.98px) {
    .public-float-wa { bottom: calc(var(--ahis-bottom-inset, 4.75rem) + 0.75rem) !important; }
    .public-float-top { bottom: calc(var(--ahis-bottom-inset, 4.75rem) + 0.75rem) !important; }
    .public-float-top.has-wa { bottom: calc(var(--ahis-bottom-inset, 4.75rem) + 4.75rem) !important; }
}

.ahis-more-grid-2 { grid-template-columns: repeat(2, 1fr); }
