/* ============================================================
   Ön yüz — koyu, sade, hizalı canlı yayın teması
   Ortak container: header + içerik + footer aynı genişlik/hiza.
   ============================================================ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #f4f6f9;
    --surface: #ffffff;
    --surface-2: #f1f4f8;
    --surface-3: #e7ecf2;
    --text: #0e131c;
    --text-soft: #444d5c;
    --text-muted: #838c9b;
    --primary: #10a54a;
    --primary-strong: #0c8f3f;
    --primary-ink: #ffffff;
    --primary-soft: rgba(16, 165, 74, .10);
    --live: #dc2626;
    --border: #e4e8ee;
    --border-strong: #d2d8e0;
    --ring: rgba(16, 165, 74, .24);
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 8px 26px -16px rgba(14, 19, 28, .22);
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --container: 1160px;
    --header-h: 64px;
}

body.dark {
    --bg: #090c11;
    --surface: #151b24;
    --surface-2: #1c232e;
    --surface-3: #253040;
    --text: #eef1f6;
    --text-soft: #a3acbb;
    --text-muted: #66707e;
    --primary: #26d366;
    --primary-strong: #1eb757;
    --primary-ink: #04140a;
    --primary-soft: rgba(38, 211, 102, .14);
    --live: #ff4d5e;
    --border: #263143;
    --border-strong: #34435a;
    --ring: rgba(38, 211, 102, .28);
    --shadow: 0 18px 44px -26px rgba(0, 0, 0, .85);
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 15px; line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
    display: flex; flex-direction: column;
}

a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; }
button { font-family: inherit; }

/* Ortak hizalama kabı — header, main, footer hepsi bunu kullanır */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }

/* ── Reklam alanları ─────────────────────────────────────── */
.page-skin, .mobile-banner { display: none; }

/* Mobil banner: header üstünde, sadece dar ekran */
.mobile-banner img { display: block; width: 100%; height: auto; }
@media (max-width: 1199px) {
    .mobile-banner.on { display: block; line-height: 0; }
}

/* Liste arası reklam */
.list-ad { display: block; margin: 8px 0; line-height: 0; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.list-ad img { width: 100%; height: auto; display: block; }

/* Footer reklamı (kapatılabilir, sabit alt) */
.footer-ad {
    position: fixed; left: 50%; transform: translateX(-50%); bottom: 12px; z-index: 60;
    width: max-content; max-width: calc(100% - 24px);
    padding: 6px; line-height: 0;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px; box-shadow: var(--shadow);
}
.footer-ad-media { display: block; line-height: 0; }
.footer-ad img { display: block; max-width: 100%; height: auto; border-radius: 8px; }
.footer-ad-close {
    position: absolute; top: -12px; right: -12px; z-index: 1;
    width: 28px; height: 28px; display: grid; place-items: center;
    border-radius: 50%; border: 1px solid var(--border);
    background: var(--surface); color: var(--text); cursor: pointer; box-shadow: var(--shadow);
}
.footer-ad-close:hover { color: var(--live); }
.footer-ad.hidden { display: none; }

/* Masaüstü page skin: sabit arka plan, yanlarda görünür */
@media (min-width: 1200px) {
    .page-skin.on {
        display: block; position: fixed; inset: 0; z-index: 0;
        background-repeat: no-repeat;
        background-position: top center;
        background-size: cover;
        cursor: pointer;
    }
    /* İçerik skin'in üstünde ve tıklanabilir; başlık bandının boş kısmı
       skin tıklamasını engellemesin diye yalnızca bar tıklanabilir. */
    body.has-skin .site-header { pointer-events: none; }
    body.has-skin .header-bar,
    body.has-skin .main,
    body.has-skin .site-footer { position: relative; z-index: 1; pointer-events: auto; }
}

/* ── Header ──────────────────────────────────────────────── */
/* Bar tam olarak içerik bloğuyla (stage) aynı kenarlarda: container'ın
   iç boşluğu dışarıda kalır, bar ise onun içinde stage genişliğinde durur. */
.site-header { position: sticky; top: 0; z-index: 50; }
.header-bar {
    position: relative;
    display: flex; align-items: center; gap: 20px; height: var(--header-h);
    padding: 0 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    margin-top: 14px;
}

.brand { display: flex; align-items: center; font-weight: 800; font-size: 20px; letter-spacing: -.5px; color: var(--text); white-space: nowrap; }
.brand-logo { height: 34px; width: auto; max-width: 200px; display: block; object-fit: contain; }

.nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav a {
    padding: 8px 13px; border-radius: 8px;
    color: var(--text-soft); font-weight: 600; font-size: 14px;
    transition: background .15s, color .15s;
}
.nav a:hover { background: var(--surface-3); color: var(--text); }
.nav a.active { color: var(--primary); background: var(--primary-soft); }

.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
    display: inline-grid; place-items: center; width: 40px; height: 40px;
    border: 1px solid var(--border); background: var(--surface-2); color: var(--text-soft);
    border-radius: 10px; cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); border-color: var(--border-strong); }
.only-mobile { display: none; }
.ico-sun { display: none; }
body.dark .ico-moon { display: none; }
body.dark .ico-sun { display: block; }

/* ── Main ────────────────────────────────────────────────── */
.main { flex: 1; padding: 26px 20px 60px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.stage { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: stretch; }

/* Sol kolon yüksekliği satırı belirler; panel mutlak konumla o yüksekliğe uyar,
   böylece listenin alt kenarı "Şu an oynatılıyor" çubuğuyla hizalanır. */
.panel-col { position: relative; }
.panel-col .panel { position: absolute; inset: 0; }

.player-card { display: flex; flex-direction: column; gap: 12px; }
.player {
    position: relative; background: #05070a; border-radius: var(--radius);
    overflow: hidden; aspect-ratio: 16 / 9;
    border: 1px solid var(--border); box-shadow: var(--shadow);
}
.player iframe { width: 100%; height: 100%; display: block; border: 0; }
.player-badge {
    position: absolute; top: 14px; left: 14px; z-index: 3;
    display: inline-flex; align-items: center; gap: 7px;
    padding: 5px 11px; border-radius: 7px;
    background: rgba(10, 13, 18, .72);
    color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .7px;
    border: 1px solid rgba(255, 255, 255, .1);
    pointer-events: none;
}
.player-badge .live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--live); }

.now-playing {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; border-radius: var(--radius-sm);
    background: var(--surface); border: 1px solid var(--border);
    color: var(--text-soft); font-size: 13.5px; font-weight: 600;
}
.now-playing svg { color: var(--primary); flex-shrink: 0; }
.now-playing strong { color: var(--text); }

/* ── Player üstü/altı reklam bölgeleri (728×90) ── */
.player-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.player-ads { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
/* Tek reklam ortalanır; iki reklam yan yana paylaşır; üçüncü alt satıra kayar. */
.player-ad { flex: 1 1 320px; max-width: 728px; line-height: 0; }
.player-ad img {
    width: 100%; height: auto; display: block;
    border-radius: var(--radius-sm); border: 1px solid var(--border);
}

/* ── Panel ───────────────────────────────────────────────── */
.panel {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    display: flex; flex-direction: column;
}

.tabs {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px;
    padding: 7px; margin: 10px; border-radius: 11px;
    background: var(--surface-2); border: 1px solid var(--border);
}
.tab {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 4px; border: 1px solid transparent; border-radius: 8px;
    background: transparent; color: var(--text-muted);
    font-weight: 700; font-size: 12.5px; cursor: pointer;
    transition: background .15s, color .15s;
}
.tab svg { width: 16px; height: 16px; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.tab .tab-label { display: inline; }

.search { position: relative; padding: 4px 14px 10px; }
.search svg { position: absolute; left: 27px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.search input {
    width: 100%; padding: 12px 14px 12px 42px;
    border: 1px solid var(--border); border-radius: 10px;
    background: var(--surface-2); color: var(--text);
    font-size: 14px; font-family: inherit; outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.search input::placeholder { color: var(--text-muted); }
.search input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--ring); }

.lists { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 12px 14px; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.lists::-webkit-scrollbar { width: 6px; }
.lists::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 6px; }
.lists::-webkit-scrollbar-track { background: transparent; }

.list-head {
    display: flex; align-items: center; gap: 8px;
    margin: 14px 2px 8px; padding: 7px 12px; border-radius: 8px;
    background: var(--surface-2);
    color: var(--text-soft); font-size: 11px; font-weight: 800;
    letter-spacing: .8px; text-transform: uppercase;
}
.list-head:first-child { margin-top: 4px; }
.list-head svg { width: 15px; height: 15px; color: var(--primary); }

.mac {
    position: relative; display: grid;
    grid-template-columns: 52px 1fr auto; align-items: center; gap: 12px;
    padding: 12px 14px; margin: 7px 0;
    border: 1px solid var(--border); border-radius: 11px;
    background: var(--surface-2); cursor: pointer;
    transition: border-color .14s, background .14s;
}
.mac::before {
    content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 0; border-radius: 3px; background: var(--primary);
    transition: height .16s;
}
.mac:hover { border-color: var(--border-strong); background: var(--surface-3); }
.mac.active { border-color: var(--primary); background: var(--primary-soft); }
.mac.active::before { height: 62%; }

.mac .saat {
    display: grid; place-items: center; height: 34px;
    border-radius: 8px; background: var(--surface); border: 1px solid var(--border);
    font-weight: 800; font-size: 12.5px; color: var(--primary);
    font-variant-numeric: tabular-nums;
}
.mac.active .saat { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.mac .takimlar { font-weight: 650; font-size: 14px; color: var(--text); line-height: 1.3; }
.mac .lig {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 10px; font-weight: 800; letter-spacing: .6px;
    color: var(--live); text-transform: uppercase;
}
.mac .lig::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--live); }

.empty {
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    padding: 44px 16px; text-align: center; color: var(--text-muted); font-size: 14px;
}
.empty svg { width: 34px; height: 34px; opacity: .45; }

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 22px 0; text-align: center;
    color: var(--text-muted); font-size: 13.5px;
}
.site-footer a { color: var(--primary); font-weight: 600; }

/* ── Duyarlı ─────────────────────────────────────────────── */
@media (max-width: 940px) {
    .stage { grid-template-columns: 1fr; }
    .panel-col { position: static; }
    .panel-col .panel { position: static; }
    .lists { overflow: visible; max-height: none; }
}
@media (max-width: 620px) {
    .header-bar { gap: 12px; }
    /* .container ONCE gelmeli; sonra .main dikey boşluğu ezilmesin (header ile player yapışmasın) */
    .container { padding: 0 16px; }
    .main { padding: 18px 16px 50px; }
    .only-mobile { display: inline-grid; }
    /* İkonları (tema + menü) sağ kenara yasla; başlık dengelensin */
    .header-actions { margin-left: auto; }
    .tab .tab-label { display: none; }
    .tab svg { width: 18px; height: 18px; }
    .nav {
        position: absolute; top: calc(100% + 8px); left: 0; right: 0;
        flex-direction: column; align-items: stretch; gap: 4px; padding: 10px;
        background: var(--surface); border: 1px solid var(--border);
        border-radius: 14px; box-shadow: var(--shadow);
        display: none; z-index: 60;
    }
    .nav.open { display: flex; }
    .nav a { padding: 13px 14px; border-radius: 8px; }
}
