/* ── Browse page — mobile first ─────────────────────────── */

/* Hero */
.bw-hero { padding: 32px 0 52px; }
.bw-hero h1 { font-size: 1.4rem; }
.bw-hero p {
  font-size: .86rem; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
@media (min-width: 768px) {
  .bw-hero { padding: 48px 0 64px; }
  .bw-hero h1 { font-size: 1.75rem; }
  .bw-hero p { font-size: .95rem; -webkit-line-clamp: unset; display: block; }
}

.bw-page { padding-top: 0; }

/* Controls card (overlaps the hero) */
.bw-controls {
  position: relative; z-index: 2; margin-top: -30px;
  background: #fff; border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 10px 30px -12px rgba(15,23,42,.25);
  padding: 12px; display: grid; gap: 10px;
}

.bw-search {
  display: flex; align-items: center; gap: 10px;
  height: 46px; padding: 0 14px;
  background: #f8fafc; border: 1px solid var(--border); border-radius: 12px;
  color: var(--text-muted); cursor: text; transition: border-color .15s, box-shadow .15s, background .15s;
}
.bw-search:focus-within { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.bw-search input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font-size: 16px; color: var(--text);
}
.bw-search input::-webkit-search-cancel-button { cursor: pointer; }

/* Level segmented control */
.bw-seg {
  display: grid; grid-template-columns: .7fr 1fr 1.3fr 1fr; gap: 2px;
  background: #f1f5f9; border-radius: 12px; padding: 4px;
}
.bw-seg-btn {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  min-height: 36px; padding: 6px 4px; border: 0; border-radius: 9px;
  background: transparent; color: #475569;
  font-size: .76rem; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s, box-shadow .15s;
}
.bw-seg-btn:hover { color: var(--text); }
.bw-seg-btn.active { background: #fff; color: var(--primary); box-shadow: 0 1px 3px rgba(15,23,42,.15); }
.bw-dot { display: none; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.bw-dot-easy   { background: #22c55e; }
.bw-dot-medium { background: #3b82f6; }
.bw-dot-hard   { background: #a855f7; }
@media (min-width: 400px) { .bw-dot { display: inline-block; } .bw-seg-btn { font-size: .8rem; } }

/* Dropdown filters */
.bw-selects { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bw-select {
  position: relative; display: block;
  border: 1px solid var(--border); border-radius: 10px; background: #fff;
  padding: 5px 30px 5px 11px; cursor: pointer; transition: border-color .15s, background .15s;
}
.bw-select::after {
  content: ''; position: absolute; right: 12px; top: 50%; width: 7px; height: 7px; margin-top: -5px;
  border-right: 2px solid #94a3b8; border-bottom: 2px solid #94a3b8; transform: rotate(45deg); pointer-events: none;
}
.bw-select span {
  display: block; font-size: .64rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #94a3b8;
}
.bw-select select {
  -webkit-appearance: none; appearance: none; width: 100%;
  border: 0; outline: 0; background: transparent; padding: 0;
  font-size: .88rem; font-weight: 600; color: var(--text); cursor: pointer;
}
.bw-select:hover { border-color: #cbd5e1; }
.bw-select:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.bw-select.on { border-color: var(--primary); background: #eff6ff; }
.bw-select.on span { color: var(--primary); }

@media (min-width: 640px) {
  .bw-controls { padding: 14px; }
  .bw-selects { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1024px) {
  .bw-controls { grid-template-columns: minmax(260px, 1fr) 460px; padding: 16px; }
  .bw-selects { grid-column: 1 / -1; }
}

/* Count / reset */
.bw-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 2px 10px; min-height: 24px; }
.bw-count { margin: 0; font-size: .85rem; color: var(--text-muted); }
.bw-count b { color: var(--text); }
.bw-reset {
  border: 0; background: none; padding: 4px 0; cursor: pointer;
  color: var(--primary); font-size: .85rem; font-weight: 600;
}
.bw-reset:hover { text-decoration: underline; }

/* ── List: cards (mobile) ───────────────────────────── */
.bw-list[hidden], .bw-row[hidden], .bw-pager[hidden], .bw-empty[hidden] { display: none !important; }
.bw-head { display: none; }
.bw-rows { display: grid; gap: 10px; }

.bw-row {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto;
  grid-template-areas:
    "poster name  level"
    "poster stats stats"
    "dna    dna   dna";
  gap: 6px 12px; align-items: start;
  padding: 12px; background: #fff; color: var(--text); text-decoration: none;
  border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
  transition: border-color .15s, box-shadow .15s, transform .15s;
  -webkit-tap-highlight-color: transparent;
}
.bw-row:hover { border-color: #bfdbfe; box-shadow: 0 6px 18px -8px rgba(15,23,42,.2); }
.bw-row:active { transform: scale(.99); }

.bw-c-title { display: contents; }
.bw-poster {
  grid-area: poster; width: 56px; height: 84px; object-fit: cover;
  border-radius: 8px; background: #e2e8f0; box-shadow: 0 2px 6px rgba(15,23,42,.18);
}
.bw-poster-ph {
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; font-weight: 800; color: #94a3b8;
}
.bw-name { grid-area: name; min-width: 0; padding-top: 2px; }
.bw-name strong {
  display: block; font-size: .98rem; font-weight: 700; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.bw-name span { display: block; margin-top: 2px; font-size: .76rem; color: var(--text-muted); }

.bw-c-level { grid-area: level; padding-top: 2px; }
.bw-level {
  display: inline-block; white-space: nowrap;
  font-size: .7rem; font-weight: 700; padding: 3px 9px; border-radius: 99px;
  background: #f1f5f9; color: #475569;
}
.bw-level-easy   { background: #dcfce7; color: #15803d; }
.bw-level-medium { background: #dbeafe; color: #1d4ed8; }
.bw-level-hard   { background: #f3e8ff; color: #7e22ce; }

.bw-stats { grid-area: stats; display: flex; flex-wrap: wrap; gap: 6px; align-self: end; }
.bw-stats .bw-c:has(> .bw-na) { display: none; }
.bw-stat {
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  font-size: .74rem; font-weight: 600; color: #334155;
  background: #f1f5f9; border-radius: 99px; padding: 3px 9px;
}
.bw-stat small { font-weight: 500; color: var(--text-muted); font-size: .7rem; }
.bw-tempo-slow   { color: #15803d; }
.bw-tempo-normal { color: #1d4ed8; }
.bw-tempo-fast   { color: #dc2626; }
.bw-tempo-slow small, .bw-tempo-normal small, .bw-tempo-fast small { display: none; }

.bw-c-dna { grid-area: dna; padding-top: 6px; margin-top: 4px; border-top: 1px dashed #e2e8f0; }
.bw-bar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: #e5e7eb; }
.bw-bar i { display: block; height: 100%; }
.bw-seg-a { background: #4ade80; }
.bw-seg-b { background: #60a5fa; }
.bw-seg-c { background: #c084fc; }
.bw-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: .7rem; color: var(--text-muted); }
.bw-legend span { display: inline-flex; align-items: center; gap: 4px; }
.bw-legend span::before { content: ''; width: 7px; height: 7px; border-radius: 50%; }
.bw-legend b { color: var(--text); font-weight: 700; }
.bw-lg-a::before { background: #4ade80; }
.bw-lg-b::before { background: #60a5fa; }
.bw-lg-c::before { background: #c084fc; }

.bw-c-go { display: none; }
.bw-na { color: #cbd5e1; }
.bw-na-text { font-size: .76rem; color: var(--text-muted); }

@media (min-width: 640px) {
  .bw-rows { grid-template-columns: 1fr 1fr; gap: 12px; }
}

/* ── List: table (desktop) ──────────────────────────── */
@media (min-width: 1024px) {
  .bw-list {
    --bw-cols: minmax(0, 2.4fr) 116px 150px 130px 92px minmax(190px, 2fr) 24px;
    background: #fff; border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
    box-shadow: 0 2px 20px rgba(15,23,42,.06);
  }
  .bw-head {
    display: grid; grid-template-columns: var(--bw-cols); gap: 16px; align-items: center;
    padding: 0 20px; background: #0f172a;
  }
  .bw-h {
    display: flex; align-items: center; gap: 4px; padding: 14px 0;
    border: 0; background: none; text-align: left; cursor: pointer;
    color: #cbd5e1; font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  }
  .bw-h:hover, .bw-h.on { color: #fff; }
  .bw-h-plain { cursor: default; }
  .bw-h-plain:hover { color: #cbd5e1; }
  .bw-h i { font-style: normal; font-size: .8rem; }
  .bw-h-num { justify-content: flex-end; }

  .bw-rows { display: block; }
  .bw-row {
    grid-template-columns: var(--bw-cols); grid-template-areas: none;
    gap: 16px; align-items: center;
    padding: 12px 20px; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; box-shadow: none;
  }
  .bw-row > *, .bw-stats > * { grid-area: auto; }
  .bw-row:last-child { border-bottom: 0; }
  .bw-row:hover { background: #f8fafc; box-shadow: none; }
  .bw-row:active { transform: none; }

  .bw-c-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
  .bw-poster { width: 40px; height: 60px; border-radius: 6px; }
  .bw-poster-ph { font-size: 1rem; }
  .bw-name strong { font-size: .95rem; }
  .bw-row:hover .bw-name strong { color: var(--primary); }
  .bw-c-level, .bw-name { padding-top: 0; }

  .bw-stats { display: contents; }
  .bw-stats .bw-c:has(> .bw-na) { display: block; }
  .bw-stat { background: none; padding: 0; font-size: .84rem; }
  .bw-tempo-slow small, .bw-tempo-normal small, .bw-tempo-fast small { display: inline; }
  .bw-c-words { text-align: right; }
  .bw-c-words .bw-stat b { font-size: .95rem; }
  .bw-c-words small { display: none; }

  .bw-c-dna { padding-top: 0; margin-top: 0; border-top: 0; }
  .bw-legend { gap: 4px 8px; font-size: .68rem; }

  .bw-c-go { display: flex; color: #cbd5e1; transition: color .15s, transform .15s; }
  .bw-row:hover .bw-c-go { color: var(--primary); transform: translateX(3px); }
}

/* Empty + pager */
.bw-empty {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 40px 20px; text-align: center; color: var(--text-muted);
  background: #fff; border: 1px dashed var(--border); border-radius: 16px;
}
.bw-empty strong { color: var(--text); }

.bw-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 20px; }
.bw-pg-btn {
  display: flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--border); background: #fff; color: var(--text); cursor: pointer;
  transition: border-color .15s, color .15s, opacity .15s;
}
.bw-pg-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.bw-pg-btn:disabled { opacity: .35; cursor: default; }
.bw-pg-info { font-size: .88rem; font-weight: 600; color: var(--text-muted); min-width: 56px; text-align: center; }

/* ── YouTube videoları ─────────────────────────────── */
/* Listede: yatay küçük resim (16:9) */
.bw-row:has(.bw-poster--yt) { grid-template-columns: 80px minmax(0, 1fr) auto; }
.bw-poster--yt { width: 80px; height: 45px; border-radius: 8px; }
@media (min-width: 1024px) {
  .bw-row:has(.bw-poster--yt) { grid-template-columns: var(--bw-cols); }
  .bw-poster--yt { width: 64px; height: 36px; border-radius: 6px; flex: none; }
  .bw-row:has(.bw-poster--yt) .bw-c-title { gap: 10px; }
  .bw-row:has(.bw-poster--yt) .bw-name { flex: 1; }
}

/* Sayfanın başındaki şerit */
.bw-yt { padding: 22px 0 18px; }
.bw-yt + .bw-controls, .bw-rails + .bw-controls { margin-top: 0; }   /* şerit varsa filtre kutusu hero üstüne binmez */
.bw-rails .bw-yt + .bw-yt { padding-top: 8px; }
.bw-yt-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bw-yt-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 1.15rem; font-weight: 800; }
.bw-yt-logo {
  display: inline-grid; place-items: center; width: 28px; height: 20px; border-radius: 6px;
  background: #ef4444; color: #fff; font-size: .62rem;
}
.bw-yt-all {
  border: 0; background: none; padding: 6px 2px; cursor: pointer; white-space: nowrap;
  color: var(--primary); font-weight: 700; font-size: .86rem;
}
.bw-yt-sub { margin: 4px 0 12px; font-size: .86rem; color: var(--text-muted); }
.bw-yt-rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: 78%; gap: 12px;
  overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px;
  scrollbar-width: thin; -webkit-overflow-scrolling: touch;
}
.bw-yt-card { scroll-snap-align: start; display: grid; gap: 6px; color: var(--text); text-decoration: none; min-width: 0; }
.bw-yt-thumb {
  position: relative; display: block; aspect-ratio: 16/9; border-radius: 12px; overflow: hidden;
  background: #0f172a; box-shadow: 0 8px 20px -10px rgba(15,23,42,.45);
}
.bw-yt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.bw-yt-play {
  position: absolute; left: 50%; top: 50%; width: 46px; height: 32px; transform: translate(-50%, -50%);
  border-radius: 9px; background: rgba(239,68,68,.92); opacity: .92; transition: opacity .15s, transform .15s;
}
.bw-yt-play::after {
  content: ''; position: absolute; left: 50%; top: 50%; transform: translate(-35%, -50%);
  border-style: solid; border-width: 7px 0 7px 12px; border-color: transparent transparent transparent #fff;
}
.bw-yt-lv {
  position: absolute; left: 8px; top: 8px; padding: 2px 8px; border-radius: 99px;
  background: rgba(15,23,42,.78); color: #fff; font-size: .7rem; font-weight: 800;
}
.bw-yt-card strong {
  font-size: .92rem; font-weight: 700; line-height: 1.3;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.bw-yt-card small { font-size: .76rem; color: var(--text-muted); margin-top: -4px; }
.bw-yt-card:hover strong { color: var(--primary); }
.bw-yt-card:hover .bw-yt-thumb img { transform: scale(1.04); }
.bw-yt-card:hover .bw-yt-play { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
@media (min-width: 640px)  { .bw-yt-rail { grid-auto-columns: calc((100% - 24px) / 3); } }
@media (min-width: 1024px) { .bw-yt-rail { grid-auto-columns: calc((100% - 36px) / 4); } .bw-yt-head h2 { font-size: 1.3rem; } }

/* Dizi / film şeritleri: dikey poster */
.bw-rail-ico { font-size: 1.05rem; line-height: 1; }
.bw-poster-rail { grid-auto-columns: 36%; }
.bw-pthumb { aspect-ratio: 2/3; }
.bw-pthumb-ph {
  display: grid; place-items: center; width: 100%; height: 100%;
  background: linear-gradient(135deg, #1e3a8a, #6d28d9); color: #fff; font-size: 2rem; font-weight: 900;
}
.bw-poster-rail .bw-yt-card strong { font-size: .86rem; }
@media (min-width: 640px)  { .bw-poster-rail { grid-auto-columns: calc((100% - 48px) / 5); } }
@media (min-width: 1024px) { .bw-poster-rail { grid-auto-columns: calc((100% - 84px) / 8); } }
