: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 */
}