/* ---------------------------------------------------------
   make_league.css - create/clone league form
   ---------------------------------------------------------
   Rewritten: this file previously had ~370 lines including two
   entire dark-theme blocks (.make-league-page, .make-league-form)
   that never matched anything in the markup (the body/form never
   had those classes) - dead code that made the page look like it
   was using default/unstyled HTML fieldsets instead of the site's
   real dark theme. Consolidated into one set of rules, using the
   shared color variables from app_core.css instead of a bespoke
   palette, and reduced the form from 4 separate bordered boxes to
   2 (the two that group multiple related fields - "Grading Mode"
   and "Game Selection Mode" were single-field/single-group boxes
   that added visual weight without organizing anything, so those
   fieldset wrappers were removed from make_league.php).
--------------------------------------------------------- */

:root {
    --ml-radius: 0.5rem;
    --ml-gap-sm: 0.5rem;
    --ml-gap-md: 0.75rem;
    --ml-gap-lg: 1rem;
}

/* ---------- Card container ---------- */
.container {
    max-width: 42rem;
    margin: 1.5rem auto;
    background: var(--bg-1);
    padding: 1.25rem 1.1rem;
    border-radius: var(--ml-radius);
    border: 1px solid var(--border);
    box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,0.25);
}

.container h2 {
    margin: 0 0 0.75rem 0;
    text-align: center;
}

/* ---------- Labels & fields ---------- */
.make-league-scope label {
    display: block;
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text);
}

.make-league-scope input[type="text"],
.make-league-scope input[type="number"],
.make-league-scope input[type="date"],
.make-league-scope input[type="datetime-local"],
.make-league-scope select {
    width: 100%;
    background: var(--bg-0);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    padding: 0.5rem 0.65rem;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.make-league-scope input:focus,
.make-league-scope select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 0.125rem rgba(88,166,255,0.25);
}

/* two-column rows */
.input-row {
    display: flex;
    gap: var(--ml-gap-md);
    margin-top: 0.5rem;
}

.input-group {
    flex: 1 1 0;
}

.input-group label {
    margin-bottom: 0.25rem;
}

/* ---------- Fieldsets (grouped options) ----------
   only "Play Frequency & Access" and "Game Type" use a real
   <fieldset> now - both group multiple related fields, which is
   what a bordered box should be reserved for. */
.make-league-scope fieldset {
    margin: 1rem 0 0 0;
    padding: 0.75rem 1rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--bg-2);
}

.make-league-scope legend {
    padding: 0 0.4rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted, var(--text-muted));
    text-transform: none;
    letter-spacing: normal;
}

/* checkbox / radio rows */
.checkbox-row,
.radio-group {
    display: flex;
    align-items: center;
    gap: var(--ml-gap-lg);
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.checkbox-row label,
.radio-group label {
    margin: 0;
    font-weight: 400;
    white-space: nowrap;
    color: var(--text);
}

.game-type-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.game-type-row + .game-type-row,
.checkbox-row + .checkbox-row {
    margin-top: 0.4rem;
}

.game-type-row .lead {
    flex: 0 0 5.5rem;
    display: inline-flex;
    align-items: center;
    font-weight: 600;
}

.game-type-row label {
    white-space: nowrap;
}

/* ---------- Dates row ---------- */
.date-row {
    display: flex;
    align-items: center;
    gap: var(--ml-gap-md);
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.date-group {
    flex: 0 0 auto;
}

.date-group label {
    margin-top: 0;
}

/* compact but readable date inputs (mm/dd/yy) */
#startDate,
#endDate {
    width: 10rem;
    font-variant-numeric: tabular-nums;
    box-sizing: border-box;
}

/* right column = shortcuts/radios */
.date-shortcuts {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
    padding-top: 1.1rem; /* roughly aligns with the date input, not the label above it */
}

.date-shortcuts label {
    margin: 0;
    font-weight: 400;
    white-space: nowrap;
    color: var(--text);
    font-size: 0.85rem;
}

/* ---------- Reset / playoffs row ---------- */
.league-reset {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.league-reset label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    margin: 0;
    color: var(--text);
}

.reset-label {
    font-weight: 600;
    font-size: 0.9rem;
}

.no-bold {
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--text-muted, var(--text-muted));
}

/* ---------- Game Selection Mode ----------
   this used to be double-wrapped in <section class="game-mode-section">
   AND <fieldset> - trimmed to just the fieldset. */
.game-mode-fieldset {
    margin-top: 1rem;
}

.game-mode-options {
    margin-top: 0.5rem;
}

.mode-label {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.mode-label .tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: 50%;
    left: 100%;
    transform: translateY(-50%);
    background-color: var(--neutral-700);
    color: var(--text-inverse);
    padding: 0.4rem 0.6rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 10;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.mode-label:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

/* ---------- Info banner (mode-notice) ---------- */
#mode-notice.info-banner {
    margin-top: 0.75rem;
    padding: 0.6rem 0.9rem;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    border-radius: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-muted, var(--text-muted));
}

/* ---------- Small help text under a field ---------- */
.make-league-scope small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-muted, var(--text-muted));
}

/* ---------- Form wrapper ---------- */
.make-league-scope {
    background: transparent;
}

/* ---------- Buttons ---------- */
.button-group {
    display: flex;
    flex-wrap: wrap;
    /* the row had visible spare room on both sides at the old 1.5rem
       container padding + 0.6rem gap - narrowed the container padding
       above and widened this gap so the buttons use that room instead
       of leaving it empty, while still staying on one row */
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: center;
}

.button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
    filter: grayscale(60%);
}

/* ---------- Small screens ---------- */
@media (max-width: 32rem) {

    .input-row {
        flex-direction: column;
    }

    #startDate, #endDate {
        width: 100%;
    }

    .date-shortcuts {
        padding-top: 0;
    }
}
