/* ── YSB Member Dashboard ────────────────────────────────────────────────── */
/* Theme-agnostic, scoped to .ysb-wrap                                        */

/* ── Reset / base ── */
.ysb-wrap *, .ysb-wrap *::before, .ysb-wrap *::after { box-sizing: border-box; }

.ysb-wrap {
    font-family: inherit;
    max-width: 980px;
    margin: 0 auto;
    padding: 0 16px 40px;
    color: #1a1a2e;
}

/* ── State screens (login / no season) ── */
.ysb-state-screen {
    text-align: center;
    padding: 48px 24px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    margin-top: 20px;
}
.ysb-state-icon { font-size: 3rem; margin-bottom: 12px; }
.ysb-state-screen h2 { margin: 0 0 12px; }

/* ── Header ── */
.ysb-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e2e8f0;
}

.ysb-header h2 { margin: 0 0 6px; font-size: 1.5em; }
.ysb-welcome   { margin: 0; display: flex; align-items: center; gap: 8px; color: #555; }

/* Member colour dots */
.ysb-dot {
    display: inline-block;
    width: 12px; height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}
.ysb-dot--sm { width: 10px; height: 10px; }

/* ── Legend ── */
.ysb-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    align-items: center;
}
.ysb-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .88em;
    font-weight: 600;
    color: #444;
}

/* ── Status banner ── */
.ysb-status-banner {
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 20px;
    border: 2px solid transparent;
    font-size: .97em;
    line-height: 1.5;
}
.ysb-status-banner p { margin: 0; }
.ysb-your-turn { background: #fefce8; border-color: #ca8a04; }
.ysb-waiting   { background: #f0f9ff; border-color: #bae6fd; }

/* ── Progress bar ── */
.ysb-progress-section { margin-bottom: 24px; }
.ysb-progress-label   { font-size: .82em; color: #64748b; margin-bottom: 5px; font-weight: 500; letter-spacing: .3px; }
.ysb-progress-bar     { background: #e2e8f0; border-radius: 6px; height: 10px; overflow: hidden; }
.ysb-progress-fill    { background: linear-gradient(90deg,#3b82f6,#60a5fa); height: 100%; border-radius: 6px; transition: width .4s ease; }

/* ── My bookings ── */
.ysb-my-bookings {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 24px;
}
.ysb-my-bookings h3 { margin: 0 0 10px; font-size: 1em; }
.ysb-none { color: #94a3b8; margin: 0; font-style: italic; }

.ysb-booked-list {
    list-style: none; margin: 0; padding: 0;
    display: flex; flex-wrap: wrap; gap: 8px;
}
.ysb-booked-list li {
    border: 1px solid;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: .88em;
    font-weight: 500;
}

/* ── Sections ── */
.ysb-section { margin-bottom: 36px; }
.ysb-section h3 { margin: 0 0 8px; font-size: 1.1em; }
.ysb-instruction { color: #555; font-size: .9em; margin: 0 0 14px; }

/* ══════════════════════════════════════════════════════════
   WEEK GRID
   ══════════════════════════════════════════════════════════ */
.ysb-week-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.ysb-week {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 11px 13px;
    text-align: center;
    min-height: 82px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    transition: border-color .15s, transform .1s, box-shadow .15s;
}

.ysb-week-number { font-weight: 700; font-size: .92em; }
.ysb-week-dates  { font-size: .75em; color: #64748b; line-height: 1.3; }
.ysb-week-tag    { font-size: .76em; font-weight: 600; margin-top: 3px; }
.ysb-week-free   { color: #16a34a; }

/* ── Available: clean white, green accent ── */
.ysb-week--available {
    background: #fff;
    border-color: #86efac;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.ysb-week--available .ysb-week-number { color: #15803d; }
.ysb-week--available:hover {
    border-color: #22c55e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34,197,94,.2);
}

/* ── Selected (JS toggled) ── */
.ysb-week--selected {
    border-color: #15803d !important;
    box-shadow: 0 0 0 3px rgba(21,128,61,.2) !important;
    transform: translateY(-2px);
}
.ysb-week--selected .ysb-week-tag { color: #15803d !important; }

/* ── Booked by any member — styled via inline PHP colours ── */
.ysb-week--taken,
.ysb-week--mine {
    border-width: 2px;
}
.ysb-week--taken  { cursor: not-allowed; opacity: .88; }
.ysb-week--mine   { cursor: default; }

/* Read-only grid: no hover */
.ysb-week--readonly { cursor: default !important; }
.ysb-week--readonly:hover { transform: none !important; box-shadow: none !important; }

/* ── Submit area ── */
.ysb-submit-area { margin-top: 4px; }
.ysb-selection-count { font-size: .88em; color: #64748b; margin: 0 0 10px; }

.ysb-btn {
    display: inline-block;
    padding: 11px 26px;
    border-radius: 6px;
    border: none;
    font-size: .97em;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: .3px;
    transition: opacity .15s, transform .1s;
}
.ysb-btn--primary { color: #fff; }
.ysb-btn--primary:hover:not(:disabled) { opacity: .88; transform: translateY(-1px); }
.ysb-btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }

.ysb-message {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: .9em;
    font-weight: 500;
    display: none;
}
.ysb-message.success { background: #dcfce7; color: #166534; border: 1px solid #86efac; display: block; }
.ysb-message.error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; display: block; }

/* ══════════════════════════════════════════════════════════
   MONTHLY CALENDAR
   ══════════════════════════════════════════════════════════ */
.ysb-calendar-section { border-top: 1px solid #e2e8f0; padding-top: 24px; }

.ysb-monthly-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.ysb-month {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.ysb-month-header {
    background: #1e293b;
    color: #fff;
    text-align: center;
    font-weight: 700;
    font-size: .88em;
    padding: 9px 12px;
    letter-spacing: .4px;
    text-transform: uppercase;
}

.ysb-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
    border-left: 1px solid #e2e8f0;
    border-top: 1px solid #e2e8f0;
}

.ysb-cal-dow {
    text-align: center;
    font-size: .7em;
    font-weight: 700;
    color: #94a3b8;
    padding: 6px 2px;
    text-transform: uppercase;
    letter-spacing: .3px;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

.ysb-cal-day {
    text-align: center;
    font-size: .8em;
    padding: 7px 3px 5px;
    min-height: 36px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 2px;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

.ysb-cal-day--empty { background: #fafafa; }

/* Outside season */
.ysb-cal-day--out {
    color: #cbd5e1;
    background: #fafafa;
}

/* Season but unbooked */
.ysb-cal-day--free {
    color: #475569;
    background: #fff;
}
.ysb-cal-day--free:hover { background: #f0fdf4; }

/* Booked — background colour set inline by PHP */
.ysb-cal-day--booked {
    font-weight: 600;
    font-size: .82em;
    color: #1e293b;
}

/* Coloured dot inside booked cell */
.ysb-cal-dot {
    display: block;
    width: 6px; height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════
   TURN ORDER TABLE
   ══════════════════════════════════════════════════════════ */
.ysb-table-wrap {
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    display: block;
    /* Ensure Divi/theme containers don't clip */
    position: relative;
    z-index: 1;
}

.ysb-table-wrap .ysb-table {
    width: 100%;
}

/* Ensure the section containing the table doesn't clip overflow */
.ysb-section {
    overflow: visible !important;
}

.ysb-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88em;
}
.ysb-table th, .ysb-table td {
    text-align: left;
    padding: 9px 12px;
    border-bottom: 1px solid #e2e8f0;
}
.ysb-table th { background: #f1f5f9; font-weight: 700; font-size: .82em; text-transform: uppercase; letter-spacing: .4px; color: #64748b; }
.ysb-table td { vertical-align: middle; }

.ysb-turn-row td { display: table-cell; } /* override any flex */
.ysb-td-member { display: flex; align-items: center; gap: 7px; }

.ysb-turn-active  td  { background: #fefce8; }
.ysb-turn-completed   { opacity: .6; }

.ysb-you { color: #94a3b8; font-style: italic; font-size: .88em; }

/* Status badges */
.ysb-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: .78em;
    font-weight: 700;
    letter-spacing: .3px;
}
.ysb-badge--active    { background: #fef9c3; color: #854d0e; }
.ysb-badge--pending   { background: #f1f5f9; color: #64748b; }
.ysb-badge--completed { background: #dcfce7; color: #166534; }

/* ── Responsive ── */
@media (max-width: 640px) {
    .ysb-header { flex-direction: column; }
    .ysb-week-grid { grid-template-columns: repeat(auto-fill, minmax(130px,1fr)); gap: 8px; }
    .ysb-week { min-height: 70px; padding: 8px 10px; }
    .ysb-week-dates { font-size: .7em; }
    .ysb-monthly-grid { grid-template-columns: 1fr; }
    .ysb-table { font-size: .8em; }
    .ysb-table th, .ysb-table td { padding: 7px 8px; }
}

/* ══════════════════════════════════════════════════════════
   DIAGONAL SPLIT CALENDAR CELL (crossover Sundays)
   ══════════════════════════════════════════════════════════ */
.ysb-cal-day--split {
    cursor: help;
    position: relative;
    flex-direction: column;
    gap: 1px;
    padding: 5px 3px 4px;
}
.ysb-split-day {
    font-size: .8em;
    font-weight: 700;
    display: block;
    text-align: center;
    color: #1e293b;
    line-height: 1;
    text-shadow: 0 0 3px #fff;
}
.ysb-split-dots {
    display: flex;
    justify-content: center;
    gap: 3px;
    margin-top: 2px;
}

/* ══════════════════════════════════════════════════════════
   MEMBERS KEY (below calendar)
   ══════════════════════════════════════════════════════════ */
.ysb-members-key {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.ysb-key-pill {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 99px;
    font-size: .88em;
    font-weight: 700;
    letter-spacing: .2px;
}

/* Active turn date */
.ysb-turn-date {
    display: inline-block;
    margin-left: 7px;
    font-size: .78em;
    color: #78716c;
    font-style: italic;
}

/* Turn number + compact round label stacked in first column */
.ysb-turn-num {
    display: block;
    font-weight: 700;
    font-size: .9em;
}
.ysb-round-label {
    display: block;
    font-size: .72em;
    color: #94a3b8;
    font-weight: 500;
    margin-top: 1px;
    white-space: nowrap;
}
