/* ===========================
   VideoPlayer - Temel Stiller
   =========================== */
:root {
  --vp-bg: #000;
  --vp-text: #fff;
  --vp-text-secondary: rgba(255,255,255,0.7);
  --vp-accent: #fff;
  --vp-progress-bg: rgba(255,255,255,0.2);
  --vp-progress-filled: #fff;
  --vp-buffer-color: rgba(255,255,255,0.4);
  --vp-hover-fill: rgba(255,255,255,0.3);
  --vp-thumb-size: 14px;
  --vp-controls-bg: linear-gradient(transparent, rgba(0,0,0,0.8));
  --vp-controls-height: 42px;
  --vp-button-size: 36px;
  --vp-icon-size: 28px;
  --vp-tooltip-bg: rgba(0,0,0,0.85);
  --vp-menu-bg: rgba(20,20,20,0.95);
  --vp-menu-hover: rgba(255,255,255,0.1);
  --vp-cinema-bg: rgba(0,0,0,0.9);
  --vp-transition: 0.2s ease;
}

.vp-corporate {
  position: relative;
  background: var(--vp-bg);
  overflow: hidden;
  font-family: Arial, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  line-height: 1;
}

.vp-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
}

.vp-video {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: none;
}

/* Yükleme animasyonu */
.vp-loading {
  position: absolute;
  top: 50%; left: 50%;
  width: 48px; height: 48px;
  margin: -24px 0 0 -24px;
  border: 4px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: vp-spin 0.8s linear infinite;
  display: none;
  z-index: 5;
}
.vp-corporate.loading .vp-loading {
  display: block;
}
@keyframes vp-spin {
  to { transform: rotate(360deg); }
}

/* Büyük oynat butonu */
.vp-big-play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  cursor: pointer;
  color: #fff;
  background: rgba(0,0,0,0.6);
  border-radius: 50%;
  padding: 14px;
  z-index: 3;
  transition: opacity 0.3s;
}
.vp-corporate.playing .vp-big-play {
  opacity: 0;
  pointer-events: none;
}

/* Başlık */
.vp-title-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: 12px 16px;
  background: linear-gradient(rgba(0,0,0,0.7), transparent);
  color: #fff;
  font-size: 16px;
  z-index: 4;
  pointer-events: none;
}

/* Logo */
.vp-logo {
  position: absolute;
  z-index: 10;
  pointer-events: none;
}
.vp-logo-top-left     { top: 12px; left: 12px; }
.vp-logo-top-right    { top: 12px; right: 12px; }
.vp-logo-bottom-left  { bottom: 56px; left: 12px; }
.vp-logo-bottom-right { bottom: 56px; right: 12px; }
.vp-logo img {
  max-height: 36px;
  display: block;
}
.vp-logo a { pointer-events: auto; }

/* Hata katmanı */
.vp-error-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 6;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.vp-error-overlay.show {
  opacity: 1;
  pointer-events: auto;
}
.vp-error-title {
  font-size: 18px;
  margin-bottom: 8px;
}
.vp-error-desc {
  font-size: 14px;
  color: #ccc;
  margin-bottom: 16px;
}
.vp-retry-btn {
  background: #fff;
  color: #000;
  border: none;
  padding: 8px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

/* ===========================
   Kontrol Çubuğu
   =========================== */
.vp-controls {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 8px 12px;
  background: var(--vp-controls-bg);
  color: var(--vp-text);
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 5;
  transition: opacity 0.3s;
}

.vp-corporate.idle .vp-controls {
  opacity: 0;
  pointer-events: none;
}
.vp-wrapper:hover .vp-controls {
  opacity: 1 !important;
  pointer-events: auto;
}

/* Üst bar: progress + süreler */
.vp-top-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.vp-time-current,
.vp-time-duration {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  min-width: 40px;
  text-align: center;
  color: var(--vp-text-secondary);
}

/* Progress bar */
.vp-progress-container {
  flex: 1;
  position: relative;
  height: 6px;
  cursor: pointer;
  background: transparent;
  padding: 8px 0;
  box-sizing: content-box;
}
.vp-progress {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--vp-progress-bg);
  border-radius: 3px;
  overflow: visible;
}
.vp-buffer-bar {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: 0;
  background: var(--vp-buffer-color);
  border-radius: 3px;
  z-index: 1;
}
.vp-progress-filled {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: 0;
  background: var(--vp-progress-filled);
  border-radius: 3px;
  z-index: 2;
}
.vp-hover-fill {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: 0;
  background: var(--vp-hover-fill);
  border-radius: 3px;
  z-index: 1;
}
.vp-thumb {
  position: absolute;
  top: 50%;
  left: 0;
  width: var(--vp-thumb-size);
  height: var(--vp-thumb-size);
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  display: none;
}
.vp-progress-container:hover .vp-thumb,
.vp-progress-container:active .vp-thumb {
  display: block;
}

/* Buton konteyneri (iki grup) */
.vp-button-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.vp-btn-grp {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Ortak buton stilleri */
.vp-btn-grp button,
.vp-volume-group button {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--vp-button-size);
  height: var(--vp-button-size);
  transition: background var(--vp-transition);
}
.vp-btn-grp button:hover,
.vp-volume-group button:hover {
  background: rgba(255,255,255,0.15);
}

/* Ses grubu */
/* Ses seviyesi yüzde etiketi */
.vp-volume-percent {
  position: absolute;
  right: -36px;          /* panelin hemen sağında */
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: #fff;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}

.vp-volume-group:hover .vp-volume-percent,
.vp-volume-slider-panel.open .vp-volume-percent {
  opacity: 1;
}
.vp-volume-group {
  position: relative;
  display: flex;
  align-items: center;
  height: var(--vp-button-size);
  gap:4px;
}

/* Yatay ses paneli (yana açılan) */
.vp-volume-slider-panel {
  width: 0;
  overflow: hidden;
  height: 8px;
  background: rgba(255,255,255,0.2);
  border-radius: 4px;
  cursor: pointer;
  transition: width 0.25s ease, opacity 0.25s ease;
  opacity: 0;
  flex-shrink: 0;
}

.vp-volume-group:hover .vp-volume-slider-panel,
.vp-volume-slider-panel.open {
  width: 80px;
  opacity: 1;
}

.vp-volume-track {
  width: 80px;
  height: 100%;
  position: relative;
  border-radius: 4px;
}

.vp-volume-fill {
  height: 100%;
  background: #fff;
  border-radius: 4px;
  width: 100%;
  transition: width 0.1s;
}

/* Altyazı aktif */
.vp-subtitles-btn.active {
  color: #ffd700;
}

/* Ayarlar grubu */
.vp-settings-group {
  position: relative;
}

.vp-settings-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  background: var(--vp-menu-bg);
  border-radius: 6px;
  padding: 6px 0;
  min-width: 180px;
  display: none;
  z-index: 20;
  backdrop-filter: blur(8px);
}
.vp-settings-menu.show {
  display: block;
}

.vp-settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
  position: relative;
  color: #fff;
}
.vp-settings-item:hover {
  background: var(--vp-menu-hover);
}

.vp-speed-value,
.vp-quality-value {
  color: #aaa;
  margin-left: 12px;
}

/* Alt menü listeleri (hız, kalite) */
.vp-submenu-list {
  position: absolute;
  left: 100%;
  top: 0;
  background: var(--vp-menu-bg);
  border-radius: 6px;
  padding: 4px 0;
  min-width: 100px;
  display: none;
  z-index: 21;
  backdrop-filter: blur(8px);
}
.vp-speed-submenu:hover .vp-submenu-list,
.vp-quality-submenu:hover .vp-submenu-list {
  display: block;
}
.vp-submenu-list button {
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  color: #fff;
  padding: 6px 16px;
  text-align: left;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.vp-submenu-list button:hover,
.vp-submenu-list button.active {
  background: var(--vp-menu-hover);
  color: #fff;
}

/* Sinema modu */
body.vp-cinema-active {
  overflow: hidden;
}
body.vp-cinema-active::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.98);
  z-index: 9998;
}
.vp-corporate.vp-cinema {
  z-index: 9999;
}

/* ===========================
   Önizleme (Preview)
   =========================== */
.vp-preview {
  position: absolute;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  background: rgba(0,0,0,0.85);
  border-radius: 4px;
  padding: 4px;
  display: none;
  z-index: 10;
  pointer-events: none;
}
.vp-preview.show {
  display: block;
}
.vp-preview-thumb {
  width: 160px;
  height: 90px;
  background: #000;
  border-radius: 2px;
}
.vp-preview-time {
  text-align: center;
  font-size: 12px;
  color: #fff;
  margin-top: 4px;
}

/* ===========================
   Tooltip
   =========================== */
.vp-tooltip {
  position: absolute;
  background: var(--vp-tooltip-bg);
  color: #fff;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  pointer-events: none;
  white-space: nowrap;
  z-index: 15;
  opacity: 0;
  transform: translateX(-50%);
  transition: opacity 0.15s;
}
.vp-tooltip.show {
  opacity: 1;
}

/* ===========================
   Bağlam Menüsü (Sağ Tık)
   =========================== */
.vp-context-menu {
  position: absolute;
  background: var(--vp-menu-bg);
  border-radius: 6px;
  padding: 4px 0;
  min-width: 150px;
  z-index: 30;
  display: none;
}
.vp-context-menu.show {
  display: block;
}
.vp-context-menu-item,
.vp-context-menu-link {
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  color: #fff;
  padding: 8px 16px;
  text-align: left;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.vp-context-menu-item:hover,
.vp-context-menu-link:hover {
  background: var(--vp-menu-hover);
}
.vp-context-menu-divider {
  height: 1px;
  background: rgba(255,255,255,0.15);
  margin: 4px 8px;
}

/* ===========================
   Responsive (Mobil)
   =========================== */
@media (max-width: 600px) {
  .vp-button-container {
    flex-wrap: wrap;
    gap: 2px;
  }
  .vp-btn-grp {
    flex-wrap: wrap;
    justify-content: center;
  }
  .vp-time-current,
  .vp-time-duration {
    font-size: 11px;
    min-width: 32px;
  }
  .vp-settings-menu {
    min-width: 150px;
  }
  .vp-volume-group:hover .vp-volume-slider-panel,
  .vp-volume-slider-panel.open {
    width: 70px;
  }
  .vp-preview {
    transform: translateX(-50%) scale(0.8);
  }
}