/* ============================================================
   VIDEO INPUT BAR
   ============================================================ */
.video-input-section {
  background: var(--theme-surface);
  border: 1px solid var(--theme-border);
  border-radius: 10px;
  padding: 0.625rem 0.875rem;
}

.video-input-row {
  display: flex;
  gap: 0.625rem;
}

.video-url-input {
  flex: 1;
  font-size: 0.9375rem !important;
}

.player-error {
  margin-top: 0.5rem;
  color: var(--theme-error);
  font-size: 0.8125rem;
}

/* ============================================================
   PLAYER SECTION
   ============================================================ */
.player-section {
  background: var(--theme-surface);
  border: 1px solid var(--theme-border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.video-title {
  padding: 0.625rem 1rem 0;
  font-size: 0.8125rem;
  color: var(--theme-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 1.75rem;
}

/* 16:9 wrapper */
.player-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

/* The <div id="youtube-player"> that the IFrame API replaces */
.player-wrapper > div,
.player-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  border: none;
}

/* ============================================================
   CUSTOM CONTROLS BAR
   ============================================================ */
.player-controls {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.875rem;
  background: var(--theme-surface-2);
  border-top: 1px solid var(--theme-border);
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .video-input-row {
    flex-direction: column;
  }

  .video-input-row .btn {
    width: 100%;
  }

  .player-controls {
    gap: 0.5rem;
    padding: 0.75rem;
  }

  .seek-bar {
    order: 4;
    width: 100%;
    min-width: 100%;
    margin-top: 0.25rem;
  }

  .time-display {
    order: 3;
    width: 100%;
    text-align: center;
    font-size: 0.875rem;
  }

  .volume-slider {
    width: 110px;
  }

  input[type="time"] {
    font-size: 1.25rem;
  }
}

/* ---- seek bar ---- */
.seek-bar {
  flex: 1;
  min-width: 80px;
  height: 4px;
  border-radius: 2px;
  appearance: none;
  -webkit-appearance: none;
  background: var(--theme-border);
  cursor: pointer;
  padding: 0;
  border: none;
  accent-color: var(--theme-accent-1);
}

.seek-bar::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--theme-accent-1);
  cursor: pointer;
  box-shadow: 0 0 6px rgba(124, 58, 237, 0.5);
}

.seek-bar::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--theme-accent-1);
  cursor: pointer;
  border: none;
}

/* ---- volume slider ---- */
.volume-slider {
  width: 76px;
  height: 4px;
  border-radius: 2px;
  appearance: none;
  -webkit-appearance: none;
  background: var(--theme-border);
  cursor: pointer;
  padding: 0;
  border: none;
  flex-shrink: 0;
  accent-color: var(--theme-accent-2);
}

.volume-slider::-webkit-slider-thumb {
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--theme-accent-2);
  cursor: pointer;
}

.volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--theme-accent-2);
  border: none;
  cursor: pointer;
}

/* ---- time readout ---- */
.time-display {
  font-size: 0.8125rem;
  color: var(--theme-text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---- native time input dark styling ---- */
input[type="time"] {
  background: var(--theme-surface-2);
  border: 1px solid var(--theme-border);
  border-radius: 6px;
  padding: 0.65rem 0.9rem;
  font-size: 1.5rem;
  font-weight: 700;
  font-family: inherit;
  color: var(--theme-text);
  width: 100%;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color 0.15s;
  color-scheme: dark;
}

input[type="time"]:focus {
  outline: none;
  border-color: var(--theme-accent-1);
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.25);
}

input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(1) opacity(0.5);
  cursor: pointer;
}
