/* video.css
 * Video oynatıcı + katalog stilleri. Renkler tema token'larından gelir
 * (CLAUDE.md: hardcode hex yok). İstisna: filigran metni, her temada
 * okunur kalması için bilinçli sabit renk kullanır.
 */

/* ── Kopya/seçim engeli (telif) ── */
.video-shell,
.video-stage,
.video-catalog { -webkit-user-select: none; user-select: none; }

/* ── Sayfa iskeleti ── */
.video-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
}

/* ── Oynatıcı sahnesi (video + filigran aynı kutuda) ── */
.video-stage {
  position: relative;      /* filigran katmanının çapası */
  width: 100%;
  /* Videolar DİKEY (~476×640). Çerçeve de dikey → yanlarda siyah boşluk YOK.
     JS metadata gelince gerçek oranı kesinler (video-page.js). */
  max-width: 460px;
  aspect-ratio: 476 / 640;
  margin: 0 auto;          /* ortala */
  background: #000;        /* video arkası — bilinçli siyah */
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.video-stage video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
  object-fit: contain;     /* oranı korunur, asla gerilmez */
}

/* ── Özel kontrol çubuğu (native yerine — hız/atlama/tam-ekran+filigran için) ── */
.vid-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 7;                 /* filigranın (5) ve status'un (6) ÜSTÜNDE, tıklanır */
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px 12px 10px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0));
  color: #fff;
  opacity: 1;
  transition: opacity 0.25s;
  font-size: 0.8rem;
}
.video-stage.controls-hidden .vid-controls { opacity: 0; }
.video-stage.controls-hidden { cursor: none; }

.vc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 6px;
  border: none;
  background: transparent;
  color: #fff;
  cursor: pointer;
  border-radius: 6px;
  font: inherit;
  opacity: 0.9;
  transition: background 0.15s, opacity 0.15s;
}
.vc-btn:hover { background: rgba(255, 255, 255, 0.16); opacity: 1; }
.vc-btn .material-symbols-outlined { font-size: 24px; }
.vc-speed { font-weight: 700; letter-spacing: 0.3px; }

.vc-time { white-space: nowrap; font-variant-numeric: tabular-nums; opacity: 0.95; }

.vc-seek {
  flex: 1 1 auto;
  min-width: 60px;
  height: 5px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  cursor: pointer;
  accent-color: var(--primary-500);
}
.vc-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}
.vc-seek::-moz-range-thumb {
  width: 14px; height: 14px; border: none; border-radius: 50%; background: #fff; cursor: pointer;
}

/* ── Hız menüsü (popup — döngü değil, seçim) ── */
.vc-speed-menu[hidden] { display: none; } /* [hidden] display:flex'i ezmeli */
.vc-speed-menu {
  position: absolute;
  bottom: 48px;
  z-index: 8;
  display: flex;
  flex-direction: column;
  min-width: 100px;
  background: rgba(20, 20, 22, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.vc-speed-item {
  padding: 9px 14px;
  border: none;
  background: transparent;
  color: #fff;
  text-align: left;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
}
.vc-speed-item:hover { background: rgba(255, 255, 255, 0.12); }
.vc-speed-item.active { color: var(--primary-400); font-weight: 700; }

/* ── Katalog ilerleme rozeti (sol üst) — mobil ile aynı semantik renk ── */
.prog-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
}
.prog-badge.partial { background: #f59e0b; } /* turuncu: kısmi (bilinçli sabit) */
.prog-badge.done { background: #10b981; }     /* yeşil: tamamlandı (bilinçli sabit) */
.prog-badge .material-symbols-outlined { font-size: 14px; }

/* ── Devam Et / Baştan İzle modalı ── */
.vid-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  padding: 20px;
}
.vid-modal {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--neutral-800);
  border-radius: 14px;
  max-width: 380px;
  width: 100%;
  padding: 22px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}
.vid-modal h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.vid-modal p { font-size: 0.92rem; opacity: 0.85; line-height: 1.5; }
.vid-modal-actions { display: flex; gap: 10px; margin-top: 18px; justify-content: flex-end; }
.vid-modal-btn {
  padding: 9px 16px;
  border-radius: 9px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--neutral-800);
}
.vid-modal-btn.ghost { background: transparent; color: var(--color-text); }
.vid-modal-btn.primary { background: var(--primary-500); color: var(--on-primary); border-color: var(--primary-500); }
.vid-modal-btn:hover { filter: brightness(1.05); }

/* ── Satın alma onay modalı (Shopier yönlendirme) ── */
.buy-modal { max-width: 400px; text-align: center; }
.buy-modal-badge {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--primary-500) 14%, transparent);
  color: var(--primary-500);
}
.buy-modal-badge .material-symbols-outlined { font-size: 30px; }
.buy-modal p { text-align: left; }
.buy-modal-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--primary-500) 8%, transparent);
  font-size: 0.82rem;
  line-height: 1.45;
  text-align: left;
  opacity: 0.95;
}
.buy-modal-note .material-symbols-outlined { font-size: 18px; color: var(--primary-500); flex-shrink: 0; margin-top: 1px; }
.buy-modal-login { margin-top: 12px; font-size: 0.85rem; text-align: center; color: var(--color-text-muted); }
.buy-modal-login a { color: var(--primary-500); font-weight: 600; text-decoration: underline; }
.buy-modal .vid-modal-actions { justify-content: center; margin-top: 20px; }
.buy-modal-cta { display: inline-flex; align-items: center; gap: 6px; }
.buy-modal-cta .material-symbols-outlined { font-size: 18px; }

@media (max-width: 520px) {
  .vc-controls-optional { display: none; }
  .vid-controls { gap: 4px; font-size: 0.72rem; padding: 16px 6px 8px; }
  .vc-btn { min-width: 30px; height: 30px; }
  .vc-btn .material-symbols-outlined { font-size: 21px; }
}

/* Tam ekran: stage tüm ekranı kaplar, video letterbox olur, filigran ÜSTTE kalır. */
.video-stage:fullscreen,
.video-stage:-webkit-full-screen {
  max-width: none;         /* dikey max-width sınırını tam ekranda kaldır */
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
  border-radius: 0;
  background: #000;
}
.video-stage:fullscreen video,
.video-stage:-webkit-full-screen video { object-fit: contain; }

/* ── Filigran katmanları ──
   ORTA : şeffaf beyaz (içeriğin üstünde, hafif — okumayı bölmesin).
   ÜST + ALT : KOYU + beyaz hâle → açık/kağıt zeminde PDF görselindeki gibi NET okunur,
               koyu sahnede de okunur; konum TAM kenar (üst/alt). */
.vid-watermark-top,
.vid-watermark-mark,
.vid-watermark-copyright {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;          /* KRİTİK: kontrolleri engellemez */
  z-index: 5;
  max-width: 94%;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ORTA — kullanıcı (şeffaf beyaz, hafif) */
.vid-watermark-mark {
  top: 50%;
  transform: translate(-50%, -50%);
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 1px;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.35);
}

/* ÜST (kullanıcı) + ALT (telif) — NET okunur, koyu + beyaz hâle, tam kenarda */
.vid-watermark-top,
.vid-watermark-copyright {
  color: rgba(20, 20, 20, 0.85);            /* koyu → açık kağıt zeminde okunur (PDF stili) */
  font-weight: 600;
  /* Beyaz hâle: koyu sahnelerde de okunur; açık zeminde görünmez (temiz PDF hissi). */
  text-shadow:
    0 0 2px rgba(255, 255, 255, 0.95),
    0 0 5px rgba(255, 255, 255, 0.8),
    0 1px 1px rgba(255, 255, 255, 0.9);
}
.vid-watermark-top {
  top: 1.5%;                                /* TAM en üst */
  font-size: 0.78rem;
  letter-spacing: 0.5px;
}
.vid-watermark-copyright {
  bottom: 1.5%;                             /* TAM en alt */
  font-size: 0.68rem;
  letter-spacing: 0.3px;
}

@media (max-width: 640px) {
  .vid-watermark-top { font-size: 0.68rem; }
  .vid-watermark-mark { font-size: 0.7rem; letter-spacing: 0.6px; }
  .vid-watermark-copyright { font-size: 0.6rem; }
}

/* ── Telif / Rıza kapısı (pre-roll — PDF sayfa-1 karşılığı) ── */
.vid-consent-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.72);
  padding: 18px;
  overflow-y: auto;
}
.vid-consent-box {
  background: var(--color-surface);
  color: var(--color-text);
  border: 2px solid var(--primary-500);
  border-radius: 16px;
  max-width: 440px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  padding: 22px 22px 20px;
  text-align: center;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}
.vid-consent-badge { font-size: 30px; line-height: 1; }
.vid-consent-title {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.3px;
  margin: 8px 0 12px;
  color: var(--primary-600);
}
.vid-consent-text {
  font-size: 0.86rem;
  line-height: 1.6;
  opacity: 0.92;
  text-align: left;
}
.vid-consent-sign {
  margin-top: 12px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary-500);
}
.vid-consent-btn {
  margin-top: 16px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 11px;
  background: var(--primary-500);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s;
}
.vid-consent-btn:hover { filter: brightness(1.06); }

/* "Telif ve kullanım koşullarını oku" — kalıcı, sonradan okunabilir tetikleyici */
.vid-consent-link {
  display: inline-block;
  margin-top: 10px;
  padding: 0;
  background: none;
  border: none;
  color: var(--primary-500);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}
.vid-consent-link:hover { filter: brightness(1.1); }

/* ── Yükleme / hata durumları ── */
.video-status[hidden] { display: none; } /* [hidden] özniteliği display:flex'i ezmeli */
.video-status {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #fff;
  text-align: center;
  padding: 24px;
  z-index: 6;
}
.video-status .spinner {
  width: 42px; height: 42px;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: var(--primary-500);
  border-radius: 50%;
  animation: vid-spin 0.9s linear infinite;
}
@keyframes vid-spin { to { transform: rotate(360deg); } }

/* ── Video başlığı + telif notu ── */
.video-meta { margin-top: 16px; }
.video-meta h1 { font-size: 1.25rem; font-weight: 700; color: var(--color-text); }
.video-meta .video-desc { margin-top: 6px; color: var(--color-text); opacity: 0.75; font-size: 0.92rem; }

.video-copyright {
  margin-top: 14px;
  padding: 10px 14px;
  border: 1px solid var(--neutral-800);
  border-radius: 10px;
  background: var(--color-surface);
  color: var(--color-text);
  opacity: 0.8;
  font-size: 0.8rem;
  line-height: 1.5;
}

/* ── Katalog listesi ── */
.video-catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 8px;
}
.video-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--neutral-800);
  border-radius: 12px;
  overflow: hidden;
  background: var(--color-surface);
  text-decoration: none;
  color: var(--color-text);
  transition: transform 0.15s, box-shadow 0.15s;
  /* <button> olarak render edilen kilitli kartlar için varsayılan sıfırlama */
  font: inherit;
  text-align: left;
  width: 100%;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  padding: 0;
}
.video-card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.15); }
.video-card .thumb {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--primary-600), var(--primary-400));
  position: relative;
}
.video-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.video-card .info { padding: 10px 12px; }
.video-card .info .t { font-weight: 600; font-size: 0.9rem; }
.video-card.locked { opacity: 0.75; }
.video-card .lock-badge {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0, 0, 0, 0.6); color: #fff;
  border-radius: 999px; padding: 4px 10px;
  font-size: 0.72rem; display: inline-flex; align-items: center; gap: 4px;
}

@media (max-width: 420px) {
  .video-catalog { grid-template-columns: 1fr 1fr; }
}

/* ── Dersler listesi (Renkli Notlar deseni: ikon + bilgi + ok) ── */
.lessons-list { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.lesson-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--neutral-800);
  border-radius: 14px;
  background: var(--color-surface);
  color: var(--color-text);
  text-decoration: none;
  text-align: left;
  font: inherit;
  width: 100%;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: transform 0.15s, box-shadow 0.15s;
}
.lesson-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12); }
.lesson-card.locked { opacity: 0.85; }
.lesson-icon {
  flex: 0 0 auto;
  width: 60px;
  height: 60px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  background: rgba(128, 128, 128, 0.14); /* tema-bağımsız nötr; emoji rengi taşır */
}
.lesson-info { flex: 1 1 auto; min-width: 0; }
.lesson-title { font-weight: 700; font-size: 1rem; }
.lesson-desc {
  font-size: 0.85rem;
  opacity: 0.7;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lesson-meta { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; font-size: 0.8rem; opacity: 0.75; }
.lesson-meta.locked { color: var(--primary-500); opacity: 1; font-weight: 600; }
.lesson-meta .material-symbols-outlined { font-size: 16px; }
.lesson-chev { flex: 0 0 auto; color: var(--neutral-500); }

/* ── Erişim doğrulanamadı (TİYİ-201): ne açık ne kilitli — nötr kart ──
   Kilit vurgusu (primary) YOK; "satın al" çağrısı yapmaz, yalnızca belirsizliği bildirir. */
.lesson-card.unknown { opacity: 0.72; border-style: dashed; }
.lesson-card.unknown:hover { transform: none; box-shadow: none; opacity: 0.85; }
.lesson-meta.unknown { color: var(--color-text-muted); opacity: 1; font-weight: 600; }

/* ── "Erişim bilgin alınamadı" şeridi (kartların üstünde) ── */
.access-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  margin-bottom: 12px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-surface-2);
  color: var(--color-text);
  font-size: 0.9rem;
  line-height: 1.45;
}
.access-notice-icon { color: var(--color-warning); flex: 0 0 auto; }
.access-notice-text { flex: 1 1 240px; min-width: 0; }
.access-notice-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--primary-ink);
  font: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}
.access-notice-btn:hover { border-color: var(--primary-500); }
.access-notice-btn:disabled { opacity: 0.6; cursor: default; }
.access-notice-btn .material-symbols-outlined { font-size: 18px; }

.video-back { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; }

/* ── Kütüphane sekmeleri (Video | PDF) ── */
.lib-tabs-wrap { max-width: 1100px; margin: 0 auto; padding: 16px 16px 0; }
.lib-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--color-surface-2, var(--color-surface));
  border: 1px solid var(--color-border, rgba(0, 0, 0, .1));
}
.lib-tab {
  appearance: none;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  padding: 8px 18px;
  border-radius: 999px;
  background: transparent;
  color: var(--color-text-muted);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background-color .12s, color .12s;
}
.lib-tab .material-symbols-outlined { font-size: 18px; }
.lib-tab:hover { color: var(--color-text); }
.lib-tab.is-active { background: var(--primary-500); color: var(--on-primary); }
.lib-tab:focus-visible { outline: 3px solid var(--primary-400); outline-offset: 2px; }

/* ── Tanıtım / örnek içerik bandı (satın almamış ziyaretçiler için) ── */
.lib-preview-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0 4px;
  padding: 12px 14px;
  border-radius: 14px;
  text-decoration: none;
  color: var(--color-text);
  background: var(--color-surface-2, var(--color-surface));
  border: 1px solid var(--color-border, rgba(0, 0, 0, .1));
  transition: border-color .12s, transform .12s;
}
.lib-preview-cta:hover { border-color: var(--primary-500); transform: translateY(-1px); }
.lib-preview-cta:focus-visible { outline: 3px solid var(--primary-400); outline-offset: 2px; }
.lib-preview-cta .lib-preview-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--primary-500);
  color: var(--on-primary);
  font-size: 20px;
}
.lib-preview-txt { flex: 1 1 auto; min-width: 0; }
.lib-preview-txt strong { display: block; font-size: 0.92rem; font-weight: 700; }
.lib-preview-txt span {
  display: block;
  margin-top: 2px;
  font-size: 0.83rem;
  line-height: 1.45;
  color: var(--color-text-muted);
}
.lib-preview-cta .lib-preview-arrow { flex: 0 0 auto; font-size: 20px; color: var(--color-text-muted); }
@media (max-width: 420px) {
  .lib-preview-cta { gap: 10px; padding: 11px 12px; }
  .lib-preview-cta .lib-preview-arrow { display: none; }
}
