/* TORO247 - pickers and sheets: the league / country chooser and the like (TORO-SHAPES.md). */

/* ---- The league / country chooser (#modal-change-match; js/app.js openLeagueChangeModal,
   _showLeagueCountry, openCountriesModal, openCountryLeaguesModal; also the match page's
   Change Match list, openChangeMatchModal). The sheet a straight --t-card panel (the canvas's
   Bast panel, radius 12px where it floats), its title teal italic upper case, back and close
   44px secondary buttons, each country / league a leaning row on --t-raised (5px, 8px apart),
   the current league teal. CSS only: the markup and its handlers are app.js's. */
html.toro #modal-change-match { background: rgba(var(--bg-deep-rgb), .78); }
html.toro #modal-change-match .modal-full { background: var(--t-card); color: var(--t-text); font-family: var(--t-font); }
@media (min-width: 600px) {
    html.toro #modal-change-match .modal-full { border-radius: 12px; box-shadow: var(--t-ring); }
}

html.toro #modal-change-match .modal-header {
    gap: 12px;
    padding: calc(18px + env(safe-area-inset-top, 0px)) 18px 12px;
    background: none;
    border: 0;
}
@media (min-width: 600px) {
    html.toro #modal-change-match .modal-header { padding-top: 18px; }
}
html.toro #modal-change-match .modal-title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    color: var(--t-teal);
    font-size: 24px;
    font-style: italic;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: .01em;
    text-transform: uppercase;
}
/* Back and close: the canvas's secondary button, square (a leaf: it may lean). */
html.toro #modal-change-match :is(.modal-back, .modal-close) {
    width: 44px;
    height: 44px;
    margin: 0;
    background: var(--t-raised);
    border-radius: 5px;
    color: var(--t-text);
    transform: var(--t-lean);
}
html.toro #modal-change-match :is(.modal-back, .modal-close):hover { background: var(--bg-hover); color: var(--t-teal); }
html.toro #modal-change-match :is(.modal-back, .modal-close):focus-visible { outline: 2px solid var(--t-teal-neon); outline-offset: 2px; }

/* The list: the rows 8px apart; the side padding holds the rows' lean inside the scroller. */
html.toro #modal-change-match .modal-body { display: flex; flex-direction: column; gap: 8px; padding: 6px 22px 22px; }
html.toro #modal-change-match .sport-loading { padding: 12px 2px; color: var(--t-muted); font-size: 17px; font-style: italic; font-weight: 600; }

/* A country or a league: the canvas's leaning row (straight box, its fill leans on ::before). */
html.toro #modal-change-match :is(.modal-league-item, .modal-match-item) {
    position: relative;
    isolation: isolate;
    flex: none;
    border: 0;
    background: none;
    color: var(--t-text);
    transition: color .15s;
}
html.toro #modal-change-match :is(.modal-league-item, .modal-match-item)::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: var(--t-raised);
    border-radius: 5px;
    transform: var(--t-lean);
    transition: background-color .15s;
}
html.toro #modal-change-match .modal-league-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 10px 18px;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.25;
}
html.toro #modal-change-match .modal-league-item img { flex: none; width: 22px; height: 22px; margin: 0; }
@media (hover: hover) {
    html.toro #modal-change-match :is(.modal-league-item, .modal-match-item):hover { background: none; color: var(--t-teal); }
    html.toro #modal-change-match :is(.modal-league-item, .modal-match-item):hover::before { background: var(--bg-hover); }
}
/* The current league: app.js marks it with an inline colour only - teal fill, dark ink. */
html.toro #modal-change-match .modal-league-item[style*="accent-green"] { color: var(--t-on-teal) !important; font-weight: 700; }
html.toro #modal-change-match .modal-league-item[style*="accent-green"]::before,
html.toro #modal-change-match .modal-league-item[style*="accent-green"]:hover::before { background: var(--t-teal); }

/* Change Match: the day small and teal over its rows, each match a leaning row. */
html.toro #modal-change-match .modal-date-label {
    margin: 10px 0 0;
    padding: 0 2px;
    background: none;
    border-radius: 0;
    color: var(--t-teal);
    font-size: 14px;
    font-style: italic;
    font-weight: 800;
    text-align: left;
    text-transform: uppercase;
}
html.toro #modal-change-match .modal-date-label:first-child { margin-top: 0; }
html.toro #modal-change-match .modal-match-item { padding: 12px 18px; }
html.toro #modal-change-match .modal-match-team span { font-size: 15px; font-weight: 600; }
html.toro #modal-change-match .modal-match-time { color: var(--t-teal); font-size: 17px; font-style: italic; font-weight: 800; }

@media (max-width: 980px) {
    /* style.css's room for the bottom nav, kept under the list's own padding. */
    html.toro #modal-change-match .modal-body { padding: 4px 18px calc(18px + var(--bottom-nav-height)); }
    html.toro #modal-change-match :is(.modal-league-item, .modal-match-item)::before { transform: skew(-6deg); }
    html.toro #modal-change-match .modal-league-item { font-size: 15px; }
}
@media (max-width: 599px) {
    html.toro #modal-change-match .modal-header { padding-inline: 16px; }
    html.toro #modal-change-match .modal-title { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
    html.toro #modal-change-match :is(.modal-league-item, .modal-match-item),
    html.toro #modal-change-match :is(.modal-league-item, .modal-match-item)::before { transition: none; }
}
