/* HHB Theme 1: Blue + Green */

:root {
    --hhb-primary: #0066cc;
    --hhb-accent: #00b386;
    --hhb-danger: #cc0033;
    --hhb-dark: #1a1a1a;
    --hhb-light: #f8f9fa;
}

/* Navbar */
.hhb-navbar {
    background: var(--hhb-dark);
}

/* Links */
a {
    color: var(--hhb-primary);
}
a:hover {
    color: var(--hhb-accent);
}

/* Headings */
h1, h2, h3 {
    color: var(--hhb-dark);
}

/* Cards / panels */
.hhb-card {
    border-radius: 0.5rem;
    border: 1px solid #e0e0e0;
    background: #ffffff;
}

/* Buttons */
.btn-hhb-primary {
    background-color: var(--hhb-primary);
    border-color: var(--hhb-primary);
}
.btn-hhb-primary:hover {
    background-color: #0052a3;
    border-color: #0052a3;
}

.btn-hhb-accent {
    background-color: var(--hhb-accent);
    border-color: var(--hhb-accent);
}
.btn-hhb-accent:hover {
    background-color: #00946e;
    border-color: #00946e;
}

/* Tables */
.table thead.table-dark {
    background-color: var(--hhb-dark);
}

/* Utility spacing tweaks */
.page-title {
    margin-bottom: 1.5rem;
}

/* --- Homepage help accordion --- */
.hhb-help-accordion .accordion-item {
    border: 1px solid #e0e0e0;
    margin-bottom: 0.5rem;
    border-radius: 0.5rem;
    overflow: hidden;
}
.hhb-help-accordion .accordion-item:last-child {
    margin-bottom: 0;
}
.hhb-help-accordion .accordion-button {
    font-weight: 600;
    color: var(--hhb-dark);
    background-color: #ffffff;
}
.hhb-help-accordion .accordion-button:not(.collapsed) {
    color: #ffffff;
    background-color: var(--hhb-primary);
    box-shadow: none;
}
.hhb-help-accordion .accordion-button:not(.collapsed)::after {
    filter: brightness(0) invert(1);
}
.hhb-help-accordion .accordion-button:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 179, 134, 0.35);
    border-color: var(--hhb-accent);
}
.hhb-help-accordion .accordion-body {
    background-color: var(--hhb-light);
}
.hhb-help-accordion .accordion-body a {
    display: inline-block;
    margin-top: 0.4rem;
    font-weight: 600;
    color: var(--hhb-accent);
    text-decoration: none;
}
.hhb-help-accordion .accordion-body a:hover {
    color: #00946e;
    text-decoration: underline;
}
.hhb-help-toggle-icon {
    margin-right: 0.5rem;
}
.hhb-help-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem 1.5rem;
}
@media (max-width: 767.98px) {
    .hhb-help-list {
        grid-template-columns: 1fr;
    }
}
.hhb-help-item {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}
.hhb-help-icon {
    font-size: 1.4rem;
    line-height: 1;
    flex-shrink: 0;
}

/* --- Dashboard hero banner --- */
.hhb-hero-banner {
    border-radius: 0.75rem;
    overflow: hidden;
    max-width: 1100px;
    margin: 0 auto;
    aspect-ratio: 3.5 / 1;
    max-height: 420px;
    background-size: cover;
    background-position: center 42%;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}
.hhb-welcome .page-title {
    margin-bottom: 0.25rem;
}

/* --- About Us club photo --- */
.hhb-about-photo {
    width: 100%;
    aspect-ratio: 4 / 1;
    max-height: 420px;
    object-fit: cover;
    object-position: center 35%;
}

/* --- About Us collapsible sections --- */
.hhb-about-accordion .accordion-item {
    border: 1px solid #e0e0e0;
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 1rem;
}
.hhb-about-accordion .accordion-item:last-child {
    margin-bottom: 0;
}
.hhb-about-accordion .accordion-button {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--hhb-primary);
    background-color: #ffffff;
    box-shadow: none;
}
.hhb-about-accordion .accordion-button:not(.collapsed) {
    color: var(--hhb-primary);
    background-color: #ffffff;
    box-shadow: inset 0 -1px 0 #e0e0e0;
}
.hhb-about-accordion .accordion-button:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 179, 134, 0.35);
}

/* --- Feedback --- */
.bg-hhb-primary {
    background-color: var(--hhb-primary) !important;
}

/* Modal header in HHB blue */
.hhb-modal-header {
    background-color: var(--hhb-primary);
    border-bottom: none;
}

/* Persistent, non-intrusive feedback button (bottom-right on every page) */
.feedback-fab {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1040;
    border-radius: 2rem;
    padding: 0.5rem 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* --- Knockout bracket --- */
.bracket {
    display: flex;
    align-items: stretch;
    overflow-x: auto;
    padding: 1rem 0;
    gap: 0;
}

.bracket-round {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    min-width: 250px;
    padding: 0 1.5rem;
    position: relative;
}

.bracket-round-title {
    text-align: center;
    font-weight: 600;
    color: var(--hhb-dark);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.bracket-match {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.4rem;
    margin: 0.6rem 0;
    position: relative;
    font-size: 0.85rem;
}

.bracket-match::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -1.5rem;
    width: 1.5rem;
    height: 1px;
    background: #adb5bd;
}

.bracket-round:last-child .bracket-match::after {
    display: none;
}

.bracket-team {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.35rem 0.6rem;
    border-bottom: 1px solid #f1f1f1;
}
.bracket-team:last-child {
    border-bottom: none;
}

.bracket-team span:first-child {
    overflow-wrap: anywhere;
    min-width: 0;
}

.bracket-team.winner {
    font-weight: 700;
    color: var(--hhb-accent);
}

.bracket-sets {
    color: #6c757d;
    font-size: 0.78rem;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.podium-card {
    border-radius: 0.5rem;
    border: none;
    text-align: center;
    padding: 1rem;
}
.podium-gold { background: linear-gradient(135deg, #fff7e0, #ffe9a8); }
.podium-silver { background: linear-gradient(135deg, #f4f6f7, #e2e6e9); }
.podium-bronze { background: linear-gradient(135deg, #fbe9dd, #f1c9a8); }

/* Podium cards / index rows that have a photo or are admin-editable */
.podium-card { position: relative; }
.podium-has-photo {
    cursor: pointer;
}
.podium-has-photo:hover {
    filter: brightness(0.96);
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.podium-cam {
    font-size: 0.75rem;
    opacity: 0.6;
    margin-left: 2px;
}

/* Sticky table: frozen header row + frozen first two columns (Date, Day) */
.sticky-table-wrapper {
    max-height: 82vh;
    overflow: auto;
    position: relative;
}

.sticky-table-wrapper table {
    margin-bottom: 0;
}

/* Frozen header row */
.sticky-table-wrapper thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: var(--hhb-dark);
    color: #fff;
}

/* Frozen first column (Date) - sized to just fit "DD-Mon", not a fixed
   wide column, so the freed-up width goes to the other columns */
.sticky-table-wrapper th:nth-child(1),
.sticky-table-wrapper td:nth-child(1) {
    position: sticky;
    left: 0;
    z-index: 1;
    background-color: #ffffff;
    width: 1%;
    white-space: nowrap;
}

/* Frozen second column (Day) - sized to just fit the 3-letter day abbreviation.
   The left offset is set a few px *under* the Date column's measured width
   on purpose: rounding up leaves a hairline gap (varies by device pixel
   ratio) that exposes whatever's scrolling underneath during a horizontal
   scroll. Rounding down instead means a tiny overlap into the Date column's
   own padding, which is invisible. */
.sticky-table-wrapper th:nth-child(2),
.sticky-table-wrapper td:nth-child(2) {
    position: sticky;
    left: 64px;
    z-index: 1;
    background-color: #ffffff;
    width: 1%;
    white-space: nowrap;
}

/* Confirmed column ("Σ") - data is at most 2 digits, so keep it tight too */
.sticky-table-wrapper th:nth-child(5),
.sticky-table-wrapper td:nth-child(5) {
    width: 1%;
    white-space: nowrap;
    text-align: center;
}

/* Top-left frozen header cells need to sit above both header and column layers */
.sticky-table-wrapper thead th:nth-child(1),
.sticky-table-wrapper thead th:nth-child(2) {
    z-index: 3;
    background-color: var(--hhb-dark);
}

/* Keep frozen column readable on hover/striped rows */
.sticky-table-wrapper tbody tr:nth-of-type(odd) td:nth-child(1),
.sticky-table-wrapper tbody tr:nth-of-type(odd) td:nth-child(2) {
    background-color: #f8f9fa;
}
.sticky-table-wrapper tbody tr:hover td:nth-child(1),
.sticky-table-wrapper tbody tr:hover td:nth-child(2) {
    background-color: #eaeaea;
}

/* Make tables use full available width on small/landscape screens */
@media (max-width: 991px) {
    .table-responsive {
        width: 100%;
    }
    .table {
        width: 100%;
        font-size: 0.9rem;
    }
    .table th, .table td {
        padding: 0.5rem 0.6rem;
        white-space: nowrap;
    }
    /* Date column is narrower at this font-size, so the Day column's sticky
       offset needs its own value here too (see the desktop rule above for
       why it's intentionally a few px under the measured Date width) */
    .sticky-table-wrapper th:nth-child(2),
    .sticky-table-wrapper td:nth-child(2) {
        left: 62px;
    }
}

/* ---- Photo lightbox navigation buttons ----
   Translucent circular arrows that sit lightly over the image rather than
   blocking it. On touch/small screens they fade right back so the photo is
   unobstructed; swipe and tap-to-toggle (see gallery JS) drive navigation. */
.lightbox-nav {
    z-index: 10;
    border: none;
    color: #fff;
    background-color: rgba(0, 0, 0, 0.45);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.25s ease, background-color 0.2s ease;
}
.lightbox-nav:hover,
.lightbox-nav:focus {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.65);
    color: #fff;
}
@media (max-width: 575px) {
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 1.15rem;
        background-color: rgba(0, 0, 0, 0.3);
        opacity: 0.4;
    }
    /* Tapping the photo adds .nav-hidden to take the arrows fully out of view */
    .nav-hidden .lightbox-nav {
        opacity: 0;
        pointer-events: none;
    }
}

/* Committee cards (About page) */
.committee-card {
    border-top: 4px solid var(--hhb-primary);
    position: relative;
}
.committee-card.founder {
    border-top-color: var(--hhb-accent);
}
.committee-roster-no {
    position: absolute;
    top: 14px;
    left: 16px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #8c9ba1;
}
.committee-photo-frame {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--hhb-light);
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px var(--hhb-primary);
    flex-shrink: 0;
}
.committee-card.founder .committee-photo-frame {
    box-shadow: 0 0 0 2px var(--hhb-accent);
}
.committee-photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Bias the crop toward the top third and scale up so the face fills the
       circle rather than a wider head-and-shoulders shot. */
    object-position: center 20%;
    transform: scale(1.35);
    display: block;
}
.committee-initials {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--hhb-primary);
}
.committee-badge {
    color: var(--hhb-accent);
}
.committee-card.founder .committee-badge {
    color: #b4832b;
}