/* Biblioteca: elegir varios videos (app-seleccion.js). La misma selección del DOOM viejo (grabador/public/index.html),
   con las letras, los radios y los colores de esta app. */

/* ----- Cuadradito de cada tarjeta: arriba a la izquierda; aparece al pasar el mouse y queda visible con algo elegido ----- */
.vc .ck { position: absolute; left: 8px; top: 8px; z-index: 3; width: 26px; height: 26px; padding: 0; display: grid; place-items: center; border: 2px solid #fff; border-radius: 7px; background: rgba(21, 20, 18, .28); color: #fff; cursor: pointer; opacity: 0; transition: opacity .12s, background .12s, border-color .12s; }
.vc .ck svg { width: 14px; height: 14px; stroke-width: 3; opacity: 0; }
.vc:hover .ck, .vc:focus-within .ck, body.selecting .vc .ck { opacity: 1; }
.vc .ck:hover { background: rgba(21, 20, 18, .45); }
.vc.sel .ck { background: var(--brand); border-color: var(--brand); }
.vc.sel .ck svg { opacity: 1; }
/* El pin de "Fijado" se corre para dejarle lugar al cuadradito */
.vc .th .pin { transition: left .12s; }
.vc:hover .th .pin, .vc:focus-within .th .pin, body.selecting .vc .th .pin { left: 40px; }
/* Tarjeta elegida: borde azul alrededor de la miniatura (por dentro: la tarjeta recorta lo de afuera) */
.vc.sel .th { border-color: var(--brand); }
.vc.sel .th::after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; border: 2px solid var(--brand); border-radius: 11px; }
body.selecting .vc .th, body.selecting .vc .tt { cursor: pointer; }

/* ----- Lista: columna de cuadraditos y fila elegida en azul (como el Finder) ----- */
.lrow .lck { flex: none; width: 20px; height: 20px; padding: 0; display: grid; place-items: center; border: 1.5px solid var(--line-2); border-radius: 6px; background: var(--surface); color: var(--brand); cursor: pointer; transition: border-color .12s; }
.lrow .lck svg { width: 12px; height: 12px; stroke-width: 3; opacity: 0; }
.lrow:hover .lck, .lrow .lck:focus-visible { border-color: var(--ink-mute); }
.lhead .lc.nom { padding-left: 46px; }
.lbody .lrow.sel, .lbody .lrow.sel:hover { background: var(--brand); }
.lrow.sel .lck { background: #fff; border-color: #fff; }
.lrow.sel .lck svg { opacity: 1; }
.lrow.sel .lnm, .lrow.sel .lc.pen b { color: #fff; }
.lrow.sel .lc.car, .lrow.sel .lc.fec, .lrow.sel .lc.pen, .lrow.sel .muted, .lrow.sel .lmeta { color: rgba(255, 255, 255, .82); }
.lrow.sel .ldot { box-shadow: 0 0 0 1.5px #fff; }
.lrow.sel .more.lm { color: #fff; }
.lrow.sel .more.lm:hover { background: rgba(255, 255, 255, .18); }
.lrow.sel + .lrow.sel { border-top-color: rgba(255, 255, 255, .16); }

/* "Seleccionar todo" en la cabecera de cada grupo (lista) */
.lsec-h .sel-todo { margin-left: auto; align-self: center; height: 28px; color: var(--ink-soft); font-weight: 500; }
.lsec-h .sel-todo:hover { color: var(--ink); }

/* Soltar videos sobre "Biblioteca · Tus videos" (raíz) */
.lib-head [data-drop] { border-radius: 12px; transition: background .12s, box-shadow .12s; }
.lib-head [data-drop].drop-on { background: var(--brand-tint); box-shadow: 0 0 0 6px var(--brand-tint), 0 0 0 7.5px var(--brand); }
.lib-head [data-drop].drop-on .h1 { color: var(--brand); }

/* ----- Barra negra de abajo, como Loom ----- */
.bulk { position: fixed; left: 50%; bottom: 22px; z-index: 70; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; width: max-content; max-width: calc(100vw - 24px); padding: 8px 8px 8px 16px; border-radius: 14px; background: var(--ink); color: var(--paper); box-shadow: 0 24px 60px -12px rgba(21, 20, 18, .55); transform: translate(-50%, 0); animation: bulk-in .2s ease-out; }
@keyframes bulk-in { from { opacity: 0; transform: translate(-50%, 12px); } }
.bulk[hidden] { display: none; }
.bulk .cnt { margin-right: 8px; font: 500 14px/1 var(--sans); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bulk button { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border: 0; border-radius: 9px; background: rgba(247, 245, 240, .09); color: var(--paper); font: 500 13px/1 var(--sans); cursor: pointer; white-space: nowrap; transition: background .12s; -webkit-tap-highlight-color: transparent; }
.bulk button:hover, .bulk button[aria-expanded="true"] { background: rgba(247, 245, 240, .18); }
.bulk button svg.i { width: 15px; height: 15px; }
.bulk .del:hover { background: var(--red); }
.bulk .x { background: none; color: rgba(247, 245, 240, .7); }
.bulk .x:hover { background: rgba(247, 245, 240, .1); color: #fff; }
.bulk button:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
/* Con la barra abierta, los avisos salen arriba de ella */
body.selecting .toast { bottom: 92px; }

/* ----- Mover: carpetas con buscador ----- */
.mover-pop { width: 300px; max-width: calc(100vw - 16px); }
.mover-pop .mv-bus { padding: 0 4px 6px; }
.mover-pop .mv-bus .input { height: 38px; font-size: 14px; }
.mover-pop .mv-lista { max-height: min(340px, 50vh); overflow-y: auto; overscroll-behavior: contain; }
.mover-pop .pl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mover-pop .mv-nada { margin: 6px 10px 8px; font-size: 13px; color: var(--ink-mute); }

/* ----- Celu ----- */
@media (hover: none) {
  /* Mantener apretado elige el video: sin la burbuja del link ni la selección de texto */
  #secciones .vc, #secciones .lrow { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
  #secciones .vc a, #secciones .vc img, #secciones .lrow a, #secciones .lrow img { -webkit-touch-callout: none; -webkit-user-drag: none; }
}
@media (max-width: 860px) {
  /* Elegir es un modo, como en Fotos del iPhone: la barra ocupa el lugar de la de abajo */
  body.selecting .tabbar { display: none; }
  .bulk { bottom: calc(10px + env(safe-area-inset-bottom)); }
  body.selecting .toast { bottom: calc(100px + env(safe-area-inset-bottom)); }
  /* Lista: el cuadradito aparece solo eligiendo */
  .lrow .lck { display: none; }
  body.selecting .lrow .lck { display: grid; grid-column: 1; grid-row: 1 / span 2; align-self: center; }
  body.selecting .lrow .lc.nom { grid-template-columns: 22px 88px minmax(0, 1fr); }
  body.selecting .lrow .lth { grid-column: 2; }
  body.selecting .lrow .lnm, body.selecting .lrow .lmeta { grid-column: 3; }
  .lhead .lc.nom { padding-left: 14px; }
  .mover-pop { width: auto; }
}
@media (max-width: 640px) {
  .bulk { padding: 8px; justify-content: center; }
  .bulk button .t { display: none; }
  .bulk .cnt { width: 100%; margin: 2px 0 6px; text-align: center; }
}
