/* ===========================================================================
   İzleme sayfası (watch.html)
   Sitenin base.html'indeki tema değişkenlerinin üstüne biner; gece modu
   otomatik çalışır. Bootstrap'i ezmez, kendi ad alanını (wv-) kullanır.
   =========================================================================== */

.wv {
  --wv-surface: var(--card-bg, #fff);
  --wv-surface-2: rgba(0, 0, 0, .025);
  --wv-border: rgba(0, 0, 0, .08);
  --wv-text: var(--text-primary, #0f172a);
  --wv-muted: var(--text-muted, #64748b);
  --wv-faint: #94a3b8;
  --wv-accent: var(--accent, #0ea5e9);
  --wv-accent-ink: #0369a1;
  --wv-accent-soft: rgba(14, 165, 233, .1);
  --wv-success: #12805c;
  --wv-success-soft: rgba(18, 128, 92, .12);
  --wv-danger: #b42318;
  --wv-danger-soft: rgba(180, 35, 24, .1);
  --wv-radius: 16px;
  --wv-radius-sm: 10px;
  --wv-shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --wv-shadow-lg: 0 12px 32px rgba(15, 23, 42, .1);
}
[data-theme="dark"] .wv {
  --wv-surface-2: rgba(255, 255, 255, .04);
  --wv-border: rgba(255, 255, 255, .1);
  --wv-faint: #64748b;
  --wv-accent-ink: #7dd3fc;
  --wv-accent-soft: rgba(56, 189, 248, .14);
  --wv-success: #3ecf9a;
  --wv-success-soft: rgba(62, 207, 154, .15);
  --wv-danger: #f27272;
  --wv-danger-soft: rgba(242, 114, 114, .14);
  --wv-shadow: 0 1px 3px rgba(0, 0, 0, .4);
  --wv-shadow-lg: 0 16px 40px rgba(0, 0, 0, .55);
}

/* --------------------------------------------------------------- Üst bar */
.wv-top {
  display: flex; align-items: center; gap: 1rem;
  padding-bottom: .875rem; margin-bottom: 1.125rem;
  border-bottom: 1px solid var(--wv-border);
}
.wv-top-main { flex: 1 1 auto; min-width: 0; }
.wv-crumbs {
  font-size: .76rem; color: var(--wv-muted);
  display: flex; gap: .35rem; align-items: center;
  white-space: nowrap; overflow: hidden;
}
.wv-crumbs a { text-decoration: none; color: inherit; }
.wv-crumbs a:hover { color: var(--wv-accent); }
.wv-crumbs .sep { color: var(--wv-faint); font-size: .6rem; }

/* Ders başlığı: sayfanın tek h1'i */
.wv-title {
  margin: .2rem 0 0; font-size: 1.1rem; font-weight: 700;
  letter-spacing: -.015em; line-height: 1.3;
  display: flex; align-items: baseline; gap: .5rem; min-width: 0;
  color: var(--wv-text);
}
.wv-lesson {
  flex: 0 0 auto; font-size: .7rem; font-weight: 700;
  color: var(--wv-accent-ink); background: var(--wv-accent-soft);
  padding: .15rem .5rem; border-radius: 999px; position: relative; top: -1px;
}
.wv-ayah { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.wv-top-actions { flex: 0 0 auto; display: flex; gap: .4rem; align-items: center; }
.wv-iconbtn {
  width: 36px; height: 36px; flex: 0 0 auto;
  display: grid; place-items: center;
  border: 1px solid var(--wv-border); background: var(--wv-surface);
  border-radius: 10px; color: var(--wv-muted); cursor: pointer; font-size: 1rem;
}
.wv-iconbtn:hover { color: var(--wv-accent); border-color: var(--wv-accent); }
.wv-iconbtn.on { color: var(--wv-accent); border-color: var(--wv-accent); background: var(--wv-accent-soft); }
.wv-iconbtn.fav.on { color: var(--wv-danger); border-color: var(--wv-danger); background: var(--wv-danger-soft); }
.wv-sep { width: 1px; height: 22px; background: var(--wv-border); margin: 0 .15rem; }

/* ----------------------------------------------------------------- Düzen */
.wv-grid {
  display: grid; gap: 1.25rem;
  grid-template-columns: minmax(0, 1fr) 380px; align-items: start;
}
.wv-main { min-width: 0; }

/* -------------------------------------------------------------- Oynatıcı */
.wv-player {
  position: relative; aspect-ratio: 16 / 9; background: #000;
  border-radius: var(--wv-radius); overflow: hidden; box-shadow: var(--wv-shadow-lg);
}
.wv-player iframe, .wv-player > div { width: 100%; height: 100%; border: 0; }
.wv-ad {
  position: relative; border-radius: var(--wv-radius); overflow: hidden;
  background: #0f172a; margin-bottom: .75rem; box-shadow: var(--wv-shadow-lg);
}

/* ------------------------------------------------------------- Sekmeler */
/* Sekmeler kendi içinde kayar; bildir ikonu her zaman en sağda görünür. */
.wv-tabs-row {
  display: flex; align-items: stretch; gap: .5rem;
  border-bottom: 1px solid var(--wv-border); margin-top: 1.125rem;
}
.wv-tabs {
  flex: 1 1 auto; min-width: 0; display: flex; gap: .25rem;
  overflow-x: auto; scrollbar-width: none; list-style: none; margin: 0; padding: 0;
}
.wv-tabs::-webkit-scrollbar { display: none; }
.wv-tabs > li { flex: 0 0 auto; }
.wv-tabs .nav-link {
  appearance: none; border: 0; background: none; font-family: inherit; cursor: pointer;
  padding: .65rem .95rem; font-size: .875rem; font-weight: 600; color: var(--wv-muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  display: flex; gap: .4rem; align-items: center; white-space: nowrap; border-radius: 0;
}
.wv-tabs .nav-link:hover { color: var(--wv-text); }
.wv-tabs .nav-link.active {
  color: var(--wv-accent); border-bottom-color: var(--wv-accent);
  background: none; border-left: 0; border-right: 0; border-top: 0;
}
.wv-report {
  flex: 0 0 auto; align-self: center; width: 34px; height: 34px;
  display: grid; place-items: center; border: 1px solid transparent; background: none;
  border-radius: 9px; color: var(--wv-faint); cursor: pointer; font-size: .95rem;
}
.wv-report:hover { color: var(--wv-danger); background: var(--wv-danger-soft); }

.wv-panes { padding: 1.25rem 0; font-size: .94rem; line-height: 1.75; color: var(--wv-text); }
.wv-panes .tab-pane em { color: var(--wv-muted); font-size: .88rem; }

/* ------------------------------------------------------- Not / yorum alanı */
.wv-compose {
  background: var(--wv-surface); border: 1px solid var(--wv-border);
  border-radius: var(--wv-radius-sm); padding: .875rem; margin-bottom: 1rem;
}
.wv-compose textarea {
  width: 100%; border: 1px solid var(--wv-border); border-radius: var(--wv-radius-sm);
  background: var(--wv-surface-2); color: var(--wv-text); font-family: inherit;
  font-size: .9rem; line-height: 1.6; padding: .7rem .8rem; resize: vertical; min-height: 88px;
}
.wv-compose textarea:focus {
  outline: none; border-color: var(--wv-accent); box-shadow: 0 0 0 3px var(--wv-accent-soft);
}
.wv-compose .wv-compose-row { display: flex; gap: .5rem; align-items: center; margin-top: .6rem; flex-wrap: wrap; }

/* ------------------------------------------------------------- Playlist */
.wv-aside { position: sticky; top: 1rem; display: grid; gap: 1rem; }
.wv-card {
  background: var(--wv-surface); border: 1px solid var(--wv-border);
  border-radius: var(--wv-radius); box-shadow: var(--wv-shadow); overflow: hidden;
}
.wv-card-h { padding: .875rem 1rem; border-bottom: 1px solid var(--wv-border); }
.wv-card-h .row1 { display: flex; align-items: center; gap: .5rem; }
.wv-card-h h2 { font-size: .9rem; font-weight: 700; margin: 0; flex: 1 1 auto; min-width: 0; color: var(--wv-text); }
.wv-card-h .sub { font-size: .76rem; color: var(--wv-muted); }
.wv-prog { height: 6px; border-radius: 999px; background: var(--wv-surface-2); overflow: hidden; margin-top: .6rem; }
.wv-prog > i { display: block; height: 100%; background: var(--wv-success); border-radius: 999px; }

.wv-list { max-height: calc(100vh - 220px); overflow-y: auto; scrollbar-width: thin; }
.wv-list::-webkit-scrollbar { width: 8px; }
.wv-list::-webkit-scrollbar-thumb { background: var(--wv-border); border-radius: 4px; }

.wv-group-btn {
  position: sticky; top: 0; z-index: 2; width: 100%; text-align: left;
  display: flex; align-items: center; gap: .5rem; padding: .55rem 1rem;
  background: var(--wv-surface-2); border: 0; border-bottom: 1px solid var(--wv-border);
  font-family: inherit; font-size: .76rem; font-weight: 700; color: var(--wv-muted);
  text-transform: uppercase; letter-spacing: .04em; cursor: pointer;
}
.wv-group-btn .playlist-group-icon { transition: transform .15s; font-size: .7rem; }
.wv-group-btn .n { margin-left: auto; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--wv-faint); }

.wv-item {
  display: flex; gap: .7rem; align-items: flex-start; padding: .6rem 1rem;
  text-decoration: none; border-bottom: 1px solid var(--wv-border);
  position: relative; color: var(--wv-text);
}
.wv-item:hover { background: var(--wv-surface-2); color: var(--wv-text); }
.wv-item.playlist-item-current { background: var(--wv-accent-soft); }
.wv-item.playlist-item-current::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--wv-accent);
}
.wv-num {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center; font-size: .74rem; font-weight: 700;
  font-variant-numeric: tabular-nums; background: var(--wv-surface-2);
  color: var(--wv-muted); border: 1px solid var(--wv-border);
}
.wv-item.playlist-item-current .wv-num { background: var(--wv-accent); color: #fff; border-color: var(--wv-accent); }
.wv-item.playlist-item-completed .wv-num { background: var(--wv-success-soft); color: var(--wv-success); border-color: transparent; }
.wv-item-body { flex: 1 1 auto; min-width: 0; }
.wv-item-label {
  font-size: .85rem; font-weight: 650; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.wv-item.playlist-item-current .wv-item-label { color: var(--wv-accent-ink); }
.wv-item-meta {
  font-size: .72rem; color: var(--wv-muted); margin-top: .15rem;
  display: flex; gap: .4rem; align-items: center; flex-wrap: wrap;
}
.wv-bar { height: 3px; border-radius: 2px; background: var(--wv-border); margin-top: .35rem; overflow: hidden; }
.wv-bar > i { display: block; height: 100%; background: var(--wv-accent); width: 0; }
.wv-item.playlist-item-completed .wv-bar > i { background: var(--wv-success); }

/* --------------------------------------------------------- Çalışma modu */
/* Video + notlar dışındaki her şey gizlenir; notlar sağda sabit panelde. */
body.study-mode-active .wv-top-main,
body.study-mode-active .wv-tabs,
body.study-mode-active .wv-report,
body.study-mode-active .wv-aside,
body.study-mode-active .wv-ad { display: none !important; }
body.study-mode-active .wv-grid { grid-template-columns: minmax(0, 1fr) !important; }
body.study-mode-active .wv-main { max-width: 56%; }
body.study-mode-active .wv-tabs-row { border-bottom: 0; }
body.study-mode-active .wv-panes .tab-pane:not(#panel-notes) { display: none !important; }
body.study-mode-active .wv-panes {
  display: block !important; position: fixed !important; top: 0; right: 0;
  width: 42% !important; height: 100vh !important; margin: 0 !important;
  padding: 3.25rem 1rem 1rem !important; overflow-y: auto !important;
  background: var(--content-bg, #fff) !important;
  border-left: 1px solid var(--wv-border) !important;
  box-shadow: -8px 0 24px rgba(0, 0, 0, .18); z-index: 60;
}
body.study-mode-active #panel-notes { display: block !important; }
body.study-mode-active .study-mode-close-wrap { display: block !important; }

/* ------------------------------------------------------------ Responsive */
@media (max-width: 1100px) {
  .wv-grid { grid-template-columns: minmax(0, 1fr); }
  .wv-aside { position: static; }
  .wv-list { max-height: 420px; }
  body.study-mode-active .wv-main { max-width: 100%; }
  body.study-mode-active .wv-panes { position: static !important; width: auto !important; height: auto !important; padding: 1.25rem 0 !important; box-shadow: none; border-left: 0 !important; }
}
@media (max-width: 575.98px) {
  .wv-title { font-size: .98rem; }
  .wv-top { gap: .5rem; }
}
