@import '../../../assets/site.css';

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --video-bg: #070818;
  --video-panel: rgba(12, 14, 30, 0.88);
  --video-panel-strong: rgba(14, 17, 38, 0.96);
  --video-border: rgba(79, 209, 255, 0.18);
  --video-border-strong: rgba(79, 209, 255, 0.32);
  --video-muted: var(--ld-text-secondary);
  --video-soft: rgba(154, 176, 200, 0.12);
  --video-accent: var(--ld-primary);
  --video-accent-2: var(--ld-secondary);
  --video-good: var(--ld-success);
  --video-warning: var(--ld-warning);
  --video-danger: var(--ld-danger);
  --video-radius: 8px;
  --video-radius-lg: 12px;
  --video-shadow: 0 24px 70px rgba(3, 5, 14, 0.42);
}

body.video-tools-page,
body.video-compressor-page {
  min-height: 100vh;
  color: var(--ld-text);
  background:
    radial-gradient(circle at 14% -6%, rgba(79, 209, 255, 0.18), transparent 28%),
    radial-gradient(circle at 88% 0%, rgba(123, 107, 245, 0.18), transparent 34%),
    linear-gradient(180deg, #060719 0%, #0a0d1f 44%, #070818 100%);
}

.video-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: clamp(28px, 5vw, 58px) 0 72px;
}

.video-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.82fr);
  gap: 20px;
  align-items: stretch;
  margin-bottom: 28px;
}

.video-hero__copy,
.video-hero__panel,
.video-workbench,
.video-card,
.video-panel {
  border: 1px solid var(--video-border);
  border-radius: var(--video-radius-lg);
  background:
    linear-gradient(165deg, rgba(12, 14, 30, 0.94), rgba(15, 18, 42, 0.9)),
    radial-gradient(circle at top right, rgba(79, 209, 255, 0.12), transparent 38%);
  box-shadow: var(--video-shadow);
}

.video-hero__copy {
  min-height: 390px;
  padding: clamp(28px, 4vw, 44px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.video-kicker,
.video-card__kicker,
.video-panel__kicker,
.video-workbench__kicker {
  margin: 0 0 12px;
  color: var(--video-accent);
  font-family: var(--ld-font-mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.video-title {
  max-width: 780px;
  margin: 0;
  font-family: var(--ld-font-display);
  font-size: clamp(42px, 7vw, 78px);
  line-height: 0.96;
  letter-spacing: 0;
}

.video-title span {
  color: var(--video-accent);
}

.video-lead {
  max-width: 760px;
  margin: 18px 0 0;
  color: var(--video-muted);
  font-size: clamp(16px, 2vw, 19px);
}

.video-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.video-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(79, 209, 255, 0.16);
  border-radius: 999px;
  background: rgba(79, 209, 255, 0.07);
  color: var(--ld-text);
  font-size: 13px;
  font-weight: 700;
}

.video-hero__actions,
.video-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.video-button {
  min-height: 44px;
  border: 0;
  border-radius: var(--video-radius);
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #06111b;
  background: linear-gradient(135deg, var(--video-accent), #e6f86b);
  box-shadow: 0 16px 36px rgba(79, 209, 255, 0.22);
  font-weight: 850;
  cursor: pointer;
  transition:
    transform 160ms var(--ease-enter),
    border-color 160ms var(--ease-enter),
    background 160ms var(--ease-enter),
    color 160ms var(--ease-enter),
    opacity 160ms var(--ease-enter);
}

.video-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.video-button:focus-visible,
.video-control:focus-visible,
.video-select:focus-visible,
.video-radio-card:focus-within,
.video-drop:focus-visible {
  outline: 2px solid rgba(79, 209, 255, 0.48);
  outline-offset: 3px;
}

.video-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.video-button--ghost {
  color: var(--ld-text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(79, 209, 255, 0.18);
  box-shadow: none;
}

.video-button--danger {
  color: #fff;
  background: rgba(255, 77, 109, 0.18);
  border: 1px solid rgba(255, 77, 109, 0.38);
  box-shadow: none;
}

.video-hero__panel {
  padding: 22px;
  display: grid;
  gap: 16px;
}

.video-signal {
  min-height: 124px;
  border: 1px solid rgba(79, 209, 255, 0.14);
  border-radius: var(--video-radius);
  padding: 16px;
  background: rgba(8, 10, 24, 0.72);
}

.video-signal strong {
  display: block;
  margin-bottom: 6px;
  color: var(--video-accent);
  font-family: var(--ld-font-display);
  font-size: 34px;
  line-height: 1;
}

.video-signal span {
  color: var(--video-muted);
  font-size: 13px;
}

.video-meter {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.video-meter__bar {
  width: var(--meter, 60%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--video-accent), var(--video-accent-2), var(--video-warning));
}

.video-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.video-card {
  min-height: 220px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.video-card__icon {
  width: 46px;
  height: 46px;
  border-radius: var(--video-radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--video-accent);
  background: rgba(79, 209, 255, 0.1);
}

.video-card__title {
  margin: 16px 0 8px;
  font-family: var(--ld-font-display);
  font-size: 24px;
  line-height: 1.1;
}

.video-card__desc {
  margin: 0;
  color: var(--video-muted);
  font-size: 15px;
}

.video-workbench {
  padding: clamp(16px, 3vw, 24px);
}

.video-workbench__head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.video-workbench__title {
  margin: 0;
  font-family: var(--ld-font-display);
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.05;
}

.video-workbench__summary {
  max-width: 540px;
  margin: 8px 0 0;
  color: var(--video-muted);
}

.video-workbench__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  gap: 18px;
}

.video-stack {
  display: grid;
  gap: 14px;
}

.video-drop {
  min-height: 260px;
  border: 1px dashed rgba(79, 209, 255, 0.36);
  border-radius: var(--video-radius);
  padding: 24px;
  display: grid;
  place-items: center;
  text-align: center;
  background:
    radial-gradient(circle at top, rgba(79, 209, 255, 0.12), transparent 42%),
    rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition:
    border-color 160ms var(--ease-enter),
    background 160ms var(--ease-enter),
    transform 160ms var(--ease-enter);
}

.video-drop:hover,
.video-drop.is-dragover {
  border-color: rgba(79, 209, 255, 0.58);
  background:
    radial-gradient(circle at top, rgba(79, 209, 255, 0.18), transparent 42%),
    rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
}

.video-drop__icon {
  width: 70px;
  height: 70px;
  margin: 0 auto 16px;
  border-radius: var(--video-radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--video-accent);
  background: rgba(79, 209, 255, 0.1);
}

.video-drop__title {
  margin: 0;
  font-family: var(--ld-font-display);
  font-size: 26px;
}

.video-drop__text,
.video-note,
.video-status,
.video-result__meta {
  color: var(--video-muted);
}

.video-drop__text {
  margin: 8px auto 16px;
  max-width: 420px;
}

.video-file-card,
.video-options,
.video-preview,
.video-result,
.video-status-card {
  border: 1px solid rgba(79, 209, 255, 0.14);
  border-radius: var(--video-radius);
  background: rgba(8, 10, 24, 0.7);
  padding: 16px;
}

.video-file-card[hidden],
.video-options[hidden],
.video-result[hidden],
.video-status-card[hidden] {
  display: none;
}

.video-file-card__top,
.video-panel__head,
.video-result__top,
.video-status-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.video-file-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ld-text);
  font-weight: 800;
}

.video-file-size {
  color: var(--video-muted);
  font-family: var(--ld-font-mono);
  font-size: 12px;
}

.video-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.video-stat {
  min-width: 0;
  border-radius: var(--video-radius);
  padding: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.video-stat strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ld-text);
  font-size: 15px;
}

.video-stat span {
  color: var(--video-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.video-options {
  display: grid;
  gap: 16px;
}

.video-mode-grid,
.video-quality-grid {
  display: grid;
  gap: 10px;
}

.video-mode-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.video-quality-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.video-radio-card {
  position: relative;
  min-height: 86px;
  border: 1px solid rgba(79, 209, 255, 0.14);
  border-radius: var(--video-radius);
  padding: 12px;
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
}

.video-radio-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.video-radio-card:has(input:checked) {
  border-color: var(--video-border-strong);
  background: rgba(79, 209, 255, 0.1);
}

.video-radio-card strong {
  display: block;
  color: var(--ld-text);
}

.video-radio-card span {
  display: block;
  margin-top: 5px;
  color: var(--video-muted);
  font-size: 13px;
}

.video-control-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.video-field {
  display: grid;
  gap: 8px;
}

.video-label {
  color: var(--ld-text);
  font-weight: 800;
  font-size: 13px;
}

.video-select,
.video-control {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(79, 209, 255, 0.16);
  border-radius: var(--video-radius);
  color: var(--ld-text);
  background: rgba(6, 8, 22, 0.88);
}

.video-select {
  padding: 0 12px;
}

.video-slider-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 12px;
  align-items: center;
}

.video-control[type="range"] {
  min-height: 34px;
  padding: 0;
  accent-color: var(--video-accent);
}

.video-target-value {
  min-width: 86px;
  color: var(--video-accent);
  font-family: var(--ld-font-mono);
  font-weight: 800;
  text-align: right;
}

.video-preview {
  min-height: 100%;
  display: grid;
  gap: 14px;
  align-content: start;
}

.video-preview video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(79, 209, 255, 0.14);
  border-radius: var(--video-radius);
  background: #02040d;
  object-fit: contain;
}

.video-preview__empty {
  min-height: 240px;
  border: 1px dashed rgba(79, 209, 255, 0.16);
  border-radius: var(--video-radius);
  display: grid;
  place-items: center;
  color: var(--video-muted);
  text-align: center;
}

.video-preview.has-file .video-preview__empty {
  display: none;
}

.video-preview:not(.has-file) video {
  display: none;
}

.video-progress {
  display: grid;
  gap: 8px;
}

.video-progress__track {
  height: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.video-progress__bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--video-accent), var(--video-accent-2), var(--video-warning));
  transition: width 180ms var(--ease-enter);
}

.video-status-card.is-indeterminate .video-progress__bar {
  width: 42%;
  animation: video-progress-sweep 1.2s ease-in-out infinite;
}

.video-result {
  border-color: rgba(0, 212, 170, 0.28);
}

.video-result__title {
  margin: 0;
  color: var(--video-good);
  font-family: var(--ld-font-display);
  font-size: 24px;
}

.video-result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.video-warning {
  margin: 10px 0 0;
  color: #ffe79b;
  font-size: 13px;
}

.video-support-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.video-support {
  border-left: 1px solid rgba(79, 209, 255, 0.14);
  padding-left: 14px;
}

.video-support strong {
  display: block;
  color: var(--video-accent);
  font-family: var(--ld-font-display);
  font-size: 18px;
}

.video-support span {
  color: var(--video-muted);
  font-size: 13px;
}

@keyframes video-progress-sweep {
  0% {
    transform: translateX(-105%);
  }
  100% {
    transform: translateX(245%);
  }
}

@media (max-width: 980px) {
  .video-hero,
  .video-workbench__grid {
    grid-template-columns: 1fr;
  }

  .video-card-grid,
  .video-support-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .video-shell {
    width: min(100% - 24px, 1180px);
    padding-top: 22px;
  }

  .video-hero__copy {
    min-height: auto;
  }

  .video-title {
    font-size: clamp(38px, 13vw, 54px);
  }

  .video-workbench__head,
  .video-file-card__top,
  .video-panel__head,
  .video-result__top,
  .video-status-card__top {
    align-items: start;
    flex-direction: column;
  }

  .video-card-grid,
  .video-mode-grid,
  .video-quality-grid,
  .video-control-row,
  .video-stats,
  .video-result-grid,
  .video-support-grid {
    grid-template-columns: 1fr;
  }

  .video-drop {
    min-height: 220px;
    padding: 18px;
  }

  .video-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .video-button,
  .video-drop,
  .video-progress__bar {
    transition: none;
  }

  .video-status-card.is-indeterminate .video-progress__bar {
    animation: none;
    width: 64%;
  }
}
