/* ═══════════════════════════════════════════════════════════════════════════
   SCHEDULE CALENDAR — "scal" design system, ported from RDL's schedule.css.
   RDL's version is a dual-mode (Solos/Duos) calendar with a division
   dropdown/badge and per-viewer timezone rows — Overload has one ladder, so
   the mode toggle, division select/badge, and timezone helper classes
   (.solo-opp-tz-*) are dropped entirely. Everything else (calendar grid,
   event cards, pending-requests panel, modals) is a straight port; class
   names keep the "solo-"/"scal-" prefixes from the source file. */

.scal { display: flex; flex-direction: column; gap: 10px; }

.schedule-ladder-switch {
    margin-bottom: 0;
}

.schedule-ladder-switch label {
    user-select: none;
}

/* Matches .outer-container's actual (2px) border width — this was still
   tuned for the old 5px border, leaving a visible gap/seam here after that
   was fixed to 2px everywhere else. */
.schedule-ladder-switch + .schedule-container {
    margin-top: -2px;
}

/* ── Upcoming matches ──────────────────────────────────────────────────── */
.scal-upcoming:empty { display: none; }
.scal-up-match {
    display: flex;
    align-items: stretch;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
    margin-bottom: 6px;
    transition: all 0.15s;
}
.scal-up-match:hover {
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(255, 255, 255, 0.1);
}
.scal-up-stripe { width: 3px; flex-shrink: 0; background: #7ec8ff; }
.scal-up-date {
    flex-shrink: 0;
    width: 46px;
    text-align: center;
    padding: 8px 4px 8px 8px;
}
.scal-up-date-day { font-size: 1.1rem; font-weight: 700; color: #ffffff; line-height: 1; }
.scal-up-date-month { font-size: 0.6rem; color: #ffffff; text-transform: uppercase; letter-spacing: 0.08em; margin-top: 2px; }
.scal-up-info { flex: 1; min-width: 0; padding: 8px 10px; }
.scal-up-teams {
    font-size: 0.92rem;
    font-weight: 600;
    color: #ccc;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    line-height: 1.3;
}
.scal-up-time { font-size: 0.78rem; color: #777; margin-top: 2px; }
.scal-up-vs { color: #666; font-weight: 400; font-size: 0.78rem; }
.scal-up-gcal {
    flex-shrink: 0;
    width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    font-size: 0.76rem;
    text-decoration: none;
    border-left: 1px solid rgba(255, 255, 255, 0.04);
    transition: all 0.15s;
}
.scal-up-gcal:hover { color: #ffffff; background: rgba(255, 255, 255, 0.06); }

/* ── Calendar card ─────────────────────────────────────────────────────── */
.scal-card {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    padding: 10px;
}
.scal-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.scal-month { font-size: 0.78rem; font-weight: 700; color: #ccc; letter-spacing: 0.01em; }
.scal-arrow {
    background: none;
    border: none;
    color: #ffffff;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    font-size: 0.65rem;
}
.scal-arrow:hover { color: #bbb; background: rgba(255, 255, 255, 0.06); }

/* Weekday header */
.scal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 2px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.scal-weekdays span {
    text-align: center;
    font-size: 0.48rem;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    padding-bottom: 6px;
}

/* Day grid */
.scal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    overflow: hidden;
    min-height: 420px;
}

/* Day cells */
.solo-cal-cell {
    position: relative;
    padding: 18px 2px;
    background: rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    cursor: pointer;
    transition: all 0.12s;
    user-select: none;
    gap: 5px;
    min-height: 64px;
}
.solo-cal-cell:hover { background: rgba(255, 255, 255, 0.04); }
.solo-cal-cell.solo-cal-blank {
    background: transparent !important;
    cursor: default;
    pointer-events: none;
}

.solo-cal-day-num {
    font-size: 0.75rem;
    color: #666;
    font-weight: 500;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    line-height: 1;
    transition: all 0.12s;
}
.solo-cal-cell.solo-cal-today { box-shadow: inset 0 0 0 2px rgba(126, 200, 255, 0.6); }
.solo-cal-cell.solo-cal-today .solo-cal-day-num { color: #7ec8ff; font-weight: 700; }
.solo-cal-cell.selected { background: rgba(255, 255, 255, 0.08); }
.solo-cal-cell.selected .solo-cal-day-num { color: #ffffff; font-weight: 600; }
.solo-cal-cell.solo-cal-today.selected .solo-cal-day-num { color: #7ec8ff; }

.solo-cal-tokens { display: flex; flex-direction: column; gap: 3px; align-items: center; width: 100%; }
.solo-cal-match-row { display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%; font-size: 0.68rem; }
.solo-cal-player {
    color: #999;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 75px;
}
.solo-cal-vs { font-size: 0.6rem; color: #555; font-weight: 600; line-height: 1; flex-shrink: 0; }
.solo-cal-more { font-size: 0.58rem; color: #555; font-style: italic; }
.solo-cal-cell.solo-cal-has-event .solo-cal-day-num { color: #ccc; }
.solo-cal-match-done { opacity: 0.7; }
.solo-cal-complete { font-size: 0.62rem; color: #4caf50; font-weight: 700; line-height: 1; flex-shrink: 0; }

/* ── Day detail panel ──────────────────────────────────────────────────── */
.scal-detail { min-height: 24px; }
.scal-detail-empty, .solo-cal-events-placeholder {
    color: #2e2e2e;
    font-size: 0.7rem;
    text-align: center;
    padding: 8px 0;
    margin: 0;
}

/* ── Event cards ───────────────────────────────────────────────────────── */
.solo-cal-event-card {
    display: flex;
    align-items: stretch;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
    margin-bottom: 6px;
    transition: all 0.15s;
}
.solo-cal-event-card:hover {
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(255, 255, 255, 0.1);
}
.solo-cal-event-stripe { width: 3px; flex-shrink: 0; }
.solo-cal-event-info { flex: 1; padding: 8px 10px; display: flex; flex-direction: column; gap: 3px; }
.solo-cal-event-teams {
    font-weight: 600;
    font-size: 0.78rem;
    color: #ccc;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    line-height: 1.3;
}
.solo-cal-event-player { color: #ccc; }
.solo-cal-event-vs { color: #666; font-weight: 400; font-size: 0.66rem; }
.solo-cal-event-meta { font-size: 0.66rem; color: #777; }
.solo-cal-complete-badge { font-size: 0.68rem; color: #4caf50; font-weight: 600; white-space: nowrap; margin-left: 4px; }
.solo-cal-event-done { opacity: 0.8; }
.solo-cal-gcal-btn {
    width: 36px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    font-size: 0.82rem;
    text-decoration: none;
    border-left: 1px solid rgba(255, 255, 255, 0.04);
    transition: all 0.15s;
}
.solo-cal-gcal-btn:hover { color: #ffffff; background: rgba(255, 255, 255, 0.06); }

/* ── Pending requests panel ────────────────────────────────────────────── */
.solo-pending-header {
    font-size: 0.58rem;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    margin-bottom: 8px;
}
.solo-pending-card {
    display: flex;
    align-items: stretch;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
    margin-bottom: 6px;
    transition: all 0.15s;
}
.solo-pending-card:hover { background: rgba(255, 255, 255, 0.045); }
.solo-pending-stripe { width: 3px; flex-shrink: 0; }
.solo-pending-inner { flex: 1; padding: 8px 10px; }
.solo-pending-teams {
    font-size: 0.78rem;
    font-weight: 600;
    color: #ccc;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    line-height: 1.3;
}
.solo-pending-actions { margin-top: 10px; display: flex; gap: 8px; }
.solo-pending-badge {
    font-size: 0.55rem;
    padding: 1px 7px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
}
.solo-pending-badge--sent { background: rgba(255, 152, 0, 0.1); color: #cc8a30; border: 1px solid rgba(255, 152, 0, 0.15); }
.solo-pending-badge--recv { background: rgba(76, 175, 80, 0.1); color: #66BB6A; border: 1px solid rgba(76, 175, 80, 0.15); }

/* ── Bottom actions bar ────────────────────────────────────────────────── */
.scal-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}
.scal-action-btn {
    background: none;
    border: none;
    color: #666;
    font-size: 0.64rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 6px;
    transition: all 0.15s;
}
.scal-action-btn:hover { color: #888; background: rgba(255, 255, 255, 0.04); }
.scal-action-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* Schedule match button */
.solo-schedule-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(126, 200, 255, 0.08);
    border: 1px solid rgba(126, 200, 255, 0.25);
    color: #7ec8ff;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.solo-schedule-btn:hover {
    background: rgba(126, 200, 255, 0.16);
    border-color: rgba(126, 200, 255, 0.45);
    color: #b8e0ff;
}

/* ── Modal overlay ─────────────────────────────────────────────────────── */
.solo-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 16px;
}
.solo-modal-box {
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow: hidden;
}
.solo-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.solo-modal-header h3 { margin: 0; font-size: 1rem; font-weight: 700; color: #eee; }
.solo-modal-close {
    background: none;
    border: none;
    color: #555;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    transition: color 0.15s;
}
.solo-modal-close:hover { color: #ccc; }
.solo-modal-body { padding: 16px 20px; overflow-y: auto; flex: 1; }
.solo-modal-subtitle { color: #999; font-size: 0.82rem; margin: 0 0 12px; }
.solo-modal-error { color: #f44336; font-size: 0.78rem; margin-top: 6px; min-height: 1.2em; }
.solo-modal-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: 12px 20px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Form elements */
.solo-form-group { margin-bottom: 12px; }
.solo-form-group label { display: block; font-size: 0.74rem; color: #999; margin-bottom: 4px; font-weight: 600; }
.solo-input {
    width: 100%;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #ddd;
    font-size: 0.82rem;
    transition: border-color 0.15s;
    box-sizing: border-box;
}
.solo-input:focus { outline: none; border-color: rgba(126, 200, 255, 0.4); }
select.solo-input {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
    cursor: pointer;
}
select.solo-input option { background: #1a1a1a; color: #ddd; }
input[type="date"].solo-input { color-scheme: dark; }

/* Buttons */
.solo-modal-btn {
    padding: 7px 16px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.solo-modal-btn--primary { background: rgba(126, 200, 255, 0.12); border-color: rgba(126, 200, 255, 0.35); color: #7ec8ff; }
.solo-modal-btn--primary:hover { background: rgba(126, 200, 255, 0.22); border-color: rgba(126, 200, 255, 0.55); }
.solo-modal-btn--danger { background: rgba(244, 67, 54, 0.1); border-color: rgba(244, 67, 54, 0.3); color: #ef5350; }
.solo-modal-btn--danger:hover { background: rgba(244, 67, 54, 0.2); border-color: rgba(244, 67, 54, 0.5); }
.solo-modal-btn--cancel { background: none; border: 1px solid rgba(255, 255, 255, 0.08); color: #777; }
.solo-modal-btn--cancel:hover { background: rgba(255, 255, 255, 0.04); color: #bbb; }
.solo-modal-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Challenge/request summary (accept modal) */
.solo-challenge-summary {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 12px;
}
.solo-challenge-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.solo-challenge-summary-row:last-child { border-bottom: none; }
.solo-challenge-label { font-size: 0.72rem; color: #666; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.solo-challenge-value { font-size: 0.82rem; color: #ccc; }

@media (max-width: 600px) {
    .scal-days { min-height: 340px; }
    .solo-cal-cell { min-height: 48px; padding: 12px 2px; }
}
