/* ════════════════════════════════════════════════════════════════════
   MatchChase — MOBILE LEAGUE (lig sayfası)
   ════════════════════════════════════════════════════════════════════
   SCOPE: Lig sayfası mobil kuralları — dashboard-header, tab bar
   (12-sütun grid 4+2 üst-alt), Takımlar, Puan Tablosu, Lig Fikstürü,
   Teknik Direktörler, Hakemler.

   İLGİLİ VIEW DOSYALARI:
     - mc_teams.js (mc-teams-table)
     - mc_standings.js (mc-standings-table)
     - mc_fixtures.js (mc-league-fixtures-table)
     - mc_officials.js (mc-managers-table + mc-referees-table)

   Önceki konumu: css/style.css @media (max-width: 900px) bloğu
   Pattern memory: project_oturum_2026_05_10_lig_sayfasi_mobil
   ════════════════════════════════════════════════════════════════════ */

@media (max-width: 900px) {

    /* ════════════════════════════════════════════════════════════════
       Lig sayfası header — stats DOM-move ile league-info-text içine
       ════════════════════════════════════════════════════════════════ */
    .stats {
        gap: 1rem;
    }

    .dashboard-header {
        /* Mobilde stats bloğu JS DOM move ile .league-info-text içine alındı,
           dolayısıyla header artık tek-row: logo solda, metin bloğu sağda.
           Padding üst-alt dengeli, sol-sağ kompakt. */
        flex-direction: row;
        align-items: center;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
    }
    /* Stats league-info-text içindeyken alt yazının altında yatay tek satır */
    .league-info-text > .stats {
        flex-direction: row !important;
        align-items: center !important;
        gap: 0.35rem;
        margin-top: 6px;
    }

    .stat-box {
        align-items: flex-start;
    }

    /* ════════════════════════════════════════════════════════════════
       Lig sayfası tab bar — 12-sütun CSS Grid (4 üst + 2 alt ortada)
       ════════════════════════════════════════════════════════════════ */
    /* Lig sayfası tab buton padding'leri — mobilde sol-sağ yarı yarıya kompakt
       (default 0.6rem 1.75rem → 0.6rem 0.875rem). Üst-alt korunur (touch hedefi). */
    .tab-btn {
        padding: 0.6rem 0.875rem !important;
    }
    /* Mobilde tab bar 2 satır CSS Grid:
         4 sütun eşit dağılım — sol-sağ kenarları sayfa içeriğiyle aynı hizada.
         Üst satır: 4 tab her bir sütuna yerleşir.
         Alt satır: managers (col 1-2 span, sağa yaslı) + referees (col 3-4 span, sola yaslı)
                   = ikisi ortada bitişik durur.
       row-gap 0 ile alt satır üst satıra yapıştırılır. */
    .stats-tabs {
        display: grid !important;
        grid-template-columns: repeat(12, 1fr) !important;
        gap: 0 !important;
        width: 100% !important;
    }
    /* 12 sütun şablonu — uzun "Tahmin ve Sonuçlar" daha geniş, kısa "Takımlar" daha dar */
    .tab-btn[data-target="teams"]       { grid-column: 1 / 3;  grid-row: 1; }
    .tab-btn[data-target="standings"]   { grid-column: 3 / 6;  grid-row: 1; }
    .tab-btn[data-target="fixtures"]    { grid-column: 6 / 9;  grid-row: 1; }
    .tab-btn[data-target="predictions"] { grid-column: 9 / 13; grid-row: 1; }
    /* Alt satır: managers sol yarı (1-6) sağa yaslı, referees sağ yarı (7-12) sola yaslı → ortada bitişik
       Asimetriyi önlemek için ikisi de min-width:110 (managers content-width) — referees daha küçük olduğu
       için ekstra padding alır, butonlar eşit genişlikte oluşur, merkez üst tab merkeziyle çakışır. */
    .tab-btn[data-target="managers"]    { grid-column: 1 / 7;  grid-row: 2; justify-self: end; min-width: 110px; }
    .tab-btn[data-target="referees"]    { grid-column: 7 / 13; grid-row: 2; justify-self: start; min-width: 110px; }
    /* Tab içi metin tek satır — wrap yok */
    .tab-btn { white-space: nowrap; }

    /* ════════════════════════════════════════════════════════════════
       Lig > Takımlar tablosu — 6 sütun
       1) Logo (26), 2) Takım Adı (kalan + ellipsis), 3) Kadro (40),
       4) Yaş Ort (30), 5) Boy Ort (30), 6) Piyasa Değeri (60)
       ════════════════════════════════════════════════════════════════ */
    .mc-teams-table th.mc-tt-logo,
    .mc-teams-table td.mc-tt-logo {
        width: 26px !important;
        min-width: 26px !important;
        padding: 0.4rem 0 0.4rem 0.4rem !important;
    }
    .mc-teams-table th:nth-child(2),
    .mc-teams-table td:nth-child(2) {
        width: auto !important;
        padding: 0.4rem 0.4rem !important;
        text-align: left !important;  /* başlık ve içerik sola yaslı */
    }
    /* Uzun takım adı (Brighton & Hove Albion, Wolverhampton Wanderers vs) ellipsis ile kısaltılır */
    .mc-teams-table td:nth-child(2) {
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 0;  /* table cell ellipsis trick — auto growth + ellipsis kombo */
    }
    .mc-teams-table td:nth-child(2) > span {
        display: block;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .mc-teams-table th:nth-child(3),
    .mc-teams-table td:nth-child(3) {
        width: 40px !important;
        min-width: 40px !important;
        padding: 0.4rem 0.15rem !important;
        text-align: center;
    }
    .mc-teams-table th:nth-child(4),
    .mc-teams-table td:nth-child(4),
    .mc-teams-table th:nth-child(5),
    .mc-teams-table td:nth-child(5) {
        width: 30px !important;
        min-width: 30px !important;
        padding: 0.4rem 0.1rem !important;
        text-align: center;
    }
    .mc-teams-table th:nth-child(6),
    .mc-teams-table td:nth-child(6) {
        width: 60px !important;
        min-width: 60px !important;
        padding: 0.4rem 6.6px 0.4rem 0.2rem !important;
        text-align: right !important;  /* hem başlık hem td sağa yaslı (simetrik) */
    }
    /* Sayı td'leri tek satır */
    .mc-teams-table td:nth-child(3),
    .mc-teams-table td:nth-child(4),
    .mc-teams-table td:nth-child(5),
    .mc-teams-table td:nth-child(6) {
        white-space: nowrap;
    }
    /* Tüm satır td'leri eşit font ve dikey padding (başlıklar dokunulmuyor) */
    .mc-teams-table tbody td:nth-child(1n) {
        font-size: 0.85rem !important;
        padding-top: 4px !important;
        padding-bottom: 4px !important;
    }

    /* ════════════════════════════════════════════════════════════════
       Lig > Puan Tablosu — 12 sütun sütun cerrahisi
       Logo 22, # 18, TAKIM auto+ellipsis, O/G/B/M/A/Y/P 15, AV 22, FORM 83
       ════════════════════════════════════════════════════════════════ */
    .mc-standings-table th.mc-st-logo,
    .mc-standings-table td.mc-st-logo {
        width: 22px !important;
        min-width: 22px !important;
        padding: 0.4rem 0 0.4rem 0.3rem !important;
    }
    .mc-standings-table td.mc-st-logo img.st-logo {
        width: 17px !important;
        height: 17px !important;
    }
    /* FORM sütunu 87→83 (3-4px daha dar) */
    .mc-standings-table th:nth-child(12),
    .mc-standings-table td:nth-child(12) {
        width: 83px !important;
        min-width: 83px !important;
        max-width: 83px !important;
    }
    /* # sütunu 2 dijit sığsın (11, 12...) — sıkıştırılmış padding */
    .mc-standings-table th:nth-child(1),
    .mc-standings-table td:nth-child(1) {
        width: 18px !important;
        min-width: 18px !important;
        padding-left: 2px !important;
        padding-right: 2px !important;
        white-space: nowrap;
    }
    /* O G B M A Y P — kullanıcı isteği 15px (kalan piksel TAKIM'a kayar) */
    .mc-standings-table th:nth-child(4),
    .mc-standings-table td:nth-child(4),
    .mc-standings-table th:nth-child(5),
    .mc-standings-table td:nth-child(5),
    .mc-standings-table th:nth-child(6),
    .mc-standings-table td:nth-child(6),
    .mc-standings-table th:nth-child(7),
    .mc-standings-table td:nth-child(7),
    .mc-standings-table th:nth-child(8),
    .mc-standings-table td:nth-child(8),
    .mc-standings-table th:nth-child(9),
    .mc-standings-table td:nth-child(9),
    .mc-standings-table th:nth-child(11),
    .mc-standings-table td:nth-child(11) {
        width: 15px !important;
        min-width: 15px !important;
        padding-left: 1px !important;
        padding-right: 1px !important;
        white-space: nowrap;
    }
    /* AV "+41" / "-38" 3 karakter */
    .mc-standings-table th:nth-child(10),
    .mc-standings-table td:nth-child(10) {
        width: 22px !important;
        min-width: 22px !important;
        padding-left: 2px !important;
        padding-right: 2px !important;
        white-space: nowrap;
    }
    /* TAKIM (3.) — kalan alan + ellipsis (uzun adlar Manchester City Manc... şeklinde) */
    .mc-standings-table td:nth-child(3) {
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 0;
    }
    /* Tüm satır td'leri eşit font */
    .mc-standings-table tbody td {
        font-size: 0.75rem !important;
    }

    /* ════════════════════════════════════════════════════════════════
       Lig Fikstürü tablosu — 7 sütun
       TARİH 62 ("04/05/26" + "Pzt, 22:00" alt alta), MS 35, İY 30,
       Aksiyon 18×2 (chevron + istatistik), sağ kenar padding 6
       ════════════════════════════════════════════════════════════════ */
    .mc-league-fixtures-table th:first-child,
    .mc-league-fixtures-table td:first-child {
        width: 62px !important;
        min-width: 62px !important;
        padding-left: 4px !important;
        padding-right: 4px !important;
        text-align: center;
        white-space: normal;
        line-height: 1.2;
    }
    /* MS sütunu (3.) — skor kutusu için 35 yeter */
    .mc-league-fixtures-table th:nth-child(3),
    .mc-league-fixtures-table td:nth-child(3) {
        width: 35px !important;
        min-width: 35px !important;
        padding-left: 2px !important;
        padding-right: 2px !important;
    }
    /* İY sütunu (4.) — 30 yeter */
    .mc-league-fixtures-table th:nth-child(4),
    .mc-league-fixtures-table td:nth-child(4) {
        width: 30px !important;
        min-width: 30px !important;
        padding-left: 2px !important;
        padding-right: 2px !important;
    }
    /* Aksiyon sütunları (6=chevron + 7=istatistik) — her biri 18px */
    .mc-league-fixtures-table th:nth-child(6),
    .mc-league-fixtures-table td:nth-child(6),
    .mc-league-fixtures-table th:nth-child(7),
    .mc-league-fixtures-table td:nth-child(7) {
        width: 18px !important;
        min-width: 18px !important;
        padding-left: 1px !important;
        padding-right: 1px !important;
        text-align: center;
    }
    /* Sağ kenar padding (kullanıcı isteği 6px) */
    .mc-league-fixtures-table tr > th:last-child,
    .mc-league-fixtures-table tr > td:last-child {
        padding-right: 6px !important;
    }
    /* Kırmızı kart ikonları — lig fikstür mobilde yarı boy + dar boşluk (3-4 tane sığsın) */
    .mc-league-fixtures-table td span[title][style*="background: #ef4444"],
    .mc-league-fixtures-table td span[title][style*="background:#ef4444"] {
        width: 7px !important;
        height: 9px !important;
        margin: 0 1px !important;
    }
    /* TD değişimi badge'i — kırmızı kart oranına yakın kompakt rozet (9×11 visual).
       İçindeki fa-arrows-rotate ikonu font-size 0.5rem ile rozete sığar. Tıklama alanı pseudo ile genişler. */
    .mc-league-fixtures-table td .mc-td-change-badge {
        width: 9px !important;
        height: 11px !important;
        padding: 0 !important;
        margin: 0 1px !important;
        font-size: 0.5rem !important;
        line-height: 1 !important;
        border-radius: 2px !important;
        position: relative;
    }
    .mc-league-fixtures-table td .mc-td-change-badge::after {
        content: '';
        position: absolute;
        top: -10px;
        bottom: -10px;
        left: -8px;
        right: -8px;
    }

    /* ════════════════════════════════════════════════════════════════
       mc-managers-table SCOPE — Teknik Direktörler tab'ı (mobile only)
       Lig sayfası /tab/managers — desktop dokunulmuyor.
       ════════════════════════════════════════════════════════════════ */
    /* fixed-layout: width !important kurallarının auto-layout'ta yenilmemesi için */
    .mc-managers-table { table-layout: fixed !important; }
    /* Sıralama oku başlık altı 2. satıra düşsün */
    .mc-managers-table thead th > span {
        display: block !important;
        margin-left: 0 !important;
    }
    /* GLB / BER / MAĞ sütunları sabit 20px (3, 4, 5) */
    .mc-managers-table th:nth-child(3),
    .mc-managers-table td:nth-child(3),
    .mc-managers-table th:nth-child(4),
    .mc-managers-table td:nth-child(4),
    .mc-managers-table th:nth-child(5),
    .mc-managers-table td:nth-child(5) {
        width: 20px !important;
        min-width: 20px !important;
        max-width: 20px !important;
        padding-left: 1px !important;
        padding-right: 1px !important;
    }
    /* MS sabit 26px; TD adı (1) auto → kalan alanı yutar. */
    .mc-managers-table th:nth-child(2),
    .mc-managers-table td:nth-child(2) {
        width: 26px !important;
        min-width: 26px !important;
        max-width: 26px !important;
    }
    /* G % min 35px (body "%100" 24 + padding 4.6+6) */
    .mc-managers-table th:nth-child(7),
    .mc-managers-table td:nth-child(7) {
        width: 35px !important;
        min-width: 35px !important;
        max-width: 35px !important;
        padding-right: 6px !important;
    }
    /* MBP 34px */
    .mc-managers-table th:nth-child(8),
    .mc-managers-table td:nth-child(8) {
        width: 34px !important;
        min-width: 34px !important;
        max-width: 34px !important;
        padding-right: 6px !important;
    }
    /* GOL (A-Y) sabit 56px */
    .mc-managers-table th:nth-child(6),
    .mc-managers-table td:nth-child(6) {
        width: 56px !important;
        min-width: 56px !important;
        max-width: 56px !important;
    }
    /* Ortalamanın üst/alt zemini — caret ikonu yerine soft renk (mobile only) */
    .mc-managers-table td.mc-cell-above {
        background: rgba(80, 130, 0, 0.22) !important;
    }
    .mc-managers-table td.mc-cell-below {
        background: rgba(220, 50, 50, 0.18) !important;
    }
    /* TD adı sütunundaki sol ikon — margin yarıya (8→4) */
    .mc-managers-table tbody td:first-child .fa-user-tie {
        margin-right: 4px !important;
    }
    /* Sayı sütunlarında dijit hizası — virgüller/noktalar dikey hizalı */
    .mc-managers-table tbody td:not(:first-child),
    .mc-managers-table thead th:not(:first-child) {
        font-variant-numeric: tabular-nums;
    }

    /* ════════════════════════════════════════════════════════════════
       mc-referees-table SCOPE — Hakemler tab'ı (mobile only)
       Lig sayfası /tab/referees — desktop dokunulmuyor.
       ════════════════════════════════════════════════════════════════ */
    .mc-referees-table { table-layout: fixed !important; }
    .mc-referees-table thead th > span {
        display: block !important;
        margin-left: 0 !important;
    }
    .mc-referees-table tbody td.mc-cell-above {
        background: rgba(80, 130, 0, 0.22) !important;
    }
    .mc-referees-table tbody td.mc-cell-below {
        background: rgba(220, 50, 50, 0.18) !important;
    }
    .mc-referees-table tbody td:first-child .fa-stopwatch {
        margin-right: 4px !important;
    }
    /* Hakem adı uzun olunca wrap yerine sondan ellipsis ("Alejandro Hernandez Her…") */
    .mc-referees-table tbody td:first-child {
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    .mc-referees-table tbody td:not(:first-child),
    .mc-referees-table thead th:not(:first-child) {
        font-variant-numeric: tabular-nums;
    }
    /* Default sütun genişlikleri — sütun cerrahisi turunda kullanıcı düzeltir */
    .mc-referees-table th:nth-child(2),
    .mc-referees-table td:nth-child(2) {
        width: 26px !important;
        min-width: 26px !important;
        max-width: 26px !important;
    }
    /* B % — 30px (header + "%26" sığsın diye 26→30) */
    .mc-referees-table th:nth-child(4),
    .mc-referees-table td:nth-child(4) {
        width: 30px !important;
        min-width: 30px !important;
        max-width: 30px !important;
    }
    /* EV % — 40px */
    .mc-referees-table th:nth-child(3),
    .mc-referees-table td:nth-child(3) {
        width: 40px !important;
        min-width: 40px !important;
        max-width: 40px !important;
    }
    /* DEP % — 42px (kullanıcı 2026-05-10) */
    .mc-referees-table th:nth-child(5),
    .mc-referees-table td:nth-child(5) {
        width: 42px !important;
        min-width: 42px !important;
        max-width: 42px !important;
    }
    /* TOP GOL — 32px (4 haneli gol toplamı sığsın) */
    .mc-referees-table th:nth-child(6),
    .mc-referees-table td:nth-child(6) {
        width: 32px !important;
        min-width: 32px !important;
        max-width: 32px !important;
    }
    /* ORT GOL — 30px */
    .mc-referees-table th:nth-child(7),
    .mc-referees-table td:nth-child(7) {
        width: 30px !important;
        min-width: 30px !important;
        max-width: 30px !important;
    }
}
