﻿:root { --text: #e5eefc; --muted: #94a3b8; --accent: #38bdf8; --accent-strong: #06b6d4; --panel: rgba(11, 19, 35, 0.92); --panel-border: rgba(148, 163, 184, 0.14); --shadow: 0 18px 40px rgba(2, 8, 23, 0.45); --grid-gap: 12px; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; color: var(--text); font-family: 'Inter', sans-serif; background: radial-gradient(circle at top left, rgba(34, 211, 238, 0.22), transparent 30%), radial-gradient(circle at top right, rgba(56, 189, 248, 0.14), transparent 26%), linear-gradient(180deg, #020617 0%, #040b17 100%); overflow: hidden; top: 0 !important; }
.app-shell { height: 100dvh; min-height: 100dvh; padding: 10px; display: grid; grid-template-rows: 1fr; gap: 0; overflow: hidden; }
.topbar { display: none; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-radius: 24px; background: linear-gradient(135deg, rgba(8, 15, 29, 0.95), rgba(15, 23, 42, 0.82)); border: 1px solid var(--panel-border); backdrop-filter: blur(18px); box-shadow: var(--shadow); }
.topbar-main { min-width: 0; flex: 1 1 auto; display: grid; grid-template-columns: auto minmax(280px, 1fr); align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 0 1 auto; }
.brand-stack { align-items: flex-start; }
.brand-icon { width: 40px; height: 40px; border-radius: 16px; display: grid; place-items: center; background: linear-gradient(135deg, rgba(34, 211, 238, 0.24), rgba(14, 165, 233, 0.82)); font-size: 18px; color: #fff; }
.brand-kicker { margin-bottom: 4px; color: #67e8f9; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.brand-title { margin: 0; font-family: 'Space Grotesk', sans-serif; font-size: 1.4rem; font-weight: 700; letter-spacing: -0.05em; white-space: nowrap; }
.market-tape-shell { min-width: 0; padding: 8px 12px 10px; border-radius: 18px; background: rgba(15, 23, 42, 0.54); border: 1px solid rgba(148, 163, 184, 0.1); }
.market-tape-header { margin-bottom: 6px; color: #7dd3fc; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.market-tape, .market-tape .tradingview-widget-container__widget { min-height: 36px; }
.market-tape-shell-bottom { width: 100%; border-radius: 18px; }
.toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; min-width: 0; flex: 1 1 auto; }
.glass-button, .glass-range-wrap, .toolbar-counts { min-height: 38px; border-radius: 12px; border: 1px solid var(--panel-border); background: rgba(15, 23, 42, 0.74); color: var(--text); }
.toolbar-counts { display: inline-flex; align-items: center; gap: 6px; padding: 4px; flex-wrap: wrap; max-width: 100%; }
#quick-count-anchor .toolbar-counts { width: 100%; }
.toolbar-count { min-width: 38px; height: 30px; padding: 0 10px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 0.82rem; font-weight: 700; }
.toolbar-count.active { background: linear-gradient(135deg, rgba(56, 189, 248, 0.34), rgba(14, 165, 233, 0.92)); color: #fff; }
.glass-button { padding: 0 12px; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; white-space: nowrap; }
.glass-button:hover { border-color: rgba(56, 189, 248, 0.45); color: #fff; }
.glass-range-wrap { display: inline-flex; align-items: center; gap: 8px; padding: 0 10px; }
#master-volume { width: 92px; accent-color: var(--accent); }
.workspace { min-height: 0; overflow: hidden; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 12px; }
.hero-strip { display: none; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.bottom-market { width: 100%; }
.hero-stat { padding: 14px 16px; border-radius: 18px; background: rgba(8, 15, 29, 0.82); border: 1px solid rgba(125, 211, 252, 0.12); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03); }
.hero-label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.video-grid { display: grid; grid-template-columns: repeat(12, 1fr); grid-auto-rows: minmax(140px, 1fr); gap: 12px; padding: 0; background: transparent; min-height: 0; }
body.focus-expanded .hero-strip { display: none; }
body.focus-expanded .workspace { grid-template-rows: 1fr; }
body.focus-expanded .video-grid { grid-template-columns: 1fr; grid-auto-rows: 1fr; min-height: 100%; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 260ms; animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1); }
::view-transition-group(root) { animation-duration: 260ms; }
.video-card { grid-column: span 12; position: relative; background: #000; border-radius: 22px; overflow: hidden; border: 1px solid rgba(125, 211, 252, 0.08); }
.video-card.is-main { border: 1px solid rgba(34, 211, 238, 0.45); box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.12), 0 24px 40px rgba(3, 10, 20, 0.42); }
.video-card.is-focus { border-color: rgba(56, 189, 248, 0.82); box-shadow: 0 20px 44px rgba(14, 165, 233, 0.18); }
.video-card.is-focus::after { content: ""; position: absolute; inset: 0; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: inherit; pointer-events: none; }
body.focus-expanded .video-card.is-expanded-card { min-height: 100%; height: 100%; border-radius: 26px; }
.player-shell, .card-hitbox { position: absolute; inset: 0; }
.player-shell { background: #000; }
.player-shell iframe, .player-shell video, .player-shell .yt-player { width: 100%; height: 100%; display: block; border: 0; pointer-events: none; }
.player-shell .embed-frame { pointer-events: auto; }
.card-hitbox { z-index: 1; border: 0; background: transparent; cursor: pointer; }
.card-overlay { position: absolute; inset: 0; z-index: 2; pointer-events: none; display: block; background: transparent; }
.focus-callout { position: absolute; right: 10px; bottom: 10px; z-index: 3; background: rgba(2, 8, 23, 0.72); display: none; pointer-events: none; }
.empty-state { height: 100%; border-radius: 20px; border: 1px dashed rgba(148, 163, 184, 0.22); background: rgba(15, 23, 42, 0.5); display: grid; place-items: center; text-align: center; padding: 24px; color: var(--muted); }
.offcanvas { width: min(440px, 92vw) !important; background: var(--panel); color: var(--text); border-left: 1px solid var(--panel-border); backdrop-filter: blur(18px); }
.offcanvas-header, .offcanvas-footer { border-color: rgba(148, 163, 184, 0.12) !important; }
.panel-section { padding: 14px; margin-bottom: 12px; border-radius: 16px; background: rgba(15, 23, 42, 0.58); border: 1px solid rgba(148, 163, 184, 0.12); }
.section-title { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 0.94rem; font-weight: 700; }
.section-caption { margin-bottom: 12px; color: var(--muted); font-size: 0.84rem; }
.translate-wrap { min-height: 44px; display: flex; align-items: center; justify-content: center; padding: 8px 10px; border-radius: 14px; background: rgba(2, 8, 23, 0.42); border: 1px solid rgba(148, 163, 184, 0.16); }
#google_translate_element { width: 100%; }
#google_translate_element .goog-te-gadget { color: transparent !important; font-family: 'Inter', sans-serif !important; font-size: 0 !important; }
#google_translate_element .goog-te-combo { width: 100%; min-height: 40px; border-radius: 10px; border: 1px solid rgba(148, 163, 184, 0.16); background: rgba(15, 23, 42, 0.88); color: #fff; padding: 0 10px; }
.goog-te-banner-frame.skiptranslate, iframe.skiptranslate, .goog-tooltip, #goog-gt-tt, .goog-text-highlight { display: none !important; }
.goog-text-highlight { background: transparent !important; box-shadow: none !important; }
.channel-list { display: flex; flex-direction: column; gap: 10px; }
.channel-row { display: grid; grid-template-columns: auto auto minmax(0, 1fr) minmax(0, 1.25fr) auto; gap: 10px; align-items: center; padding: 10px; border-radius: 14px; border: 1px solid rgba(148, 163, 184, 0.14); background: rgba(255, 255, 255, 0.04); }
.channel-row.sortable-ghost { opacity: 0.35; }
.drag-handle { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 12px; background: rgba(148, 163, 184, 0.12); color: #dbeafe; cursor: grab; }
.row-switch { width: 18px; height: 18px; accent-color: var(--accent); }
.channel-row .form-control, .panel-section .form-control, .panel-section .form-select { min-height: 42px; border-radius: 12px; border: 1px solid rgba(148, 163, 184, 0.16); background: rgba(2, 8, 23, 0.55); color: #fff; }
.channel-row .form-control::placeholder { color: rgba(226, 232, 240, 0.4); }
.btn-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 1px solid rgba(239, 68, 68, 0.2); background: rgba(239, 68, 68, 0.08); color: #fecaca; }
.panel-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.settings-fab { position: fixed; right: 16px; bottom: 16px; z-index: 1035; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 16px; border: 1px solid rgba(56, 189, 248, 0.28); background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(14, 165, 233, 0.88)); color: #fff; box-shadow: 0 18px 30px rgba(2, 8, 23, 0.34); cursor: pointer; }
.toast-wrap { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 1090; display: none; padding: 10px 16px; border-radius: 999px; background: rgba(2, 8, 23, 0.86); border: 1px solid rgba(56, 189, 248, 0.18); color: #fff; font-size: 0.84rem; font-weight: 600; }

@media (max-width: 992px) {
    body { overflow: auto; }
    .app-shell { height: auto; min-height: 100dvh; overflow: visible; }
    .topbar { flex-direction: column; align-items: stretch; }
    .topbar-main { grid-template-columns: 1fr; }
    .workspace { overflow: visible; }
    .hero-strip { grid-template-columns: 1fr; }
    .toolbar { justify-content: space-between; }
    .video-grid { height: auto; min-height: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(180px, 28vh); overflow: visible; }
    .video-card { grid-column: span 1 !important; }
    .video-card.is-main { grid-column: 1 / -1 !important; grid-row: span 2; }
}

@media (max-width: 768px) {
    .toolbar-counts, .glass-range-wrap, .glass-button { width: 100%; justify-content: center; }
    #master-volume { width: 100%; }
    .video-grid { grid-template-columns: 1fr; grid-auto-rows: minmax(180px, auto); gap: 12px; }
    .video-card { grid-column: 1 / -1 !important; grid-row: span 1 !important; }
    .video-card.is-main { grid-column: 1 / -1 !important; grid-row: span 1 !important; min-height: 46vh; }
    .card-overlay { padding: 12px; }
    .card-bottom, .card-actions { flex-direction: column; align-items: stretch; }
    .channel-row { grid-template-columns: auto auto 1fr; grid-template-areas: "drag active name" "drag active url" "drag active remove"; }
    .channel-row .drag-handle { grid-area: drag; align-self: stretch; }
    .channel-row .row-switch { grid-area: active; }
    .channel-row .channel-name { grid-area: name; }
    .channel-row .channel-url { grid-area: url; }
    .channel-row .btn-icon { grid-area: remove; justify-self: end; }
    .settings-fab { display: grid; }
}

.card-audio-toggle { position: absolute; right: 12px; bottom: 12px; z-index: 1040; width: 42px; height: 42px; border-radius: 12px; background: rgba(7, 17, 31, 0.85); backdrop-filter: blur(10px); border: 1px solid rgba(56, 189, 248, 0.3); color: var(--accent); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); }
.card-audio-toggle:hover { background: var(--accent); color: #fff; transform: scale(1.05); }
/* Ses kapalıyken ikon değişimi (isteğe bağlı) */
.card-audio-toggle.is-muted { color: #ef4444; border-color: rgba(239, 68, 68, 0.3); }

/* --- YENİ EKLENEN REKLAM VE CONTAINER DÜZENİ --- */
.main-content-wrapper { display: flex; flex-direction: row; gap: 16px; min-height: 0; width: 100%; height: 100%; overflow: hidden; }
.sp-slot { width: 250px; flex-shrink: 0; background: rgba(15, 23, 42, 0.4); border: 1px dashed rgba(148, 163, 184, 0.15); border-radius: 22px; display: none; place-items: center; text-align: center; color: var(--muted); font-size: 0.85rem; line-height: 1.5; overflow: hidden; }
.sp-placeholder { opacity: 0.6; }
@media (min-width: 1400px) { .sp-slot { display: grid; } }

#toggle-mute {float: right;}

/* Offcanvas içindeki body'nin taşmasını engelle */
#settingsPanel .offcanvas-body {
    height: 100%;
    overflow: hidden; /* Dışarıdan scroll olmasın */
}

/* İnce ve Modern Scrollbar Tasarımı */
.custom-scroll::-webkit-scrollbar {
    width: 6px; /* İnce genişlik */
}

.custom-scroll::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.custom-scroll::-webkit-scrollbar-thumb {
    background: #0dcaf0; /* btn-info rengiyle uyumlu */
    border-radius: 10px;
}

.custom-scroll::-webkit-scrollbar-thumb:hover {
    background: #0aa8c9;
}

/* Firefox için ince scrollbar */
.custom-scroll {
    scrollbar-width: thin;
    scrollbar-color: #0dcaf0 rgba(0, 0, 0, 0.1);
}

/* Kanal listesinin her zaman dolgun durması için */
.channel-list {
    min-height: 0; /* Flexbox içinde scroll çalışması için kritik */
}

/* Kanal bazlı yükleme ve hata katmanı */
.player-status-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 10;
    background: #0b0e11; /* Video yüklenirken arkası gözükmez */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 15px;
    text-align: center;
}

/* Preloader Animasyonu */
.player-loader {
    width: 35px; height: 35px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Kanal Adı Etiketi (Tasarımı bozmadan sol üstte) */
.channel-tag {
    position: absolute;
    top: 10px; left: 10px;
    z-index: 15;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
	pointer-events: auto !important; /* Tıklamayı aktif eder */
    cursor: pointer; /* Fare üzerine gelince el simgesi çıkar */
    z-index: 20; /* Butonların veya diğer katmanların altında kalmadığından emin ol */
    border: 1px solid rgba(255,255,255,0.1);
}
.channel-tag:hover {
    background: rgba(0, 0, 0, 0.9); /* Üzerine gelince hafif karararak tepki verir */
    border-color: var(--tv-cyan);
}

/* Hata Durumu */
.status-text { font-size: 13px; color: #a0a0a0; }
.error-msg { color: #ff4d4d; margin-bottom: 10px; }

/* Kanal ismi inputunu sadeleştirme */
.channel-name-flat {
    background: transparent !important;
    border: 1px solid transparent !important;
    color: var(--bs-gray-300) !important;
    font-weight: 500;
    transition: all 0.2s ease;
}
.channel-name-flat:focus {
    background: rgba(255,255,255,0.05) !important;
    border-color: rgba(255,255,255,0.1) !important;
    box-shadow: none !important;
}

/* URL alanı için gizleme/gösterme animasyonu */
.url-edit-wrapper {
    transition: all 0.3s ease;
    overflow: hidden;
}

/* Kanal satırı genel düzeni */
.channel-row {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 8px;
    padding: 8px;
}

/* İsim inputu - sadeleşmiş */
.channel-name-flat {
    background: transparent !important;
    border: none !important;
    color: #fff !important;
    box-shadow: none !important;
    padding-left: 10px !important;
}

/* Buton grubu sağda */
.channel-actions {
    display: flex;
    gap: 4px;
    margin-left: auto; /* Sağ tarafa yaslar */
}

/* URL alanı geçişi */
.url-toggle-area {
    display: none; /* Başlangıçta gizli */
    width: 100%;
}

.weather-block {
    padding: 2px 15px 2px 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    height: 48px;
    min-width: 140px;
}

.weather-icon-wrap img {
    width: 64px !important; /* İri ikon */
    height: 64px !important;
    margin-right: 10px;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.1));
}

.weather-text #w-temp {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.2rem;
    line-height: 1;
    color: #fff;
}

.weather-text .small-label {
    font-size: 0.65rem;
    color: var(--bs-info);
    letter-spacing: 1px;
    font-weight: 700;
    margin-top: 2px;
}

/* TELEFON ÖZEL AYARLARI (576px ve altı) */
@media (max-width: 576px) {
    /* Alt bant yüksekliğini ve iç boşluğunu daraltıyoruz */
    .market-tape-shell-bottom {
        height: 44px !important;
        padding: 0 8px !important;
        gap: 8px !important;
    }

    /* Hava Durumu: İkon ve metni küçültüyoruz */
    .weather-block {
        height: 34px !important;
        min-width: auto !important;
        padding: 0 6px !important;
        border-radius: 8px !important;
    }

    .weather-icon-wrap img {
        width: 32px !important; /* Mobilde ikon küçüldü */
        height: 32px !important;
        margin-right: 4px !important;
    }

    .weather-text #w-temp {
        font-size: 0.85rem !important; /* Derece küçüldü */
    }

    /* Mobilde yer kazanmak için 'Yükleniyor/Güneşli' yazısını gizliyoruz */
    .weather-text .small-label {
        display: none !important;
    }

    /* Ayarlar Butonu: Resmi küçültüyoruz */
    .settings-inline-btn {
        width: 34px !important;
        height: 34px !important;
    }

    .settings-inline-btn img {
        width: 48px !important; /* Ayarlar ikonu küçüldü */
        height: 48px !important;
    }

    /* TradingView Bandı: Mobilde daha akıcı görünmesi için */
    .market-tape {
        height: 34px !important;
    }
}

/* TV Plus refresh */
:root {
    --tv-bg: #060b14;
    --tv-panel: rgba(10, 18, 31, 0.92);
    --tv-panel-soft: rgba(16, 28, 46, 0.72);
    --tv-border: rgba(120, 144, 181, 0.18);
    --tv-border-strong: rgba(82, 196, 255, 0.28);
    --tv-cyan: #4dd7ff;
    --tv-blue: #1e7dff;
    --tv-grid-gap: 14px;
}

body {
    background:
        radial-gradient(circle at 12% 12%, rgba(30, 125, 255, 0.22), transparent 24%),
        radial-gradient(circle at 88% 10%, rgba(77, 215, 255, 0.14), transparent 24%),
        linear-gradient(180deg, #02050b 0%, #07111f 38%, #050914 100%);
}

.app-shell { padding: 12px; }
.workspace { gap: 14px; }
.video-grid { gap: var(--tv-grid-gap); grid-auto-rows: minmax(150px, 1fr); }

.video-card {
    border-radius: 24px;
    border: 1px solid var(--tv-border);
    background: linear-gradient(180deg, rgba(8, 15, 26, 0.2), rgba(2, 6, 14, 0.8)), #010409;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
    isolation: isolate;
}

.video-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 22%);
    pointer-events: none;
    opacity: 0.75;
}

.video-card.is-main {
    border-color: var(--tv-border-strong);
    box-shadow: 0 0 0 1px rgba(77, 215, 255, 0.16), 0 26px 46px rgba(0, 4, 12, 0.42);
}

.video-card.is-focus::after { border-color: rgba(77, 215, 255, 0.24); }

.channel-tag {
    top: 12px;
    left: 12px;
    padding: 6px 11px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(5, 12, 24, 0.92), rgba(15, 32, 56, 0.75));
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 11px;
    letter-spacing: 0.04em;
}

.card-overlay { background: linear-gradient(180deg, transparent 62%, rgba(1, 6, 14, 0.68) 100%); }
.player-status-overlay { background: radial-gradient(circle at top, rgba(31, 125, 255, 0.12), transparent 35%), #040a12; }
.player-loader { border-top-color: var(--tv-cyan); }

.offcanvas {
    background: radial-gradient(circle at top, rgba(30, 125, 255, 0.16), transparent 22%), var(--tv-panel);
}

.panel-section {
    background: var(--tv-panel-soft);
    border-radius: 18px;
    border-color: var(--tv-border);
}

.section-title { color: #eef6ff; }

.channel-list {
    gap: 14px;
    padding-bottom: 12px;
}

.channel-group {
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.025);
    overflow: hidden;
    content-visibility: auto;
    contain-intrinsic-size: 240px;
}

.channel-group.is-empty { display: none; }

.channel-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.channel-group-header strong {
    display: block;
    font-size: 0.92rem;
    letter-spacing: 0.01em;
}

.channel-group-meta {
    display: inline-block;
    margin-top: 3px;
    color: #8aa3c2;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.channel-group-count {
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(77, 215, 255, 0.12);
    color: #dff8ff;
    font-size: 0.82rem;
    font-weight: 700;
}

.channel-group-body { padding: 10px; }
.channel-cluster + .channel-cluster { margin-top: 12px; }

.channel-cluster-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    padding: 0 4px;
    color: #9ec9ff;
    font-size: 0.78rem;
    font-weight: 600;
}

.channel-cluster-label small {
    color: #7f91ab;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.channel-row {
    margin-bottom: 0;
    padding: 10px 12px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.018));
}

.channel-cluster .channel-row + .channel-row { margin-top: 8px; }
.channel-row-main { min-width: 0; width: calc(100% - 92px); }
.channel-name-flat { font-size: 0.96rem; }
.drag-handle { background: rgba(255, 255, 255, 0.08); }
.btn-icon { border-radius: 10px; }

.empty-state {
    background: linear-gradient(180deg, rgba(10, 18, 31, 0.72), rgba(6, 12, 22, 0.92));
    border: 1px dashed rgba(120, 144, 181, 0.24);
}

@media (max-width: 1200px) {
    .video-grid { grid-template-columns: repeat(10, 1fr); }
}

@media (max-width: 992px) {
    .video-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: minmax(180px, 24vw);
    }

    .video-card { grid-column: span 1 !important; }

    .video-card.is-main {
        grid-column: 1 / -1 !important;
        grid-row: span 2;
        min-height: 40vh;
    }
}

@media (max-width: 768px) {
    body { overflow: auto; }
    .app-shell { min-height: 100dvh; padding: 10px 10px 12px; }
    .main-content-wrapper { gap: 0; }

    .video-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: minmax(132px, 24vh);
        gap: 10px;
        align-content: start;
    }

    .video-card {
        grid-column: span 1 !important;
        min-height: 100px;
		margin-bottom: 15px;
    }

    .video-card.is-main {
        grid-column: 1 / -1 !important;
        grid-row: span 1 !important;
        min-height: 25vh;
		margin-bottom: 15px;
    }

    .video-card:nth-child(n+8) { display: none; }
    .channel-group-header { padding: 11px 12px; }
    .channel-group-body { padding: 8px; }
    .channel-row { padding: 10px; }
}

@media (max-width: 768px) {
    /* 1. Genel Mobil Temizlik ve Hazırlık */
    .app-shell { padding: 0 !important; }
    .sp-slot { display: none !important; }
    .workspace { gap: 0 !important; }
    
    .video-grid {
        display: grid !important;
        grid-template-columns: repeat(12, 1fr) !important; /* 12'lik sistem */
        grid-auto-rows: auto !important;
        gap: 4px !important; /* Mobilde daha dar boşluk */
        width: 100vw;
        padding-bottom: 60px !important; /* Alt bar payı */
    }

    /* --- Dinamik Kanal Sayısı Kontrolü (Dikey Mod) --- */

    /* Varsayılan: Tüm kanallar alt alta (1 Tam Ekran) */
    .video-card {
        grid-column: span 12 !important;
        grid-row: auto !important;
        aspect-ratio: 16 / 9;
        border: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    /* 4 Kanal Varsa: 2x2 Eşit Grid (Her biri 6 birim kaplar) */
    .video-grid:has(> :nth-child(4):last-child) .video-card {
        grid-column: span 6 !important;
        aspect-ratio: 16 / 10; /* Mobilde biraz daha karemsi daha iyi durur */
    }

    /* 6 Kanal Varsa: 2x3 Eşit Grid (Her biri 6 birim kaplar) */
    .video-grid:has(> :nth-child(6):last-child) .video-card {
        grid-column: span 6 !important;
        aspect-ratio: 16 / 10;
    }

    /* --- Yatay Mod (Landscape) Özel Düzenlemeler --- */
    @media (orientation: landscape) {
        .video-grid {
            padding-bottom: 45px !important;
        }

        /* 4 Kanal Yatayda: Yan yana 4'lü veya 2x2 tercih edilebilir. 
           Burada 2x2 devam ederek görüntü kalitesini koruyoruz. */
        .video-grid:has(> :nth-child(4):last-child) .video-card {
            grid-column: span 6 !important;
            height: 42vh !important; /* Ekranın yarısını kapla */
        }

        /* 6 Kanal Yatayda: Yan yana 3'lü (3x2 düzeni) */
        .video-grid:has(> :nth-child(6):last-child) .video-card {
            grid-column: span 4 !important; /* 12 / 4 = 3 sütun */
            height: 42vh !important;
        }

        .brand-title { display: none !important; }
    }

    /* 4. Sabit Alt Bar Düzenlemeleri */
    .bottom-market {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 50px !important;
        z-index: 2000 !important;
        background: rgba(4, 10, 20, 0.98) !important;
        backdrop-filter: blur(10px);
        border-top: 1px solid var(--tv-border);
        padding: 0 10px !important;
    }

    .market-tape-shell-bottom {
        display: flex !important;
        align-items: center;
        gap: 8px !important;
        height: 100%;
    }
}

/* Masaüstü için Full-Ekran Yerleşimi */
@media (min-width: 992px) {
    /* İhtiyaç halinde reklam alanlarını (aside) gizle */
    .sp-slot { display: none !important; } 
    
    .app-shell { 
        padding: 0; /* Kenar boşluklarını sıfırla */
    }

    .video-grid {
        display: grid;
        grid-template-columns: repeat(12, 1fr);
        grid-auto-rows: 1fr; /* Satırların dikeyde ekranı tam kaplamasını sağlar */
        gap: 0; /* Görseldeki gibi boşluksuz, sadece border ile ayır */
        height: 88vh; /* Ekranın tamamını kapla */
        width: 90vw;
    }

    .video-card {
        border-radius: 0; /* Köşeleri sıfırla (CCTV stili) */
        border: 1px solid rgba(255, 255, 255, 0.1); /* İnce bölme çizgisi */
        background: #000;
    }

    .video-card.is-main {
        border: 1px solid var(--tv-cyan); /* Ana ekrana ince bir neon çerçeve */
        z-index: 5;
    }
}

/* Videonun içindeki siyah boşlukları engellemek için */
.player-shell video, 
.player-shell iframe {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain; /* Görüntüyü kırpmaz, en-boy oranını korur */
    background: #000;
}

.card-action-bar {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 1040;
    display: flex;
    gap: 8px;
    pointer-events: auto; /* Butonların tıklanabilir olması için şart */
}

.card-action-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(7, 17, 31, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(56, 189, 248, 0.2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.card-action-btn:hover {
    background: var(--tv-cyan);
    color: #000;
    transform: translateY(-2px);
    border-color: #fff;
}

/* Aktif odağa sahip kartın butonları daha belirgin olsun */
.video-card.is-focus .card-action-btn {
    border-color: var(--tv-cyan);
}

.card-action-btn i {
    font-size: 16px;
}

.card-action-bar {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 1040;
    display: flex;
    flex-direction: column; /* Alt alta */
    gap: 6px;
    pointer-events: auto;
}

.card-action-btn {
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(5px);
    color: #fff;
    border-radius: 8px;
    display: grid;
    place-items: center;
}

/* Aktif ses kanalının butonu parlasın */
.card-audio-toggle.btn-info {
    background: var(--tv-cyan) !important;
    color: #000 !important;
    border-color: #fff;
    box-shadow: 0 0 10px var(--tv-cyan);
}

@keyframes spin { 100% { transform: rotate(360deg); } }
.fa-spin { animation: spin 1s linear infinite; }

/* Aktif Çerçeve (Border) Stili */
.video-card.is-active-border {
    border: 2px solid var(--tv-cyan) !important;
    box-shadow: inset 0 0 15px rgba(77, 215, 255, 0.3), 0 0 20px rgba(77, 215, 255, 0.2);
    z-index: 10;
}

.video-card:hover .card-action-bar {
    opacity: 1;
}

.card-action-btn {
    width: 34px;
    height: 34px;
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid var(--tv-cyan);
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    border-radius: 50%; /* Daha modern yuvarlak butonlar */
}

.sp-container-mini {
    max-width: 280px;
    margin: 0 auto;
    position: relative;
    animation: fadeIn 0.5s ease;
}

.sp-container-mini img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.5);
    transition: transform 0.3s ease;
}

.sp-container-mini img:hover {
    transform: scale(1.03);
    border-color: var(--tv-cyan) !important;
}

/* Yükleme ikonu reklamın altında kalsın */
.player-loader {
    margin-top: 15px;
    width: 25px; 
    height: 25px;
}

/* Sayfa yenilenmeden tam ekran hissi */
body.focus-expanded .video-grid {
    display: block !important; /* Grid düzeninden çık */
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: #000;
    padding: 0 !important;
    margin: 0 !important;
}

body.focus-expanded .video-card:not(.is-focus) {
    display: none !important; /* Odaklanmayanları tamamen gizle */
}

body.focus-expanded .video-card.is-focus {
    width: 100vw !important;
    height: 100vh !important;
    border: none !important;
    border-radius: 0 !important;
}

/* Üst ve yan barları genişleme modunda gizle */
body.focus-expanded .topbar, 
body.focus-expanded .bottom-market,
body.focus-expanded .settings-fab {
    display: none !important;
}

/* Sağ Üst Tam Ekran Butonu */
.card-fullscreen-trigger {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1045;
    opacity: 0;
    transition: all 0.2s ease;
    width: 34px;
    height: 34px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-card:hover .card-fullscreen-trigger {
    opacity: 1;
}

.card-fullscreen-trigger:hover {
    background: var(--tv-cyan);
    color: #000;
}

/* Tam ekrandayken kartın tüm alanı kaplamasını sağla */
.video-card:fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    border: none !important;
}