/*
 * Volleyball Payment Tracker Pro — Frontend Styles v3
 * Primary:  #4a9ed7  (blue)
 * Dark nav: #0e3178  (deep navy)
 * UK spelling throughout
 */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&display=swap');

/* ─── Reset ─────────────────────────────────────────────────── */
.vpt-frontend *,
.vpt-frontend *::before,
.vpt-frontend *::after { box-sizing: border-box; margin: 0; padding: 0; }

.vpt-frontend {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #0e3178;
    background: #f4f7fa;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 32px rgba(14,49,120,.12);
    max-width: 1000px;
    margin: 0 auto 40px;
}

/* ─── Flash messages (shown after PRG redirect) ─────────────── */
.vpt-flash {
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 500;
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 10px;
}
.vpt-flash::before { font-size: 18px; }
.vpt-flash--success { background:#edfaf3; color:#1a7a45; border-color:#27ae60; }
.vpt-flash--error   { background:#fef2f2; color:#991b1b; border-color:#e74c3c; }
.vpt-flash--info    { background:#eff6ff; color:#1e40af; border-color:#4a9ed7; }
.vpt-flash--success::before { content: '✓'; }
.vpt-flash--error::before   { content: '✗'; }
.vpt-flash--info::before    { content: 'i'; font-style:italic; font-weight:700; }

/* ─── Top Navigation ────────────────────────────────────────── */
.vpt-topbar {
    background: #0e3178;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 14px 8px 0;
    flex-wrap: wrap;
    gap: 6px;
}

.vpt-topbar__brand {
    color: #fff;
    font-weight: 800;
    font-size: 20px;
    letter-spacing: -.3px;
    padding: 0 8px 10px;
    flex-shrink: 0;
}

.vpt-topbar__nav {
    display: flex;
    align-items: stretch;
    gap: 2px;
    flex-wrap: nowrap;
}

/* ── Divi-style tabs: rounded top, flat bottom, active merges with content ── */
.vpt-tab-link {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: rgba(255,255,255,.7);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    padding: 10px 22px;
    border-radius: 8px 8px 0 0;
    background: rgba(255,255,255,.1);
    transition: background .18s, color .18s;
    white-space: nowrap;
}

.vpt-tab-link:hover {
    background: rgba(255,255,255,.2);
    color: rgba(255,255,255,.9);
}

.vpt-tab-link.active {
    background: #f4f7fa;
    color: #0e3178;
}

.vpt-tab-link--cta {
    background: rgba(74,158,215,.35);
    color: #fff !important;
}
.vpt-tab-link--cta:hover { background: rgba(74,158,215,.55); }
.vpt-tab-link--cta.active {
    background: #f4f7fa;
    color: #0e3178 !important;
}

.vpt-tab-link--admin {
    background: rgba(251,191,36,.15);
    color: rgba(255,255,255,.8) !important;
}
.vpt-tab-link--admin:hover {
    background: rgba(251,191,36,.28);
    color: #fff !important;
}
.vpt-tab-link--admin.active {
    background: #f4f7fa;
    color: #b45309 !important;
}

/* ─── Admin sub-nav ─────────────────────────────────────────── */
.vpt-admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 0 20px;
    border-bottom: 2px solid #edf0f7;
    margin-bottom: 24px;
    align-items: center;
    justify-content: center;
}

.vpt-admin-nav__label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: #8a9bab;
    margin-right: 4px;
}

.vpt-admin-nav__link {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #5a6a84;
    text-decoration: none;
    background: #fff;
    border: 1.5px solid #d8dce8;
    transition: all .18s;
    box-shadow: 0 1px 3px rgba(14,49,120,.06);
}

.vpt-admin-nav__link:hover {
    background: #f0f4ff;
    border-color: #4a9ed7;
    color: #0e3178;
}

.vpt-admin-nav__link.active {
    background: #0e3178;
    border-color: #0e3178;
    color: #fff;
    box-shadow: 0 2px 8px rgba(14,49,120,.20);
}

/* ─── Tab body ──────────────────────────────────────────────── */
.vpt-tab-body { padding: 32px 28px; }

/* ─── Section title ─────────────────────────────────────────── */
.vpt-section-title { margin-bottom: 24px; }
.vpt-section-title h2 { font-size: 26px; font-weight: 700; color: #0e3178; letter-spacing: -.4px; }

.vpt-admin-section-title {
    font-size: 24px;
    font-weight: 800;
    color: #0e3178;
    letter-spacing: -.3px;
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #edf0f7;
}
.vpt-admin-section-title .vpt-count {
    font-size: 14px;
    font-weight: 600;
    color: #8a9bab;
    margin-left: 8px;
}
.vpt-section-title p { color: #5a6a84; font-size: 15px; margin-top: 4px; }
.vpt-section-title a { color: #4a9ed7; font-weight: 600; }

/* ─── Stats row ─────────────────────────────────────────────── */
.vpt-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.vpt-stat-mini {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 4px 16px rgba(14,49,120,.09);
    border-top: 3px solid var(--c, #4a9ed7);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.vpt-stat-mini__val {
    font-size: 32px;
    font-weight: 700;
    color: var(--c, #4a9ed7);
    line-height: 1;
    letter-spacing: -1px;
}

.vpt-stat-mini__lbl {
    font-size: 12px;
    font-weight: 600;
    color: #8a9bab;
    text-transform: uppercase;
    letter-spacing: .5px;
}

/* ─── Game row ──────────────────────────────────────────────── */
.vpt-games-list { display: flex; flex-direction: column; gap: 20px; }

.vpt-game-row {
    background: #fff;
    border-radius: 16px;
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    box-shadow: 0 4px 16px rgba(14,49,120,.09);
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
}

.vpt-game-row:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(14,49,120,.14); }

.vpt-game-row__colour-bar {
    order: 0;
    width: 100%;
    height: 6px;
    flex-shrink: 0;
    background: var(--gc, #4a9ed7);
}

.vpt-game-row__date {
    order: 1;
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 20px;
    background: rgba(74,158,215,.12);
    border-bottom: 1px solid rgba(74,158,215,.18);
    flex-shrink: 0;
}

.vpt-game-row__day {
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    color: #4a9ed7;
    letter-spacing: 1px;
}

.vpt-game-row__num {
    font-size: 34px;
    font-weight: 800;
    color: #0e3178;
    line-height: 1;
}

.vpt-game-row__mon {
    font-size: 14px;
    font-weight: 800;
    color: #4a9ed7;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.vpt-game-row__info {
    order: 2;
    flex: 1;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    justify-content: center;
}

.vpt-game-row__type { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.vpt-fe-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.vpt-fe-badge--booked { background: #edfaf3; color: #1a7a45; }
.vpt-fe-badge--full   { background: #fef2f2; color: #c0392b; }

.vpt-game-row__details {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 13px;
    color: #5a6a84;
    font-weight: 500;
}

.vpt-game-row__desc { font-size: 13px; color: #9aa5b4; font-style: italic; }

.vpt-capacity-bar-thin { height: 4px; background: #edf0f7; border-radius: 2px; overflow: hidden; margin-top: 4px; }
.vpt-capacity-bar-thin div { height: 100%; border-radius: 2px; transition: width .4s ease; }

.vpt-game-row__action {
    order: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 20px;
    min-width: 150px;
    border-left: 1px solid #edf0f7;
    gap: 8px;
}

/* ─── Buttons ───────────────────────────────────────────────── */
.vpt-fe-btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: all .2s;
    text-align: center;
    white-space: nowrap;
}

.vpt-fe-btn--book {
    background: #4a9ed7;
    color: #fff;
    box-shadow: 0 2px 8px rgba(74,158,215,.30);
}
.vpt-fe-btn--book:hover {
    background: #3a7eb7;
    box-shadow: 0 4px 12px rgba(74,158,215,.40);
    transform: translateY(-1px);
    color: #fff;
}

.vpt-fe-btn--secondary {
    background: #edf0f7;
    color: #0e3178;
    border: 1px solid #d8dce8;
}
.vpt-fe-btn--secondary:hover { background: #d8dce8; color: #0e3178; }

.vpt-fe-btn--waitlist { background: #fff3e0; color: #e67e22; border: 1px solid #f0c070; }
.vpt-fe-btn--waitlist:hover { background: #ffe0b2; }

.vpt-fe-btn--ghost { background: transparent; color: #e74c3c; border: 1px solid #fca5a5; font-size: 13px; padding: 7px 14px; }
.vpt-fe-btn--ghost:hover { background: #fef2f2; }

.vpt-fe-btn--full { width: 100%; padding: 14px; font-size: 16px; }

/* ─── Status pills ──────────────────────────────────────────── */
.vpt-status-pill { display: inline-block; padding: 5px 12px; border-radius: 20px; font-size: 13px; font-weight: 600; }
.vpt-status-pill--booked    { background: #edfaf3; color: #1a7a45; }
.vpt-status-pill--paid      { background: #edfaf3; color: #1a7a45; }
.vpt-status-pill--pending   { background: #fff8e1; color: #d97706; }
.vpt-status-pill--cancelled { background: #f5f5f7; color: #9e9e9e; text-decoration: line-through; }

/* ─── Empty state ───────────────────────────────────────────── */
.vpt-empty { text-align: center; padding: 60px 24px; color: #5a6a84; }
.vpt-empty__icon { font-size: 48px; margin-bottom: 14px; }
.vpt-empty p { font-size: 16px; line-height: 1.6; }
.vpt-empty a { color: #4a9ed7; font-weight: 600; }

/* ─── Auth cards (login / register / reset) ─────────────────── */
.vpt-auth-wrap { display: flex; justify-content: center; padding: 8px 0 20px; }

.vpt-auth-card {
    background: #fff;
    border-radius: 20px;
    padding: 36px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 4px 24px rgba(14,49,120,.08);
}

.vpt-auth-card h2 {
    font-size: 24px;
    font-weight: 700;
    color: #0e3178;
    margin-bottom: 6px;
}

.vpt-auth-card > p {
    color: #5a6a84;
    font-size: 15px;
    margin-bottom: 24px;
    line-height: 1.5;
}

.vpt-auth-form { text-align: left; }

.vpt-auth-field { margin-bottom: 16px; }

.vpt-auth-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #0e3178;
    margin-bottom: 6px;
}

.vpt-label-note { color: #8a9bab; font-weight: 400; }

.vpt-auth-field input[type="text"],
.vpt-auth-field input[type="email"],
.vpt-auth-field input[type="tel"],
.vpt-auth-field input[type="password"],
.vpt-auth-input-small {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #d8dce8;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    color: #0e3178;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
}

.vpt-auth-field input:focus,
.vpt-auth-input-small:focus {
    outline: none;
    border-color: #4a9ed7;
    box-shadow: 0 0 0 4px rgba(74,158,215,.12);
}

.vpt-auth-select {
    padding: 12px 14px;
    border: 1.5px solid #d8dce8;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    color: #0e3178;
    background: #fff;
    cursor: pointer;
    transition: border-color .2s;
}
.vpt-auth-select:focus { outline: none; border-color: #4a9ed7; }

.vpt-input-disabled {
    background: #f4f7fa !important;
    color: #8a9bab !important;
    cursor: not-allowed;
}

.vpt-field-note { display: block; font-size: 12px; color: #8a9bab; margin-top: 4px; }

/* Phone row — country code + number side by side */
.vpt-phone-wrap { display: flex; gap: 8px; align-items: stretch; }
.vpt-phone-wrap .vpt-auth-select { flex-shrink: 0; min-width: 0; width: auto; }
.vpt-phone-wrap input { flex: 1; }

/* ─── DOB picker ────────────────────────────────────────────── */
.vpt-dob-wrap { display: flex; flex-direction: column; gap: 10px; }

.vpt-dob-inputs { display: flex; gap: 8px; flex-wrap: wrap; }
.vpt-dob-inputs .vpt-auth-select { flex: 1; min-width: 90px; }

.vpt-dob-manual { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #8a9bab; }
.vpt-dob-manual .vpt-auth-input-small { width: 130px; flex: none; padding: 10px 12px; font-size: 14px; }

.vpt-age-display {
    background: #edf0f7;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 14px;
    color: #0e3178;
    font-weight: 500;
    display: inline-block;
}

.vpt-age-display strong { color: #4a9ed7; font-size: 18px; }

/* ─── Under-18 parent section ───────────────────────────────── */
.vpt-parent-section {
    background: #fff8e1;
    border: 1.5px solid #f0c070;
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 4px;
}

.vpt-parent-notice {
    font-size: 13px;
    font-weight: 600;
    color: #d97706;
    margin-bottom: 14px;
    padding-left: 4px;
}

/* ─── Auth footer links ─────────────────────────────────────── */
.vpt-auth-switch { margin-top: 18px; font-size: 14px; color: #5a6a84; text-align: center; }
.vpt-auth-switch a { color: #4a9ed7; font-weight: 600; text-decoration: none; }
.vpt-privacy-note { font-size: 12px; color: #8a9bab; margin-top: 12px; text-align: center; }

/* ─── Profile page ──────────────────────────────────────────── */
.vpt-profile-block {
    background: #fff;
    border-radius: 16px;
    padding: 22px 24px;
    box-shadow: 0 4px 16px rgba(14,49,120,.09);
    margin-bottom: 20px;
}

.vpt-profile-block__title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #8a9bab;
    margin-bottom: 12px;
}

.vpt-type-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }

.vpt-profile-block__note { font-size: 13px; color: #9aa5b4; font-style: italic; }

.vpt-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}
.vpt-badge--committee    { background: #e8f5e9; color: #2e7d32; }
.vpt-badge--competitive  { background: #ffeaea; color: #c0392b; }
.vpt-badge--recreational { background: #e8f5e9; color: #27ae60; }
.vpt-badge--pro          { background: #ede7f6; color: #6a1aad; }
.vpt-badge--training     { background: #fff3e0; color: #e67e22; }
.vpt-badge--womens       { background: #fce4ec; color: #c2185b; }
.vpt-badge--mens         { background: #e3f2fd; color: #1565c0; }

.vpt-text-muted { color: #8a9bab; }

/* ─── Bookings list ─────────────────────────────────────────── */
.vpt-bookings-list { display: flex; flex-direction: column; gap: 20px; }

.vpt-booking-row {
    background: #fff;
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 16px rgba(14,49,120,.09);
}


.vpt-booking-row--cancelled { opacity: .55; }

.vpt-booking-row__dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

.vpt-booking-row__info { flex: 1; font-size: 14px; color: #0e3178; font-weight: 500; }

.vpt-booking-row__status { flex-shrink: 0; }

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 680px) {
    .vpt-tab-body  { padding: 20px 12px; }
    .vpt-topbar    { padding: 12px 0 0; flex-direction: column; align-items: center; gap: 6px; }
    .vpt-topbar__brand { font-size: 17px; padding: 0 16px 4px; text-align: center; }
    .vpt-topbar__nav   { width: 100%; gap: 1px; padding: 0 4px; }
    .vpt-tab-link      { flex: 1; min-width: 0; font-size: 10px; padding: 9px 3px; }
    .vpt-auth-card { padding: 24px 18px; }

    .vpt-game-row__num { font-size: 28px; }

    .vpt-game-row__info {
        flex: 1;
        padding: 10px 14px;
    }

    /* Collapsible game body (details + action) */
    .vpt-mob-body {
        display: none;
        width: 100%;
        flex: none;
    }
    .vpt-mob-body.open { display: block; }

    .vpt-game-row__info-body {
        padding: 10px 14px;
        border-top: 1px solid #edf0f7;
    }

    /* ▼ Details toggle button */
    .vpt-mob-toggle {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        font-size: 12px;
        font-weight: 700;
        color: #4a9ed7;
        background: transparent;
        border: 1.5px solid #c5d8f0;
        border-radius: 20px;
        padding: 4px 12px;
        cursor: pointer;
        margin-top: 6px;
        white-space: nowrap;
    }
    .vpt-mob-toggle.open {
        color: #0e3178;
        background: #edf4ff;
        border-color: #4a9ed7;
    }

    .vpt-game-row__action {
        border-left: none;
        border-top: 1px solid #edf0f7;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 10px 14px;
        min-width: unset;
        width: 100%;
        justify-content: flex-start;
    }

    .vpt-stats-row    { grid-template-columns: 1fr 1fr; }
    .vpt-dob-inputs   { flex-direction: column; }
    .vpt-phone-wrap   { flex-direction: column; }

    /* Member card detail grid */
    .vpt-mcard__detail-grid { grid-template-columns: 1fr 1fr; }
}

/* ─────────────────────────────────────────────────────────
   GAME ROW — MOBILE COLLAPSIBLE DETAILS
   Desktop: mob-body is a normal block inside .info (flex:1)
   Mobile:  mob-body hidden until toggled open
   ───────────────────────────────────────────────────────── */

/* Desktop: details flow as normal block inside the info column */
.vpt-mob-body   { display: block; }
.vpt-mob-toggle { display: none; }

/* ── Mobile safe-zone: 6px minimum from every edge ── */
@media (max-width: 680px) {

    /* Outer app wrapper — never touches screen edge */
    .vpt-frontend { padding-left: 6px; padding-right: 6px; box-sizing: border-box; }

    /* Game row inner sections */
    .vpt-game-row__info   { padding: 10px 12px; }
    .vpt-game-row__action { padding: 10px 12px; }
    .vpt-game-row__date   { padding: 10px 12px; }

    /* When collapsible body is open */
    .vpt-mob-body.open { display: block; padding: 0 2px 6px; }

    /* Member cards */
    .vpt-mcard__head { padding: 12px 12px; }
    .vpt-mcard__body { padding: 8px 12px; }
    .vpt-mcard__foot { padding: 8px 12px; }
    .vpt-mcard__detail { padding: 10px 12px; }
}

/* Member card narrow screens */
@media (max-width: 420px) {
    .vpt-mcard__detail-grid { grid-template-columns: 1fr; }
}
