/* ==========================================================================
   Green Hope University — Student Portal theme
   Colours taken from the GHU logo (see StudentPortalPlan.md §2).
   Tailwind utilities for the same colours: bg-ghu-green-700, text-ghu-blue-900 ...
   (configured in Pages/Shared/_HeadIncludes.cshtml)
   ========================================================================== */

:root {
    --ghu-green-700: #1E7B34;   /* ribbon / Africa (dark) — primary        */
    --ghu-green-500: #3FA34D;   /* ribbon (light) — success, positive      */
    --ghu-green-50:  #EEF8EF;   /* tint — chips, soft backgrounds          */
    --ghu-blue-900:  #1B2A6B;   /* "GREEN HOPE UNIVERSITY" lettering       */
    --ghu-blue-600:  #2A4BC4;   /* globe band — links, info                */
    --ghu-sky-200:   #BFDDF5;   /* globe background                        */
    --ghu-gold-400:  #E9C45C;   /* outer ring — badges, highlights         */
    --ghu-magenta:   #C8378C;   /* ribbon ends — single accent per screen  */

    --ghu-appbar-h:  60px;
    --ghu-tabbar-h:  64px;
    --ghu-band-h:    170px;     /* brand band below the app bar (page title area) */

    /* Brand gradient shared by the app bar and the band so they read as one surface */
    --ghu-brand-gradient: linear-gradient(100deg, var(--ghu-green-700) 0%, #17692B 55%, var(--ghu-blue-900) 140%);
}

/* ── Page background: logo colours instead of plain white ─────────────────
   Light green (ribbon) at the top fading to light sky (globe) at the bottom,
   with a green → blue brand band behind the page title (body::before).     */
body.ghu-student {
    position: relative;
    min-height: 100vh;
    background:
        radial-gradient(70% 45% at 100% 100%, rgba(191, 221, 245, .55) 0%, transparent 70%),
        linear-gradient(180deg, #E4F1E7 0%, #E9F3EC 40%, #E3EEF8 100%);
    background-attachment: fixed;
    -webkit-tap-highlight-color: transparent;
}
body.ghu-student::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: calc(var(--ghu-appbar-h) + env(safe-area-inset-top) + var(--ghu-band-h));
    background:
        radial-gradient(60% 120% at 90% 0%, rgba(191, 221, 245, .28) 0%, transparent 60%),
        radial-gradient(40% 80% at 0% 100%, rgba(233, 196, 92, .16) 0%, transparent 70%),
        var(--ghu-brand-gradient);
    border-radius: 0 0 28px 28px;
    z-index: 0;
    pointer-events: none;
}
@media (min-width: 768px) {
    body.ghu-student::before { border-radius: 0 0 40px 40px; }
}
/* Content sits above the band */
body.ghu-student .ghu-main { position: relative; z-index: 1; }

/* Text placed on the band (page titles, greeting) */
.ghu-band-muted { color: rgba(255, 255, 255, .78); }

/* ── App bar ─────────────────────────────────────────────────────────────── */
.ghu-appbar {
    height: var(--ghu-appbar-h);
    background: var(--ghu-brand-gradient);
    padding-top: env(safe-area-inset-top);
    box-sizing: content-box;
}

.ghu-appbar-logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #fff;
    object-fit: contain;
    padding: 2px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
}

/* Desktop top navigation (md and up) */
.ghu-topnav a {
    color: rgba(255, 255, 255, .78);
}
.ghu-topnav a:hover {
    color: #fff;
    background: rgba(255, 255, 255, .10);
}
.ghu-topnav a.is-active {
    color: var(--ghu-green-700);
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
}

/* ── Bottom tab bar (phones): floating dock ─────────────────────────────────
   Markup: nav.ghu-tabbar > .ghu-tab-indicator + 5 × a.ghu-tab
   The green indicator pill slides to the active tab: --i = tab index (0–4),
   set by the server on load and by JS the moment a tab is tapped.          */
.ghu-tabbar {
    position: fixed;
    z-index: 50;
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    height: var(--ghu-tabbar-h);
    padding: 0 6px;
    display: flex;
    align-items: stretch;
    border-radius: 24px;
    background: rgba(255, 255, 255, .88);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    backdrop-filter: saturate(180%) blur(16px);
    border: 1px solid rgba(30, 123, 52, .14);
    box-shadow:
        0 14px 34px -14px rgba(27, 42, 107, .45),
        0 2px 8px rgba(15, 23, 42, .06);
}
@media (min-width: 768px) {
    .ghu-tabbar { display: none; }
}

/* Sliding green pill behind the active icon (one tab wide, pill centred) */
.ghu-tab-indicator {
    --i: 0;
    position: absolute;
    top: 9px;
    left: 6px;
    width: calc((100% - 12px) / 5);
    height: 32px;
    display: flex;
    justify-content: center;
    pointer-events: none;
    transform: translateX(calc(var(--i) * 100%));
    transition: transform .38s cubic-bezier(.2, .9, .25, 1.05);
}
.ghu-tab-indicator::before {
    content: "";
    width: 56px;
    height: 32px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--ghu-green-700) 0%, #2E8B45 100%);
    box-shadow: 0 6px 14px -6px rgba(30, 123, 52, .75);
}

.ghu-tab {
    position: relative;
    z-index: 1;
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding-top: 4px;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .01em;
    color: #64748B;
    -webkit-user-select: none;
    user-select: none;
    transition: color .2s ease;
}
.ghu-tab .ghu-tab-icon {
    position: relative;
    width: 56px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: transform .15s ease, color .2s ease;
}
.ghu-tab:active .ghu-tab-icon { transform: scale(.88); }
.ghu-tab.is-active { color: var(--ghu-green-700); font-weight: 800; }
.ghu-tab.is-active .ghu-tab-icon { color: #fff; }
.ghu-tab:focus-visible { outline: none; }
.ghu-tab:focus-visible .ghu-tab-icon { box-shadow: 0 0 0 2px var(--ghu-gold-400); border-radius: 999px; }

/* Status dot on a tab (Grades: results locked, Fees: financial hold) */
.ghu-tab-dot {
    position: absolute;
    top: 3px;
    right: 12px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: #E11D48;
}
.ghu-tab-dot.is-warn { background: #F59E0B; }

@media (prefers-reduced-motion: reduce) {
    .ghu-tab-indicator, .ghu-tab .ghu-tab-icon { transition: none; }
}

/* Room for the floating tab bar so the last card is never hidden behind it */
.ghu-main {
    padding-bottom: calc(var(--ghu-tabbar-h) + env(safe-area-inset-bottom) + 30px);
}
@media (min-width: 768px) {
    .ghu-main { padding-bottom: 32px; }
}

/* ── Page progress bar ───────────────────────────────────────────────────── */
.ghu-progress {
    background: linear-gradient(90deg, var(--ghu-gold-400), var(--ghu-green-500));
}

/* ── Shared building blocks for student pages ────────────────────────────── */
.ghu-card {
    background: #fff;
    border: 1px solid rgba(30, 123, 52, .12);
    border-radius: 20px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 8px 24px -16px rgba(27, 42, 107, .25);
}

.ghu-btn-primary {
    background: var(--ghu-green-700);
    color: #fff;
}
.ghu-btn-primary:hover { background: #196A2C; }

/* Page title row */
.ghu-page-kicker {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--ghu-gold-400);   /* sits on the brand band */
}
.ghu-page-title {
    font-size: 22px;
    line-height: 1.2;
    font-weight: 900;
    letter-spacing: -.01em;
    color: #fff;                   /* sits on the brand band */
    margin: 0;
}
@media (min-width: 640px) { .ghu-page-title { font-size: 26px; } }

/* Round icon button (print, download …) */
.ghu-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #E2E8F0;
    color: #334155;
    cursor: pointer;
    transition: background-color .15s ease;
}
.ghu-icon-btn:hover { background: var(--ghu-green-50); color: var(--ghu-green-700); }

/* Section heading inside a page */
.ghu-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 800;
    color: #0F172A;
}

/* Brand hero card (balance, CGPA, attendance rate) */
.ghu-hero {
    border-radius: 22px;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .22);   /* stays distinct when it overlaps the band */
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(233, 196, 92, .28) 0%, transparent 45%),
        linear-gradient(135deg, var(--ghu-green-700) 0%, #17692B 55%, var(--ghu-blue-900) 130%);
    box-shadow: 0 10px 24px -12px rgba(30, 123, 52, .55);
}
.ghu-hero.is-due {
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(233, 196, 92, .30) 0%, transparent 45%),
        linear-gradient(135deg, #9F1239 0%, #7F1D1D 60%, var(--ghu-blue-900) 140%);
    box-shadow: 0 10px 24px -12px rgba(159, 18, 57, .55);
}

/* Horizontal chip scroller (semester filter, ledger filter) */
.ghu-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.ghu-chips::-webkit-scrollbar { display: none; }
.ghu-chip {
    flex: 0 0 auto;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    background: #fff;
    border: 1px solid #E2E8F0;
    color: #475569;
    cursor: pointer;
}
.ghu-chip.is-active {
    background: var(--ghu-green-700);
    border-color: var(--ghu-green-700);
    color: #fff;
}

/* Small stat tile */
.ghu-stat {
    background: #fff;
    border: 1px solid rgba(30, 123, 52, .12);
    box-shadow: 0 6px 18px -14px rgba(27, 42, 107, .3);
    border-radius: 16px;
    padding: 12px 14px;
}
.ghu-stat-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #94A3B8;
}
.ghu-stat-value {
    font-size: 20px;
    font-weight: 900;
    color: #0F172A;
    font-variant-numeric: tabular-nums;
}

/* Progress ring: set --pct (0–100) and --ring-color inline */
.ghu-ring {
    --pct: 0;
    --ring-color: var(--ghu-green-500);
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: conic-gradient(var(--ring-color) calc(var(--pct) * 1%), rgba(255, 255, 255, .22) 0);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.ghu-ring > span {
    width: 66px;
    height: 66px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(15, 50, 25, .55);
    font-weight: 900;
    font-size: 16px;
}

/* Progress bar */
.ghu-bar { height: 6px; border-radius: 999px; background: #E2E8F0; overflow: hidden; }
.ghu-bar > span { display: block; height: 100%; border-radius: 999px; }

/* Inside the Android app (html.in-app, set in the layout <head>): no Print / CSV download */
.in-app .ghu-web-only { display: none !important; }

/* <details> rows (Grades): no default triangle marker */
summary::-webkit-details-marker { display: none; }

/* List rows inside a card */
.ghu-list > * + * { border-top: 1px solid #EEF2EF; }

/* Blocks that exist only on paper (official headers, signatures) */
.print-only { display: none; }
@media print {
    .print-only { display: block !important; }
    .no-print { display: none !important; }
    body.ghu-student { background: #fff !important; }
    body.ghu-student::before { display: none !important; }
    .ghu-page-title { color: #0F172A !important; }
    .ghu-page-kicker { color: #1E7B34 !important; }
    .ghu-card, .ghu-stat { box-shadow: none !important; }
    .ghu-hero { color: #0F172A !important; background: #fff !important; border: 1px solid #CBD5E1; box-shadow: none !important; }
}

/* ── Privacy mode (Config/SecretTagHelper.cs + js/student-privacy.js) ──────
   html.privacy-on      → every <secret> shows its mask
   .ghu-secret.is-revealed → this one value was tapped open
   html.privacy-print   → printing / CSV export: always the real values        */
.privacy-on:not(.privacy-print) .ghu-secret:not(.is-revealed) .ghu-secret-value {
    display: none;
}
.privacy-on:not(.privacy-print) .ghu-secret:not(.is-revealed)::before {
    content: attr(data-mask);
    letter-spacing: .06em;
    opacity: .75;
}
.privacy-on .ghu-secret:not(.is-revealed) {
    cursor: pointer;
    border-radius: 6px;
}
.privacy-on .ghu-secret:not(.is-revealed):hover,
.privacy-on .ghu-secret:not(.is-revealed):focus-visible {
    background: rgba(30, 123, 52, .08);
    outline: none;
}

/* Hint shown only while data is hidden */
.ghu-privacy-hint { display: none; }
.privacy-on .ghu-privacy-hint { display: flex; }

/* Eye button icon state */
.ghu-eye .fa-eye { display: none; }
.privacy-on .ghu-eye .fa-eye { display: inline-block; }
.privacy-on .ghu-eye .fa-eye-slash { display: none; }

@media print {
    .ghu-appbar, .ghu-tabbar, .ghu-progress, .ghu-hold { display: none !important; }
    .ghu-main { padding: 0 !important; }
}
