/**
 * @file
 * Video preview styles.
 *
 * The video player chrome is intentionally dark regardless of theme.
 * Interactive elements use Gin variables for accent colors.
 */

.ffmpeg-source-preview {
  margin-bottom: 2rem;
}

.ffmpeg-video-preview {
  background: var(--ffmpeg-player-bg);
  border-radius: var(--ffmpeg-radius-m, 10px);
  overflow: hidden;
  width: 100%;
  display: block;
}

.ffmpeg-video-preview__panel {
  display: block;
}

.ffmpeg-video-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--ffmpeg-player-surface);
}

.ffmpeg-video-controls button {
  background: var(--ffmpeg-player-surface-hover);
  border: none;
  color: var(--ffmpeg-player-text);
  padding: 0.5rem 1rem;
  border-radius: var(--ffmpeg-radius-s, 6px);
  cursor: pointer;
  font-size: 0.875rem;
  transition: background 0.2s ease;
}

.ffmpeg-video-controls button:hover {
  background: var(--ffmpeg-player-surface-active);
}

.ffmpeg-video-controls button:focus-visible {
  outline: none;
  box-shadow: var(--ffmpeg-focus-ring);
}

.ffmpeg-video-time {
  color: var(--ffmpeg-player-text-muted);
  font-size: 0.875rem;
  font-family: monospace;
}

/* Output selector tabs */
.ffmpeg-output-tabs {
  display: flex;
  background: var(--ffmpeg-player-surface);
  padding: 0.5rem;
  gap: 0.25rem;
}

.ffmpeg-output-tab {
  padding: 0.5rem 1rem;
  background: transparent;
  border: none;
  color: var(--ffmpeg-player-text-muted);
  font-size: 0.875rem;
  cursor: pointer;
  border-radius: var(--ffmpeg-radius-s, 6px);
  transition: all 0.2s ease;
}

.ffmpeg-output-tab:hover {
  color: var(--ffmpeg-player-text);
  background: var(--ffmpeg-player-surface-hover);
}

.ffmpeg-output-tab:focus-visible {
  outline: none;
  box-shadow: var(--ffmpeg-focus-ring);
  color: var(--ffmpeg-player-text);
  background: var(--ffmpeg-player-surface-hover);
}

.ffmpeg-output-tab.active {
  color: var(--ffmpeg-on-accent, #ffffff);
  background: var(--ffmpeg-accent, #2563eb);
}

/* Video thumbnail */
.ffmpeg-video-thumbnail {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  position: relative;
  max-width: 360px;
  aspect-ratio: 16 / 9;
  background: var(--ffmpeg-player-bg);
  border-radius: var(--ffmpeg-radius-m, 10px);
  overflow: hidden;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  color: inherit;
  text-align: inherit;
}

.ffmpeg-video-thumbnail:focus-visible {
  outline: none;
  box-shadow: var(--ffmpeg-focus-ring, 0 0 0 3px rgba(37, 99, 235, 0.5));
}

.ffmpeg-video-thumbnail__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  display: block;
}

.ffmpeg-video-thumbnail__play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  pointer-events: none;
}

.ffmpeg-video-thumbnail__play-icon svg {
  width: 100%;
  height: 100%;
}

/* Video dialog */
.ffmpeg-video-dialog {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  display: none;
  align-items: center;
  justify-content: center;
}

.ffmpeg-video-dialog[open] {
  display: flex;
}

.ffmpeg-video-dialog::backdrop {
  background: var(--ffmpeg-player-backdrop);
  backdrop-filter: blur(2px);
}

.ffmpeg-video-dialog__content {
  position: relative;
  max-width: min(900px, 90vw);
  max-height: 90vh;
  background: var(--ffmpeg-player-bg);
  border-radius: var(--ffmpeg-radius-m, 10px);
  overflow: hidden;
  box-shadow: var(--ffmpeg-player-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ffmpeg-video-dialog__close {
  position: absolute;
  top: 0.5rem;
  inset-inline-end: 0.5rem;
  z-index: 1;
  width: 2.75rem;
  height: 2.75rem;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--ffmpeg-player-overlay);
  color: var(--ffmpeg-player-text);
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.ffmpeg-video-dialog__close:hover {
  background: var(--ffmpeg-player-overlay-hover);
}

.ffmpeg-video-dialog__close:focus-visible {
  outline: none;
  box-shadow: var(--ffmpeg-focus-ring, 0 0 0 3px rgba(37, 99, 235, 0.5));
}

.ffmpeg-video-dialog__video {
  max-width: 100%;
  max-height: 90vh;
  width: auto;
  height: auto;
  display: block;
  background: var(--ffmpeg-player-bg);
  object-fit: contain;
}
