/*
 * Look of jaipuriaalumni.ac.in, carried over so the app matches it.
 * The first part is the site's own inline CSS (same values), including its quirks: it overrides
 * --bs-primary and --bs-secondary but not --bs-link-color-rgb or the focus ring, so plain links and
 * focus glows stay Bootstrap blue just as they do on the live site.
 * The second part holds this app's own components, built from the same tokens.
 */

/* ---- site CSS ------------------------------------------------------------------------------ */
:root {
    --bs-primary: #521cb5;
    --bs-secondary: #f65904;
    --bs-body-bg: #ffffff;
    --bs-body-color: #212529;
    --bs-link-color: var(--bs-primary);
    --bs-link-hover-color: var(--bs-primary);
}

.bg-primary { background-color: var(--bs-primary) !important; }
.text-primary { color: var(--bs-primary) !important; }
.btn-primary { background-color: var(--bs-primary) !important; border-color: var(--bs-primary) !important; }
.btn-outline-primary { color: var(--bs-primary) !important; border-color: var(--bs-primary) !important; }
.btn-outline-primary:hover { background-color: var(--bs-primary) !important; color: white !important; }

body {
    font-family: 'Lato', sans-serif;
    color: var(--bs-body-color);
    background-color: var(--bs-body-bg);
    /* TopBar(40) + Branding(100) + DesktopMenu(40) */
    padding-top: 180px;
}

#main-header {
    position: fixed; top: 0; left: 0; width: 100%; z-index: 1030;
    background: var(--bs-body-bg);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    height: 180px;
}
.top-bar { height: 40px; background-color: var(--bs-secondary); color: white; font-size: 0.9rem; display: flex; align-items: center; }
.top-bar > .container { width: 100%; }
.branding-row { height: 100px; display: flex; align-items: center; transition: height 0.3s ease; background: var(--bs-body-bg); position: relative; }
.brand-logo { height: 80px; width: auto; transition: height 0.3s ease; }
.brand-text { font-size: 1.4rem; font-weight: bold; color: var(--bs-primary); line-height: 1.2; transition: font-size 0.3s ease; }

.desktop-menu-bar { height: 40px; background: rgba(0,0,0,0.85); backdrop-filter: blur(5px); display: flex; align-items: center; }
.desktop-menu-bar .container { height: 100%; display: flex; align-items: center; justify-content: flex-end; }
.desktop-menu-bar ul.nav { height: 100%; margin-bottom: 0 !important; display: flex; align-items: center; }
.desktop-menu-bar .nav-item { height: 100%; display: flex; align-items: center; }
.desktop-menu-bar .nav-link {
    height: 100%; display: flex; align-items: center;
    padding-top: 0 !important; padding-bottom: 0 !important; padding-left: 1rem; padding-right: 1rem;
    color: rgba(255,255,255,0.9); font-weight: 500; text-transform: uppercase; font-size: 0.85rem; letter-spacing: 0.5px;
    transition: color 0.2s, background-color 0.2s;
}
.desktop-menu-bar .nav-link:hover,
.desktop-menu-bar .nav-link:focus,
.desktop-menu-bar .nav-link.active { color: white; background-color: var(--bs-primary); }

.mobile-nav-toggle { color: var(--bs-body-color); border: 1px solid #ddd; padding: 5px 10px; border-radius: 5px; font-size: 1.5rem; background: transparent; }
#mobileMenuContainer { background: var(--bs-body-bg); border-top: 1px solid #eee; padding: 10px 0; box-shadow: 0 4px 6px rgba(0,0,0,0.05); }
.mobile-nav-link { padding: 10px 15px; display: block; color: var(--bs-body-color); font-weight: 500; text-decoration: none; border-bottom: 1px solid #f0f0f0; }
.mobile-nav-link.active { color: var(--bs-primary); font-weight: 700; }

#main-header.scrolled { height: 100px; }
#main-header.scrolled .top-bar { display: none; }
#main-header.scrolled .branding-row { height: 60px; }
#main-header.scrolled .brand-logo { height: 40px; }
#main-header.scrolled .brand-text { font-size: 1.1rem; }

@media (max-width: 768px) {
    body { padding-top: 140px; }
    #main-header { height: auto; }
    .branding-row { height: 80px; justify-content: space-between; }
    .brand-logo { height: 50px; }
    .brand-text { font-size: 1rem; }
}

label.required::after { content: " *"; color: red; }

#go-top {
    position: fixed; bottom: 30px; right: 30px; background: var(--bs-primary); color: white; width: 50px; height: 50px;
    border-radius: 50%; border: none; opacity: 0; pointer-events: none; transition: opacity 0.3s; font-size: 1.5rem; z-index: 1050;
}
#go-top.visible { opacity: 1; pointer-events: auto; }

/* ---- accessibility, motion and transitions ------------------------------------------------ */
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 3000; background: #212529; color: #fff; padding: 0.6rem 1rem; border-radius: 0.375rem; font-weight: 700; transition: top 0.15s; }
.skip-link:focus { top: 8px; color: #fff; }
/* Dark text on the orange bar: white on #f65904 is only 3.3:1, dark on it is 4.7:1 (WCAG AA needs 4.5:1). */
.top-bar-text { color: #212529; font-weight: 700; }
#main:focus { outline: none; }
:focus-visible { outline: 3px solid #0d6efd; outline-offset: 2px; }

/* Smooth cross-page transitions (native View Transitions API). Browsers without it navigate as usual. */
@view-transition { navigation: auto; }
#main-header { view-transition-name: site-header; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.22s; }
@media (prefers-reduced-motion: reduce) {
    ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
    html { scroll-behavior: auto !important; }
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---- app components ------------------------------------------------------------------------ */
.page-hero { background: #f8f9fa; padding: 3rem 0; }
.page-hero h1 { font-size: 2.5rem; }

.section-panel { background: #fff; padding: 1.5rem; border-radius: 0.375rem; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.section-title { font-weight: 700; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid #dee2e6; }

.stat-tile { background: #fff; border-radius: 0.375rem; box-shadow: 0 2px 4px rgba(0,0,0,0.05); padding: 1rem 1.25rem; height: 100%; }
.stat-tile .stat-value { font-size: 2rem; font-weight: 700; line-height: 1.1; color: var(--bs-primary); }
.stat-tile .stat-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; color: rgba(33,37,41,0.75); font-weight: 700; }
.stat-tile .stat-note { font-size: 0.85rem; color: rgba(33,37,41,0.75); }

.form-step-title { color: var(--bs-primary); font-weight: 400; }
.form-section + .form-section { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid #f0f0f0; }

.lookup-results { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin-top: 2px; max-height: 340px; overflow: auto; box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15); }
.lookup-results .list-group-item { cursor: pointer; }
.lookup-results .list-group-item:hover, .lookup-results .list-group-item.active-option { background: var(--bs-primary); color: #fff; }
.lookup-results .list-group-item:hover .text-muted, .lookup-results .list-group-item.active-option .text-muted { color: rgba(255,255,255,0.8) !important; }

.choice-card { border: 1px solid #dee2e6; border-radius: 0.375rem; padding: 0.75rem 1rem; cursor: pointer; height: 100%; }
.choice-card:hover { border-color: var(--bs-primary); }
.choice-card.selected { border-color: var(--bs-primary); background: rgba(82,28,181,0.05); }

.avatar { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; background: rgba(82,28,181,0.1); color: var(--bs-primary); font-weight: 700; display: flex; align-items: center; justify-content: center; }
.attendee-card .card-title { font-size: 1rem; }
.min-w-0 { min-width: 0; }

.reason-chip { font-size: 0.72rem; font-weight: 700; padding: 0.3em 0.6em; border-radius: 0.375rem; background: rgba(82,28,181,0.1); color: var(--bs-primary); display: inline-block; }
.cab-chip-offer { background: #198754; }
.cab-chip-need { background: #0dcaf0; color: #212529; }

.bar-row { display: grid; grid-template-columns: minmax(90px, 32%) 1fr auto; gap: 0.75rem; align-items: center; font-size: 0.9rem; margin-bottom: 0.4rem; }
.bar-row .bar-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { background: #e9ecef; height: 10px; border-radius: 5px; overflow: hidden; }
.bar-fill { background: var(--bs-primary); height: 100%; border-radius: 5px; }
.bar-value { font-weight: 700; min-width: 2.5rem; text-align: right; }
.bar-sub { color: rgba(33,37,41,0.75); font-size: 0.78rem; font-weight: 400; }

.heat-table th, .heat-table td { font-size: 0.85rem; white-space: nowrap; }
.heat-table td.heat-cell { text-align: center; min-width: 64px; }
.timeline-svg { width: 100%; height: 90px; }

.table > :not(caption) > * > * { vertical-align: middle; }
.admin-filters .form-label { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: rgba(33,37,41,0.75); margin-bottom: 0.25rem; }
/* The site forces outline-primary text to purple, which turns the checked state unreadable; fix it for toggles and pills. */
.btn-check:checked + .btn-outline-primary,
.btn-outline-primary.active { background-color: var(--bs-primary) !important; border-color: var(--bs-primary) !important; color: #fff !important; }
.nav-pills .nav-link.active { background-color: var(--bs-primary); color: #fff; }
.nav-pills .nav-link { color: var(--bs-primary); }
.nav-tabs .nav-link { color: var(--bs-body-color); }
.nav-tabs .nav-link.active { color: var(--bs-primary); font-weight: 700; }

@media (max-width: 768px) {
    .page-hero { padding: 2rem 0; }
    .page-hero h1 { font-size: 1.75rem; }
    .section-panel { padding: 1rem; }
    .bar-row { grid-template-columns: minmax(70px, 38%) 1fr auto; }
}

/* ---- UX improvements ------------------------------------------------------------------------ */

/* Multi-step form (same pattern as the alumni site's registration) */
.form-step { display: none; }
.form-step.active { display: block; }
.profile-summary { background: #f8f9fa; border-radius: 0.5rem; padding: 1rem; margin-bottom: 1rem; }

/* Loading state for buttons: instant feedback that something is happening (Doherty threshold) */
.btn-loading .btn-spinner { display: none; width: 1em; height: 1em; margin-left: 0.6rem; border: 2px solid rgba(255,255,255,0.5); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; vertical-align: -0.15em; }
.btn-loading.is-loading .btn-spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Skeleton placeholders: the shape of the content appears at once, so the page never feels empty */
.skeleton { position: relative; overflow: hidden; background: #e9ecef; border-radius: 0.375rem; }
.skeleton::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.65), transparent); transform: translateX(-100%); animation: skeleton 1.3s infinite; }
@keyframes skeleton { to { transform: translateX(100%); } }
.skeleton-line { height: 0.9rem; margin-bottom: 0.6rem; }
.skeleton-line.w-60 { width: 60%; } .skeleton-line.w-40 { width: 40%; } .skeleton-line.w-80 { width: 80%; }
.skeleton-card { background: #fff; border-radius: 0.375rem; box-shadow: 0 2px 4px rgba(0,0,0,0.075); padding: 1rem; height: 100%; }
.skeleton-circle { width: 44px; height: 44px; border-radius: 50%; }

/* Bigger touch targets for icon buttons on touch screens (Fitts's law: at least 44 x 44 px) */
.btn-contact { min-width: 36px; min-height: 36px; display: inline-flex; align-items: center; justify-content: center; }
@media (pointer: coarse) {
    .btn-contact { min-width: 44px; min-height: 44px; font-size: 1.05rem; }
    .chip, .nav-pills .nav-link, .btn-sm { min-height: 40px; }
    .form-check-input { width: 1.25rem; height: 1.25rem; }
    /* The orange bar grows with its button so the button sits inside it, not on its edges */
    .top-bar { height: 52px; }
    .top-bar .btn-sm { min-height: 40px; display: inline-flex; align-items: center; }
}

/* Applied-filter chips: what is filtered is always visible, and one tap removes it (recognition over recall) */
.filter-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.75rem; }
.filter-chip { display: inline-flex; align-items: center; gap: 0.35rem; background: rgba(82,28,181,0.1); color: var(--bs-primary); border: 0; border-radius: 999px; padding: 0.3rem 0.4rem 0.3rem 0.8rem; font-size: 0.85rem; font-weight: 700; min-height: 32px; }
.filter-chip .x { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: rgba(82,28,181,0.15); font-size: 0.8rem; }
.filter-chip:hover .x { background: var(--bs-primary); color: #fff; }

/* Welcome panel after registering (peak-end rule: end on a high, then say what to do next) */
.welcome-panel { position: relative; background: linear-gradient(135deg, #1b0a3d, #521cb5); color: #fff; border-radius: 0.8rem; padding: 1.6rem; margin-bottom: 1.5rem; overflow: hidden; }
.welcome-panel h2 { font-weight: 700; }
.welcome-panel .burst-anchor { position: absolute; left: 3rem; top: 3rem; width: 1px; height: 1px; }
.next-steps { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: 0.5rem; }
.next-steps li { display: flex; align-items: center; gap: 0.75rem; background: rgba(255,255,255,0.1); border-radius: 0.6rem; padding: 0.6rem 0.9rem; }
.next-steps li.done { background: rgba(25,135,84,0.35); }
.next-steps .tick { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.6); display: grid; place-items: center; flex: 0 0 auto; }
.next-steps li.done .tick { background: #198754; border-color: #198754; }
.next-steps a { color: #fff; font-weight: 700; text-decoration: underline; }
.welcome-progress { height: 6px; background: rgba(255,255,255,0.25); border-radius: 3px; overflow: hidden; margin-top: 0.6rem; }
.welcome-progress > div { height: 100%; background: #f65904; transition: width 0.5s ease; }

/* A person in the cab lists: avatar, details, contact buttons. On a phone the buttons drop to their own line under the details,
   so the details keep a readable width instead of being squeezed to a sliver. */
.person-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; padding: 0.5rem 0; border-bottom: 1px solid #dee2e6; }
.person-main { flex: 1 1 13rem; min-width: 0; overflow-wrap: anywhere; }
.person-actions { flex: 0 0 auto; white-space: nowrap; }
@media (max-width: 575px) { .person-actions { flex-basis: 100%; padding-left: calc(44px + 1rem); } }
