/* ================================================================
   nuSport – Strukturelles Layout
   ----------------------------------------------------------------
   Gilt für alle Verbände gleichermassen.
   Keine Farb- oder Schriftwerte – nur Positionen und Strukturen.
   Alle Farben kommen via CSS-Variablen aus theme.css.
   ================================================================ */


/* ── Seite ────────────────────────────────────────────────────── */
#page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typografie – Überschriften ────────────────────────────── */
h1 { font-size: 1.25rem; margin-bottom: 0.5rem;  font-weight: 700; }
h2 { font-size: 1.1rem;  margin-bottom: 0.45rem; font-weight: 600; }
h3 { font-size: 1rem;    margin-bottom: 0.4rem;  font-weight: 600; }
h4 { font-size: 0.9rem;  margin-bottom: 0.35rem; font-weight: 600; }
h5 { font-size: 0.95rem; margin-bottom: 0.3rem; }
h6 { font-size: 0.875rem; margin-bottom: 0.25rem; }


/* ── Header ───────────────────────────────────────────────────── */
#header {
    height: 4rem;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: var(--shadow);
    background: var(--header-bg, var(--card));
    color: var(--header-color, var(--text));
}

/* Rechte Header-Gruppe: Language Switcher + User + Logo */
#header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

/* Language-Switcher im Footer */
#footer-lang {
    margin-top: 0.5rem;
}

#language-switcher {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.25rem;
}


/* Hamburger – Desktop unsichtbar, mobil sichtbar */
#hamburger-btn {
    display: none;
    font-size: 1.6rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 0.4rem;
    line-height: 1;
    align-self: center;    /* vertikale Zentrierung im Flex-Header */
}

/* Logo rechts — streckt sich auf die volle innere Header-Höhe */
#logo {
    display: flex;
    align-items: stretch;
    align-self: stretch;
}

#logo a {
    display: flex;
    align-items: center;
}

/* #logo a::before wird vollständig in den jeweiligen Theme-Dateien definiert */

/* Nicht benötigte Header-Elemente ausblenden */
#title              { display: none; }
#date               { display: none; }
#banner             { display: none; }


/* ── Breadcrumb ───────────────────────────────────────────────── */
#breadcrumb,
nav[aria-label="breadcrumb"] {
    padding: 0.2rem 1.5rem;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
}

/* Bootstrap-Trenner "/" entfernen – Komponenten rendern eigene ">" */
.breadcrumb-item + .breadcrumb-item::before {
    content: none;
}

/* Bootstrap-Margin entfernen */
ol.breadcrumb {
    margin-bottom: 0;
}


/* ── Tabs (interne Navigation für eingeloggte Nutzer) ─────────── */
#tabs {
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--tabs-bg, var(--card));
}


/* ── Abstand zwischen Navigation und Content ─────────────────── */
/* flex-wrap: nowrap hält die Spalten bis zum Mobile-Breakpoint   */
/* nebeneinander.                                                  */
.row:has(#navigation) {
    gap: 1.5rem;
    --bs-gutter-x: 0;
    flex-wrap: nowrap;
}


/* ── Content-Karte (#content = col im Bootstrap-Grid) ─────────── */
#content {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}


/* ── main füllt verbleibenden Raum → Footer bleibt am Seitenende ── */
main {
    flex: 1 0 auto;
    margin-bottom: 1.5rem;
}

/* overflow-x: auto auf .container-fluid (nicht main) –           */
/* Breadcrumb liegt als Geschwister-Element außerhalb des          */
/* Scroll-Containers und bleibt immer in voller Breite.           */
main .container-fluid {
    padding-top: 1rem;
    padding-right: 1.5rem;
    padding-left: 1.5rem;
    overflow-x: auto;
}


/* ── Navigation (col-auto im Bootstrap-Grid) ─────────────────── */
#navigation {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow);
}

#navigation ul        { list-style: none; padding: 0; margin: 0; }
#navigation > ul > li { margin-bottom: 0.8rem; }

#navigation strong {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

/* Trennlinie vor jedem Abschnitt außer dem ersten */
#navigation > ul > li + li > strong {
    padding-top: 0.65rem;
    margin-top: 0.1rem;
    border-top: 1px solid var(--border);
}

#navigation a {
    display: block;
    padding: 0.35rem 0.6rem;
    border-radius: 5px;
    font-size: 0.88rem;
    transition: background 0.15s, color 0.15s;
    text-decoration: none;
}


/* ── Locker / UnlockHistoricalDataForm ─────────────────────────── */
#locker {
    margin-bottom: 1rem;
}

#locker fieldset {
    padding: 0.35rem 0.7rem;
    border-color: var(--border);
}

#locker legend {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0 0.35rem;
}

#locker legend a {
    color: var(--text-light);
    text-decoration: none;
}

#locker legend a:hover {
    color: var(--text);
}

#locker #historicalDataForm {
    padding-top: 0.4rem;
}

#locker .info {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-bottom: 0.4rem;
}

#locker label {
    font-size: 0.75rem;
    color: var(--text-light);
    display: block;
    margin-bottom: 0.1rem;
}

#locker input[type="text"],
#locker input[type="password"] {
    font-size: 0.78rem;
    padding: 0.2rem 0.4rem;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-bottom: 0.35rem;
    background: var(--bg);
    color: var(--text);
}

#locker input[type="submit"],
#locker input.button {
    font-size: 0.75rem;
    padding: 0.2rem 0.7rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.75;
    transition: opacity 0.15s;
}

#locker input[type="submit"]:hover,
#locker input.button:hover {
    opacity: 1;
}


/* ── Formulare ────────────────────────────────────────────────── */
fieldset {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.2rem;
    margin-bottom: 1rem;
}

legend {
    font-weight: 600;
    font-size: 1rem;
    padding: 0 0.4rem;
    float: none;
    width: auto;
}

label {
    font-size: 0.85rem;
    display: block;
    margin-bottom: 0.3rem;
}

/* Label + Eingabefeld nebeneinander: CSS Grid auf fieldset
   Spalte 1 = Label (so breit wie nötig), Spalte 2 = Input (Rest)
   Funktioniert für zwei HTML-Muster:
     A) <p><label>…</label><input></p>  → p wird via display:contents transparent
     B) <label>…</label><input><br>     → br wird ausgeblendet               */
fieldset {
    display: grid;
    grid-template-columns: max-content 1fr;
    align-items: center;
    column-gap: 1rem;
    row-gap: 0.4rem;
}

fieldset legend {
    grid-column: 1 / -1;
    margin-bottom: 0.2rem;
}

/* Labels im Grid: Blockmarge entfällt, kein Umbruch bei langem Text */
fieldset label {
    margin-bottom: 0;
    white-space: nowrap;
}

/* <br>-Trenner aus alten Formularen ausblenden */
fieldset br {
    display: none;
}

/* <p>-Wrapper transparent für das Grid –
   label und input werden direkte Grid-Items */
fieldset p:not(.action):not(.info):not(.mt-2) {
    display: contents;
}

/* Aktions- und Info-Absätze über beide Spalten */
fieldset p.action,
fieldset p.info,
fieldset p.mt-2 {
    grid-column: 1 / -1;
    margin-top: 0.2rem;
}

/* Submit als direktes Grid-Kind (Muster B) → zweite Spalte */
fieldset > input[type="submit"],
fieldset > button[type="submit"] {
    grid-column: 2;
    justify-self: start;
}

/* Auf kleinen Viewports: einspaltig */
@media (max-width: 600px) {
    fieldset {
        grid-template-columns: 1fr;
    }
    fieldset legend,
    fieldset p.action,
    fieldset p.info,
    fieldset p.mt-2,
    fieldset > input[type="submit"],
    fieldset > button[type="submit"] {
        grid-column: 1;
    }
    fieldset label {
        white-space: normal;
        margin-bottom: 0.2rem;
    }
}

/* Texteingaben füllen ihre Grid-Zelle, max. 22rem */
input[type="text"],
input[type="password"],
input[type="email"],
select {
    width: 100%;
    max-width: 22rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 0;          /* Abstand übernimmt row-gap */
    font-size: 0.9rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

/* Textarea darf breiter sein (Freitexte, Kommentare) */
textarea {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 0;
    font-size: 0.9rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

/* Submit: nur so breit wie nötig */
input[type="submit"],
button[type="submit"] {
    width: auto;
    min-width: 8rem;
    padding: 0.45rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}


/* ── RegionMeetingsFilter: horizontale Pill-Filter ─────────────── */

/* Filterblöcke .month / .week / .category nebeneinander           */
#content form:has(> .month) {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

/* Fieldsets im Filter: normales Block-Layout (kein Grid)           */
div.month fieldset,
div.week fieldset,
div.category fieldset,
div.additional fieldset {
    display: block;
    max-width: none;
}

/* Monat: beide .col50-Spalten nebeneinander, Labels umbrechen      */
div.month fieldset {
    display: flex;
    flex-direction: column;
}
div.month .col50 {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.3rem;
}

/* Woche: Labels umbrechen */
div.week fieldset {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
div.week fieldset b {
    font-size: 0.75rem;
    color: var(--text-light);
    letter-spacing: 0.04em;
}

/* Kategorie + Additional: Labels fließen horizontal */
div.category fieldset,
div.additional fieldset {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

/* ── Radio/Checkbox: als Pill-Labels ──────────────────────────── */
/* Input verstecken – das gesamte Label übernimmt die Interaktion  */
div.month input[type="radio"],
div.week input[type="radio"],
div.category input[type="radio"],
div.additional input[type="radio"],
div.additional input[type="checkbox"] {
    display: none;
}

/* Globale label-Overrides (Margin, white-space) für Filter-Labels */
div.month label,
div.week label,
div.category label,
div.additional label {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 2rem;
    font-size: 0.8rem;
    font-weight: 400;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    margin: 0;
    background: var(--card);
    color: var(--text);
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}

div.month label:hover,
div.week label:hover,
div.category label:hover,
div.additional label:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Aktiv: ausgewählte Option */
div.month label:has(input:checked),
div.week label:has(input:checked),
div.category label:has(input:checked),
div.additional label:has(input:checked) {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    font-weight: 500;
}

/* Mobile: Filterblöcke untereinander */
@media (max-width: 1000px) {
    #content form:has(> .month) {
        flex-direction: column;
        gap: 0.75rem;
    }
}


/* ── Content Tabs (z. B. PlayerPortraitCombineComponentTTCH) ─── */
ul.content-tabs {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

ul.content-tabs li a {
    display: block;
    padding: 0.4rem 0.9rem;
    color: var(--text-muted);
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 0.25rem 0.25rem 0 0;
    margin-bottom: -1px;
    font-size: 0.875rem;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
}

ul.content-tabs li a:hover {
    color: var(--primary);
    border-color: var(--border) var(--border) transparent;
}

ul.content-tabs li.selected a {
    color: var(--text);
    background-color: var(--surface);
    border-color: var(--border) var(--border) var(--surface);
    font-weight: 500;
}


/* ── Tabellen ─────────────────────────────────────────────────── */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

th {
    text-align: left;
    padding: 0.55rem 0.6rem;
    font-weight: 600;
}

td {
    padding: 0.55rem 0.6rem;
    border-top: 1px solid var(--border);
}


/* ── Footer ───────────────────────────────────────────────────── */
#footer {
    padding: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
    overflow: hidden; /* Clearfix für gefloatete #footer-left/right + Banner-Overflow */
}

#footer a       { text-decoration: none; }
#footer a:hover { text-decoration: underline; }

/* Banner im Footer auf mobilen Viewports ausblenden */
@media (max-width: 1000px) {
    #footer-right { display: none; }
}


/* ================================================================
   RESPONSIVE / MOBILE  (Breakpoint: 1000px)
   ================================================================ */
@media (max-width: 1000px) {

    #hamburger-btn {
        display: block;
    }

    /* Row: umbrechen erlauben + Gap entfernen (Navigation ist fixed, nicht im Flow) */
    .row:has(#navigation) {
        flex-wrap: wrap;
        gap: 0;
    }

    /* Header kompakter + horizontales Padding reduzieren */
    #header {
        height: 3.25rem;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    /* Logo-Breite auf kleinen Screens reduzieren */
    #logo a::before {
        width: 90px;
    }

    /* Horizontales Padding durchgehend auf 0.5rem reduzieren */
    #breadcrumb,
    nav[aria-label="breadcrumb"] {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    #tabs {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    /* Minimales Padding auf mobilen Viewports */
    main .container-fluid {
        padding-top: 0.5rem;
        padding-right: 0.5rem;
        padding-left: 0.5rem;
    }

    /* Weniger Innenabstand, kein Radius (Edge-to-Edge auf schmalem Viewport) */
    #content {
        padding: 0.5rem;
        border-radius: 0;
        box-shadow: none;
    }

    #footer {
        padding: 0.75rem 0.5rem;
    }

    /* Content-Tabs kompakter */
    ul.content-tabs li a {
        padding: 0.3rem 0.6rem;
    }

    /* Tabellen horizontal scrollbar statt gequetscht */
    #content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }

    /* Navigation als Offcanvas – aus dem Grid-Flow herausnehmen */
    #navigation {
        position: fixed;
        top: 0;
        left: -260px;
        height: 100%;
        width: 240px;
        z-index: 1045;
        border-radius: 0;
        box-shadow: none;
        transition: left 0.3s ease;
        overflow-y: auto;
    }

    #navigation.open {
        left: 0;
        box-shadow: 4px 0 12px rgba(0, 0, 0, 0.18);
    }
}

@media print {
    .no-print    { display: none !important; }
    #navigation  { display: none; }
}


/* ── Language Switcher ──────────────────────────────────────── */
#language-switcher li a,
#language-switcher li.selected {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-decoration: none;
    opacity: 0.7;
}

#language-switcher li a         { color: var(--text-light); transition: opacity 0.15s; }
#language-switcher li a:hover   { opacity: 1; text-decoration: underline; }
#language-switcher li.selected  { color: var(--text); opacity: 1; cursor: default; }




/* ── Liga-Matrix ────────────────────────────────────────────── */
table.matrix {
    border-collapse: separate;
    border-spacing: 0;
    width: auto;
    margin-bottom: 1.25rem;
}

table.matrix td {
    vertical-align: top;
    min-width: 140px;
    padding: 0.65rem 0.9rem;
    background: var(--card);
    border-top: 3px solid var(--primary);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

table.matrix td:first-child { border-left: 1px solid var(--border); border-radius: var(--radius) 0 0 var(--radius); }
table.matrix td:last-child  { border-radius: 0 var(--radius) var(--radius) 0; }

table.matrix h2 {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-light);
    margin-bottom: 0.45rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

table.matrix ul         { list-style: none; margin: 0; padding: 0; }
table.matrix h2 ~ h2    { margin-top: 1rem; }
table.matrix ul + ul    { margin-top: 0.6rem; padding-top: 0.6rem; border-top: 1px dashed var(--border); }
table.matrix li         { font-size: 0.82rem; line-height: 1.7; }
table.matrix li a       { color: var(--primary); text-decoration: none; transition: opacity 0.15s; }
table.matrix li a:hover { opacity: 0.75; text-decoration: underline; }
table.matrix tr:hover td { background: var(--card); }

table.matrix td.contestTypeBanner { border-top-color: var(--border); min-width: auto; padding: 0.5rem; opacity: 0.85; }
