/* ===================================================================
   BGCSA - Site Stylesheet
   Clean, modern design aligned with the Boys & Girls Clubs of
   South Africa brand guidelines.

   Brand colours:
     Dark blue   #151f6d  (primary - navbar, table headers)
     Yellow      #fab900  (accent - primary CTAs, highlights)
     Pink        #be2585  (secondary accent, hover/links)
     Light blue  #68a9d3  (soft accents, focus, row hover)
   =================================================================== */

:root {
    --bgcsa-dark-blue: #151f6d;
    --bgcsa-dark-blue-hover: #0f1650;
    --bgcsa-yellow: #fab900;
    --bgcsa-yellow-hover: #e0a600;
    --bgcsa-pink: #be2585;
    --bgcsa-pink-hover: #99206c;
    --bgcsa-light-blue: #68a9d3;
    --bgcsa-light-blue-soft: #eaf3fa;
}

/* --- Navbar --- */
.navbar-portal {
    background-color: var(--bgcsa-dark-blue);
    padding-top: 0;
    padding-bottom: 0;
    min-height: 46px;
}

.navbar-portal-brand {
    color: var(--bgcsa-yellow) !important;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    padding: 10px 16px 10px 0;
}

.navbar-portal-brand:hover {
    color: #ffcf3d !important;
}

.navbar-portal-link {
    color: rgba(255, 255, 255, 0.85) !important;
    font-size: 0.9rem;
    padding: 14px 12px !important;
    white-space: nowrap;
}

.navbar-portal-link:hover,
.navbar-portal-link:focus {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.08);
}

.navbar-portal .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.3);
}

.navbar-portal .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-portal-dropdown {
    background-color: var(--bgcsa-dark-blue);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    min-width: 160px;
    padding: 4px 0;
    margin-top: 0 !important;
}

.navbar-portal-dropdown-item {
    color: rgba(255, 255, 255, 0.85) !important;
    font-size: 0.875rem;
    padding: 8px 16px;
}

.navbar-portal-dropdown-item:hover,
.navbar-portal-dropdown-item:focus {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.1);
}

.navbar-portal-dropdown .dropdown-divider {
    border-color: rgba(255, 255, 255, 0.15);
}

/* --- Base --- */
html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    margin-bottom: 60px;
    font-family: "Trebuchet MS", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f8f9fa;
    color: #333;
}

/* --- Headings: bold, near-black navy per brand --- */
h1, h2, h3, h4, h5, h6 {
    color: #10152e;
    font-weight: 700;
}

/* Page heading accent: short brand-yellow rule under the title */
h4 + hr {
    border: none;
    border-top: 3px solid var(--bgcsa-yellow);
    opacity: 1;
    width: 60px;
    margin-top: 0.35rem;
    margin-bottom: 1rem;
}

/* --- Links --- */
a {
    color: var(--bgcsa-dark-blue);
}

a:hover {
    color: var(--bgcsa-pink);
}

/* --- Focus Styles --- */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--bgcsa-light-blue);
}

.form-control:focus, .form-check-input:focus {
    border-color: var(--bgcsa-light-blue);
}

.form-check-input:checked {
    background-color: var(--bgcsa-dark-blue);
    border-color: var(--bgcsa-dark-blue);
}

/* --- Attendance radio buttons --- */
.attendance-radio {
    width: 1.15rem;
    height: 1.15rem;
    cursor: pointer;
    vertical-align: middle;
    margin-top: 0;
}

.attendance-radio + label {
    padding-left: 0.35rem;
    vertical-align: middle;
    cursor: pointer;
}

/* --- Buttons --- */
/* Primary button - the brand yellow CTA (1 Primary, rest Secondary) */
.btn-primary {
    color: var(--bgcsa-dark-blue);
    background-color: var(--bgcsa-yellow);
    border-color: var(--bgcsa-yellow);
    font-weight: 600;
}

.btn-primary:hover {
    color: var(--bgcsa-dark-blue);
    background-color: var(--bgcsa-yellow-hover);
    border-color: var(--bgcsa-yellow-hover);
}

.btn-primary:active, .btn-primary:focus {
    color: var(--bgcsa-dark-blue);
    background-color: var(--bgcsa-yellow-hover);
    border-color: var(--bgcsa-yellow-hover);
}

/* Secondary button - use for all other actions */
.btn-secondary {
    color: #333;
    background-color: #f0f0f0;
    border-color: #ccc;
}

.btn-secondary:hover {
    color: #333;
    background-color: #e0e0e0;
    border-color: #adadad;
}

.btn-secondary:active, .btn-secondary:focus {
    background-color: #d4d4d4;
    border-color: #8c8c8c;
}

/* Danger button */
.btn-danger {
    color: #fff;
    background-color: #d9534f;
    border-color: #d43f3a;
}

.btn-danger:hover {
    color: #fff;
    background-color: #c9302c;
    border-color: #ac2925;
}

/* Outline button in brand dark blue - optional supporting action */
.btn-outline-primary {
    color: var(--bgcsa-dark-blue);
    border-color: var(--bgcsa-dark-blue);
}

.btn-outline-primary:hover {
    color: #fff;
    background-color: var(--bgcsa-dark-blue);
    border-color: var(--bgcsa-dark-blue);
}

/* Button transition for smooth hover effect + slightly rounded, modern feel */
.btn {
    transition: all 0.2s ease-in-out;
    border-radius: 6px;
}

/* --- Layout --- */
.border-top {
    border-top: 1px solid #e5e5e5;
}

.border-bottom {
    border-bottom: 1px solid #e5e5e5;
}

.box-shadow {
    box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
}

.footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    white-space: nowrap;
    line-height: 60px;
    font-size: 0.85rem;
}

/* --- Navbar --- */
.navbar-brand {
    white-space: normal;
    display: flex;
    align-items: center;
}

.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
    color: #fff;
    background-color: var(--bgcsa-dark-blue);
    border-color: var(--bgcsa-dark-blue);
}

/* --- Tables --- */
.table {
    font-size: 0.8rem;
    border-collapse: collapse;
    margin-bottom: 0;
}

/* Table header - brand dark blue, bold, tight */
.table thead th {
    background-color: var(--bgcsa-dark-blue);
    color: #fff;
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border: none;
    padding: 8px 10px;
    vertical-align: middle;
    white-space: nowrap;
}

.table thead th a {
    color: #fff;
    text-decoration: none;
}

.table thead th a:hover {
    color: var(--bgcsa-yellow);
    text-decoration: underline;
}

/* Body rows — compact, clean */
.table tbody td {
    padding: 5px 10px;
    vertical-align: middle;
    border-top: 1px solid #e8eaed;
    border-bottom: none;
    color: #333;
}

/* Stripe: disabled — all rows white */
.table-striped > tbody > tr:nth-of-type(odd) > *,
.table-striped > tbody > tr:nth-of-type(even) > * {
    background-color: #ffffff;
}

/* Hover: soft brand light-blue highlight */
.table-hover > tbody > tr:hover > * {
    background-color: var(--bgcsa-light-blue-soft) !important;
    color: #111;
}

/* Wrap the table for a card-like border */
.table-responsive,
.table-wrapper {
    border: 1px solid #d0d4da;
    border-radius: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Keep the Yes/No attendance radios on a single line so they don't wrap on mobile */
.attendance-radio + label,
.form-check-inline {
    white-space: nowrap;
}

/* Mobile tweaks for ClubManagement / attendance screens */
@media (max-width: 575.98px) {
    .badge.fs-6 {
        font-size: 0.8rem !important;
    }

    .table-sm th,
    .table-sm td {
        padding: 0.35rem 0.4rem;
    }
}

/* Sortable table styles */
.sortable th {
    cursor: pointer;
    position: relative;
    user-select: none;
}

.sortable th:hover {
    background-color: var(--bgcsa-dark-blue-hover);
}

.sortable th::after {
    content: '\2195';
    position: absolute;
    right: 8px;
    opacity: 0.35;
    font-size: 0.7rem;
}

.sortable th.sort-asc::after {
    content: '\2191';
    opacity: 1;
}

.sortable th.sort-desc::after {
    content: '\2193';
    opacity: 1;
}

/* No-sort column: hide the sort indicator */
.sortable th.no-sort {
    cursor: default;
}

.sortable th.no-sort::after {
    content: '';
}

/* --- Action Links in Tables --- */
.table-action-link {
    color: var(--bgcsa-dark-blue);
    text-decoration: none;
    font-size: 0.78rem;
    white-space: nowrap;
}

.table-action-link:hover {
    color: var(--bgcsa-pink);
    text-decoration: underline;
}

.table-action-delete {
    color: #c0392b;
}

.table-action-delete:hover {
    color: #922b21;
}

/* --- Action Icons in Tables --- */
.action-icon {
    width: 18px;
    height: 18px;
    margin: 0 4px;
    opacity: 0.7;
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.action-icon:hover {
    opacity: 1;
    transform: scale(1.15);
}

/* --- Cards --- */
.card {
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

/* --- Forms --- */
.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* --- Alerts --- */
.alert {
    font-size: 0.9rem;
}

/* --- Login Page --- */
.login-container {
    max-width: 400px;
    margin: 0 auto;
}