/* ==========================================================================
   HEM Evrak — Sağ 500px Alan Kullanım Videosu Kartı ve Sinema Oynatıcı
   ========================================================================== */

.body-workspace {
  position: relative;
}

.kv-sag-panel {
  position: absolute;
  top: 22px;
  right: 22px;
  width: 456px;
  max-height: 792px;
  overflow-y: auto;
  z-index: 60;
  background: linear-gradient(165deg, rgba(15, 23, 42, 0.96) 0%, rgba(11, 41, 66, 0.96) 100%);
  border: 1px solid rgba(56, 189, 248, 0.42);
  border-radius: 14px;
  padding: 14px 15px 15px;
  box-shadow: 0 14px 34px rgba(2, 8, 23, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.kv-sag-panel[hidden],
.kv-mini-ac-btn[hidden] {
  display: none !important;
}

body.sayfa-tema-acik .kv-sag-panel {
  background: linear-gradient(165deg, #ffffff 0%, #f0f9ff 100%);
  border-color: #bae6fd;
  color: #0f172a;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}

/* Yönetim sayfalarında (sağ 500px boşluk kalktığında) veya tam ekran kurs bilgi modalı açıkken gizle */
body:has(.yonetim-view.active) .kv-sag-panel,
body:has(.yonetim-view.active) .kv-mini-ac-btn,
body:has(#yonetimRaporView.active) .kv-sag-panel,
body:has(#yonetimRaporView.active) .kv-mini-ac-btn,
body:has(#klKursBilgileriModal.open) .kv-sag-panel,
body:has(#klKursBilgileriModal.open) .kv-mini-ac-btn {
  display: none !important;
}

.kv-panel-ust {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.kv-etiket {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 700;
  color: #7dd3fc;
  letter-spacing: 0.2px;
}

body.sayfa-tema-acik .kv-etiket {
  color: #0369a1;
}

.kv-canli-nokta {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
  flex-shrink: 0;
}

.kv-ust-sag {
  display: flex;
  align-items: center;
  gap: 6px;
}

.kv-sure-rozet {
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #e0f2fe;
}

body.sayfa-tema-acik .kv-sure-rozet {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #0c4a6e;
}

.kv-kucult-btn {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(30, 41, 59, 0.65);
  color: #e2e8f0;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  font-family: system-ui, sans-serif !important;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.kv-kucult-btn:hover {
  background: rgba(56, 189, 248, 0.28);
  border-color: #38bdf8;
  color: #ffffff;
}

body.sayfa-tema-acik .kv-kucult-btn {
  background: #f1f5f9;
  color: #334155;
  border-color: #cbd5e1;
}

/* 16:9 Önizleme Sahnesi */
.kv-onizleme-kutu {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #020617;
  border: 1px solid rgba(56, 189, 248, 0.45);
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.kv-onizleme-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.28s ease, filter 0.28s ease;
}

.kv-onizleme-kutu:hover .kv-onizleme-video {
  transform: scale(1.025);
  filter: brightness(0.88);
}

.kv-onizleme-katman {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.08) 0%, rgba(2, 6, 23, 0.56) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s ease;
}

.kv-onizleme-kutu.oynuyor .kv-onizleme-katman {
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.02) 0%, rgba(2, 6, 23, 0.14) 68%, rgba(2, 6, 23, 0.68) 100%);
}

.kv-onizleme-kutu.oynuyor:not(:hover) .kv-oynat-daire {
  opacity: 0.92;
  transform: scale(0.94);
}

.kv-onizleme-kutu:hover .kv-onizleme-katman {
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.18) 0%, rgba(2, 6, 23, 0.68) 100%);
}

.kv-oynat-daire {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  border: 2.5px solid rgba(255, 255, 255, 0.92);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.6), 0 0 0 6px rgba(56, 189, 248, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kv-onizleme-kutu:hover .kv-oynat-daire {
  transform: scale(1.1);
  box-shadow: 0 10px 28px rgba(2, 132, 199, 0.8), 0 0 0 8px rgba(56, 189, 248, 0.3);
}

.kv-oynat-daire svg {
  width: 24px;
  height: 24px;
  margin-left: 3px;
  fill: currentColor;
}

.kv-onizleme-alt-bant {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: #f8fafc;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}

.kv-buyut-etiket {
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(56, 189, 248, 0.55);
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  color: #bae6fd;
}

.kv-baslik-alan {
  margin-top: 11px;
}

.kv-sayfa-baslik {
  margin: 0;
  font-size: 15.5px;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.01em;
}

body.sayfa-tema-acik .kv-sayfa-baslik {
  color: #0f172a;
}

.kv-sayfa-aciklama {
  margin: 4px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: #cbd5e1;
}

body.sayfa-tema-acik .kv-sayfa-aciklama {
  color: #475569;
}

/* Bölüm / Adım Listesi */
.kv-bolumler-baslik {
  margin: 11px 0 6px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #7dd3fc;
}

body.sayfa-tema-acik .kv-bolumler-baslik {
  color: #0369a1;
}

.kv-bolumler-liste {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.kv-bolum-satir {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 6px 9px;
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.62);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: #e2e8f0;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: "Segoe UI", system-ui, sans-serif !important;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.kv-bolum-satir:hover {
  background: rgba(2, 132, 199, 0.32);
  border-color: #38bdf8;
  color: #ffffff;
  transform: translateX(2px);
}

body.sayfa-tema-acik .kv-bolum-satir {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #1e293b;
}

body.sayfa-tema-acik .kv-bolum-satir:hover {
  background: #e0f2fe;
  border-color: #38bdf8;
  color: #0c4a6e;
}

.kv-bolum-zaman {
  font-family: Consolas, monospace;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(56, 189, 248, 0.2);
  color: #7dd3fc;
  flex-shrink: 0;
}

body.sayfa-tema-acik .kv-bolum-zaman {
  background: #dbeafe;
  color: #1d4ed8;
}

.kv-bolum-metin {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kv-ana-buyut-btn {
  margin-top: 11px;
  width: 100%;
  height: 36px;
  border-radius: 9px;
  border: 1px solid #38bdf8;
  background: linear-gradient(135deg, #0284c7 0%, #1d4ed8 100%);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-family: "Segoe UI", system-ui, sans-serif !important;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
  transition: filter 0.15s ease, transform 0.15s ease;
}

.kv-ana-buyut-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

/* Küçültüldüğünde sağ üstte duran mini açma rozeti */
.kv-mini-ac-btn {
  position: absolute;
  top: 22px;
  right: 22px;
  z-index: 60;
  height: 40px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1.5px solid #38bdf8;
  background: linear-gradient(135deg, #0f172a 0%, #0b4f6c 100%);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-family: "Segoe UI", system-ui, sans-serif !important;
  box-shadow: 0 8px 22px rgba(2, 8, 23, 0.45);
}

.kv-mini-ac-btn:hover {
  background: linear-gradient(135deg, #0b4f6c 0%, #0284c7 100%);
}

/* ==========================================================================
   Tam Ekran / Sinema (Lightbox) Oynatıcı Modalı
   ========================================================================== */
.kv-sinema-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  background: rgba(4, 9, 20, 0.86);
  backdrop-filter: blur(7px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.kv-sinema-overlay.open {
  display: flex;
}

.kv-sinema-kart {
  width: min(1180px, 94vw);
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(165deg, #0f172a 0%, #091526 100%);
  border: 1px solid rgba(56, 189, 248, 0.5);
  border-radius: 16px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.72);
  overflow: hidden;
  color: #f8fafc;
  font-family: "Segoe UI", system-ui, sans-serif;
}

.kv-sinema-ust {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid rgba(56, 189, 248, 0.25);
  flex-wrap: wrap;
}

.kv-sinema-baslik-grup {
  display: flex;
  align-items: center;
  gap: 10px;
}

.kv-sinema-baslik {
  margin: 0;
  font-size: 16.5px;
  font-weight: 800;
  color: #f8fafc;
}

.kv-sinema-kontroller {
  display: flex;
  align-items: center;
  gap: 6px;
}

.kv-oynat-btn {
  height: 32px;
  padding: 0 13px;
  border-radius: 8px;
  border: 1px solid #38bdf8;
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  margin-right: 4px;
  font-family: "Segoe UI", system-ui, sans-serif !important;
  box-shadow: 0 3px 10px rgba(2, 132, 199, 0.4);
  transition: filter 0.15s ease, transform 0.15s ease;
}

.kv-oynat-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.kv-hiz-btn {
  height: 30px;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(30, 41, 59, 0.8);
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: "Segoe UI", system-ui, sans-serif !important;
}

.kv-hiz-btn.aktif,
.kv-hiz-btn:hover {
  background: #0284c7;
  border-color: #7dd3fc;
  color: #ffffff;
}

.kv-sinema-kapat-btn {
  height: 32px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid #ef4444;
  background: #dc2626;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  margin-left: 6px;
  font-family: "Segoe UI", system-ui, sans-serif !important;
}

.kv-sinema-kapat-btn:hover {
  background: #b91c1c;
}

.kv-sinema-video-sarma {
  background: #000000;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: calc(94vh - 125px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.kv-sinema-video {
  width: 100%;
  height: 100%;
  max-height: calc(94vh - 125px);
  outline: none;
  display: block;
}

.kv-sinema-alt-bolumler {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(15, 23, 42, 0.96);
  border-top: 1px solid rgba(56, 189, 248, 0.22);
  overflow-x: auto;
}

.kv-sinema-bolum-chip {
  flex-shrink: 0;
  height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(30, 41, 59, 0.85);
  color: #e0f2fe;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: "Segoe UI", system-ui, sans-serif !important;
  transition: background 0.15s ease;
}

.kv-sinema-bolum-chip:hover {
  background: #0284c7;
  color: #ffffff;
}

/* Mobil görünümde (<= 960px) sağ 500px boşluk olmadığı için kart yerine kompakt buton göster */
@media (max-width: 960px) {
  body:not(.mobil-masaustu-zorla) .kv-sag-panel {
    display: none !important;
  }
  body:not(.mobil-masaustu-zorla) .kv-mini-ac-btn {
    position: fixed;
    top: auto;
    bottom: 76px;
    left: 12px;
    right: auto;
    z-index: 99940;
  }
}

@media print {
  .kv-sag-panel,
  .kv-mini-ac-btn,
  .kv-sinema-overlay {
    display: none !important;
  }
}
