/* Grabaciones — the recordings library.
 *
 * Everything here rides beautiful.css's --bb-* tokens, so dark mode comes free
 * and nothing is a hardcoded hex the design layer cannot restyle. The one
 * exception is the poster well (#0B0D12): video wants to sit on near-black in
 * both themes — a warm background around a frame makes the picture read muddy.
 *
 * Visual-first by construction: the card IS the thumbnail. A recording is a
 * picture, and a table of filenames is unusable for picking one out. */

.vd-page { padding-bottom: 56px; }

/* ------------------------------------------------------------------ dropzone */

/* Grabar manda; soltar un archivo es el caso secundario. En pantalla angosta se
   apilan y el botón queda arriba, que es el orden correcto de todas formas. */
.vd-start {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 12px; margin-bottom: 16px;
}
.vd-rec {
  display: flex; align-items: center; gap: 14px; text-decoration: none;
  padding: 20px 22px; border-radius: 14px; background: var(--bb-accent, #0D2A5E);
  color: #fff; transition: .2s ease; border: 1px solid transparent;
}
.vd-rec:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(13,42,94,.22); }
.vd-rec:active { transform: translateY(1px); }
.vd-rec b  { display: block; font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.vd-rec em { display: block; font-style: normal; font-size: 12px; margin-top: 3px;
             color: rgba(255,255,255,.66); }
.vd-rec-dot {
  width: 12px; height: 12px; border-radius: 50%; background: #D63A1E; flex: none;
  box-shadow: 0 0 0 4px rgba(214,58,30,.22);
  animation: vd-latir 1.6s ease-in-out infinite;
}
@keyframes vd-latir { 0%,100% { opacity: 1 } 50% { opacity: .45 } }
@media (prefers-reduced-motion: reduce) { .vd-rec-dot { animation: none } }

.vd-drop {
  position: relative;
  border: 2px dashed var(--bb-line-strong);
  border-radius: 14px;
  background: var(--bb-canvas);
  padding: 34px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s var(--bb-ease-strong), background .2s ease, transform .2s var(--bb-ease-strong);
}
.vd-drop:hover { border-color: var(--bb-accent); background: var(--bb-hover); }
.vd-drop.is-over {
  border-color: var(--bb-accent);
  background: var(--bb-accent-tint);
  transform: scale(1.006);
}
.vd-drop input[type=file] { display: none; }

.vd-drop-ico {
  width: 44px; height: 44px; margin: 0 auto 12px;
  display: grid; place-items: center;
  border-radius: 12px; background: var(--bb-surface);
  box-shadow: var(--bb-sh-btn); color: var(--bb-accent);
}
.vd-drop-ico svg { width: 22px; height: 22px; flex: none; }
.vd-drop h3 { font-size: 15px; font-weight: 650; letter-spacing: -.01em; margin: 0 0 4px; }
.vd-drop p  { font-size: 12.5px; color: var(--bb-ink-3); margin: 0; }

/* --------------------------------------------------------------- upload rows */

.vd-queue { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.vd-up {
  background: var(--bb-surface); border-radius: var(--bb-r-card);
  box-shadow: var(--bb-sh-card); padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
}
.vd-up-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vd-up-pct { font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums; font-size: 12px; color: var(--bb-ink-2); }
.vd-up-bar { position: absolute; left: 0; bottom: 0; height: 3px;
  background: var(--bb-accent); border-radius: 0 3px 3px 0; transition: width .25s ease; }
.vd-up { position: relative; overflow: hidden; }
.vd-up.is-err { box-shadow: 0 0 0 1px var(--bb-red), var(--bb-sh-card); }
.vd-up.is-err .vd-up-pct { color: var(--bb-red); }

/* -------------------------------------------------------------------- grid */

.vd-grid {
  margin-top: 26px;
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
}

.vd-card {
  background: var(--bb-surface); border-radius: var(--bb-r-card);
  box-shadow: var(--bb-sh-card); overflow: hidden;
  display: flex; flex-direction: column;
  transition: box-shadow .22s var(--bb-ease-strong), transform .22s var(--bb-ease-strong);
}
.vd-card:hover { box-shadow: var(--bb-sh-overlay); transform: translateY(-2px); }
.vd-card.is-dead { opacity: .55; }

.vd-thumb {
  position: relative; display: block;
  aspect-ratio: 16 / 9; background: #0B0D12;
  overflow: hidden; text-decoration: none;
}
.vd-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vd-thumb .vd-noart {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: rgba(245,243,238,.34);
}
.vd-thumb .vd-noart svg { width: 34px; height: 34px; }

/* Duration sits on the frame the way every video product puts it, because that
 * is where the eye already looks for it. */
.vd-dur {
  position: absolute; right: 8px; bottom: 8px;
  background: rgba(6, 9, 14, .82); color: #fff;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums; font-size: 11px; font-weight: 600;
  padding: 3px 7px; border-radius: var(--bb-r-chip);
}
.vd-play {
  position: absolute; inset: 0; display: grid; place-items: center;
  opacity: 0; transition: opacity .2s ease;
}
.vd-thumb:hover .vd-play { opacity: 1; }
.vd-play span {
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255,255,255,.94); color: #0D2A5E;
  display: grid; place-items: center; box-shadow: 0 6px 20px rgba(0,0,0,.35);
}
.vd-play svg { width: 20px; height: 20px; margin-left: 3px; }

.vd-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.vd-title {
  font-size: 13.5px; font-weight: 650; line-height: 1.35; letter-spacing: -.005em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.vd-title[contenteditable=true] { outline: none; }
.vd-title[contenteditable=true]:focus {
  box-shadow: var(--bb-sh-focus); border-radius: 4px; -webkit-line-clamp: unset;
}

.vd-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.vd-chip {
  font-size: 10.5px; font-weight: 600; letter-spacing: .02em;
  padding: 3px 7px; border-radius: var(--bb-r-chip);
  background: var(--bb-inset); color: var(--bb-ink-3); box-shadow: var(--bb-sh-hairline);
}
.vd-chip b { font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums; color: var(--bb-ink-2); font-weight: 600; }
.vd-chip.is-warn { background: var(--bb-orange-tint); color: var(--bb-orange); }
.vd-chip.is-dead { background: var(--bb-red-tint); color: var(--bb-red); }

.vd-acts { display: flex; gap: 6px; padding-top: 2px; }
/* flex:none is load-bearing on every icon in this file — responsive.css sets a
 * global svg{max-width:100%}, which resolves to ZERO width for an icon inside a
 * flex container. The button then renders as an invisible clickable sliver. */
.vd-acts button {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  font: inherit; font-size: 11.5px; font-weight: 600;
  padding: 7px 8px; border: 0; border-radius: var(--bb-r-control);
  background: var(--bb-field); color: var(--bb-ink-2); cursor: pointer;
  transition: background .16s ease, color .16s ease;
}
.vd-acts button:hover { background: var(--bb-hover-2); color: var(--bb-ink); }
.vd-acts button.is-primary { background: var(--bb-accent); color: #fff; }
.vd-acts button.is-primary:hover { background: var(--bb-accent-ink); }
.vd-acts button.is-danger:hover { background: var(--bb-red-tint); color: var(--bb-red); }
.vd-acts button svg { width: 13px; height: 13px; flex: none; }
.vd-acts button.is-icon { flex: none; width: 32px; padding: 7px 0; }

/* --------------------------------------------------------------- empty / warn */

.vd-note {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--bb-orange-tint); color: var(--bb-orange);
  border-radius: var(--bb-r-card); padding: 12px 14px;
  font-size: 12.5px; margin-bottom: 16px;
}
.vd-note svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.vd-note code {
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11.5px;
  background: rgba(0,0,0,.06); padding: 1px 5px; border-radius: 4px;
}

.vd-empty { text-align: center; padding: 48px 20px; color: var(--bb-ink-3); font-size: 13px; }

.vd-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(8px);
  background: var(--bb-tip-bg); color: var(--bb-tip-fg);
  font-size: 12.5px; font-weight: 600; padding: 10px 16px; border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.28); opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s var(--bb-ease-strong); z-index: 9000;
}
.vd-toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 560px) {
  .vd-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  /* Grabar manda; soltar un archivo es el caso secundario. En pantalla angosta se
   apilan y el botón queda arriba, que es el orden correcto de todas formas. */
.vd-start {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 12px; margin-bottom: 16px;
}
.vd-rec {
  display: flex; align-items: center; gap: 14px; text-decoration: none;
  padding: 20px 22px; border-radius: 14px; background: var(--bb-accent, #0D2A5E);
  color: #fff; transition: .2s ease; border: 1px solid transparent;
}
.vd-rec:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(13,42,94,.22); }
.vd-rec:active { transform: translateY(1px); }
.vd-rec b  { display: block; font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.vd-rec em { display: block; font-style: normal; font-size: 12px; margin-top: 3px;
             color: rgba(255,255,255,.66); }
.vd-rec-dot {
  width: 12px; height: 12px; border-radius: 50%; background: #D63A1E; flex: none;
  box-shadow: 0 0 0 4px rgba(214,58,30,.22);
  animation: vd-latir 1.6s ease-in-out infinite;
}
@keyframes vd-latir { 0%,100% { opacity: 1 } 50% { opacity: .45 } }
@media (prefers-reduced-motion: reduce) { .vd-rec-dot { animation: none } }

.vd-drop { padding: 24px 16px; }
}
