/* video.css — Stories + Reels (Fase 2). Extraído de app.css (15/06/2026)
   para no engordar app.css. Se carga DESPUÉS de app.css (mismo orden de cascada). */
/* ============================================================
   FASE 2 — Stories + Reels (vídeo). Reutiliza tokens --if-*.
   ============================================================ */

/* ---------- barra de stories (sobre el feed) ---------- */
/* fila superior: stories (scroll horizontal) + icono Favoritos fijo a la derecha */
.stories-row { display: flex; align-items: stretch; border-bottom: 1px solid var(--if-line); margin-bottom: 14px; }
.stories-bar {
  flex: 1; min-width: 0;
  display: flex; gap: 12px; overflow-x: auto; padding: 8px 12px;   /* sin naming → menos padding */
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.stories-bar::-webkit-scrollbar { display: none; }
/* modos de feed (Para ti / Siguiendo / Favoritos): columna vertical a la derecha,
   separada de las stories por una línea gris vertical */
.feed-modes {
  flex: 0 0 auto; display: flex; flex-direction: column; justify-content: space-evenly;
  border-inline-start: 1px solid var(--if-line); padding: 0 16px;   /* sin padding arriba/abajo, más aire a los lados */
}
.fmode {
  display: flex; align-items: center; gap: 7px; background: none; border: 0; cursor: pointer;
  color: var(--if-ink-soft); padding: 4px 6px; white-space: nowrap; text-align: start;
  font-size: 11px; letter-spacing: 0.02em;
}
.fmode i { font-size: 15px; line-height: 1; }
.fmode.active { color: var(--if-ink); font-weight: 600; }
.fmode.active i { color: var(--if-accent); }
html[dir="rtl"] .fmode { text-align: end; }
.story-cell {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
  background: none; border: 0; cursor: pointer; padding: 0;
}
.story-ring {
  display: inline-flex; padding: 2.5px; border-radius: 50%; position: relative;
  background: linear-gradient(45deg, var(--if-accent), #f59e0b);
}
.story-ring.seen { background: var(--if-line); }
.story-ring.story-ring-you { background: var(--if-line); }
/* avatar cuadrado (esquinas duras) → aro cuadrado de esquinas duras */
.story-ring.story-ring-square { border-radius: 2px; }
.story-ring .avatar-img, .story-ring .avatar { border: 2px solid var(--if-bg) !important; }
.story-plus {
  position: absolute; right: -2px; bottom: -2px; width: 20px; height: 20px;
  background: var(--if-accent); color: #fff; border: 2px solid var(--if-bg);
  border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px;
}
/* el "+" como botón propio (añadir story) dentro del aro de "Tu story" */
.story-plus-btn { padding: 0; cursor: pointer; line-height: 1; }
.story-ring-tap { cursor: pointer; }
.story-name {
  font-size: 10px; color: var(--if-ink-soft); max-width: 66px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- visor de stories (pantalla completa) ---------- */
.story-viewer {
  position: fixed; inset: 0; background: #000; z-index: 250;
  display: flex; flex-direction: column;
}
.story-progress { display: flex; gap: 4px; padding: 10px 10px 6px; }
.st-seg { flex: 1; height: 2.5px; background: rgba(255,255,255,.3); border-radius: 2px; overflow: hidden; }
.st-seg b { display: block; height: 100%; width: 0; background: #fff; }
.story-head {
  display: flex; align-items: center; gap: 9px; padding: 4px 14px 10px; color: #fff;
}
.story-head .avatar-img, .story-head .avatar { border: 1px solid rgba(255,255,255,.5) !important; }
.story-user { font-weight: 600; font-size: 13px; }
.story-time { font-size: 11px; opacity: .7; }
.story-head .story-del, .story-head .story-close {
  background: none; border: 0; color: #fff; font-size: 17px; cursor: pointer; padding: 4px;
}
.story-head .story-del { margin-inline-start: auto; }
.story-head .story-close { opacity: .9; }
.story-stage { flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.story-stage img, .story-stage video { max-width: 100%; max-height: 100%; object-fit: contain; }
.story-nav { position: absolute; top: 60px; bottom: 0; width: 35%; z-index: 2; cursor: pointer; }
.story-prev { left: 0; }
.story-next { right: 0; width: 65%; }
.story-viewers {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 3;
  background: rgba(0,0,0,.5); color: #fff; border: 1px solid rgba(255,255,255,.3);
  border-radius: 20px; padding: 7px 14px; font-size: 12px; cursor: pointer;
  display: flex; align-items: center; gap: 6px;
}
.story-viewers-modal { z-index: 260; }
.viewers-list { max-height: 50vh; overflow-y: auto; margin-bottom: 12px; }
.story-up-preview { margin: 10px 0; border-radius: 6px; overflow: hidden; background: var(--if-bg-soft); }
.story-up-preview img, .story-up-preview video { width: 100%; max-height: 320px; object-fit: contain; display: block; }

/* ---------- Reels (feed vertical) ---------- */
.reels-wrap {
  position: fixed; top: 0; left: 0; right: 0;
  bottom: calc(56px + env(safe-area-inset-bottom)); background: #000; z-index: 90;
}
.reels-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 6;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; color: #fff;
  background: linear-gradient(to bottom, rgba(0,0,0,.45), transparent);
}
.reels-title { font-family: var(--if-font-mono); text-transform: uppercase; letter-spacing: .14em; font-size: 13px; font-weight: 700; }
.reels-create { background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.4); color: #fff; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; }
.reels-scroll { height: 100%; overflow-y: auto; scroll-snap-type: y mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.reels-scroll::-webkit-scrollbar { display: none; }
.reel { position: relative; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; overflow: hidden; }
.reel video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.reel-mute { position: absolute; top: 14px; right: 16px; z-index: 5; background: rgba(0,0,0,.4); color: #fff; border: 0; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; opacity: 0; }
.reel:hover .reel-mute, .reel .reel-mute:focus { opacity: 1; }
.reel-side {
  position: absolute; right: 12px; bottom: 24px; z-index: 5;
  display: flex; flex-direction: column; gap: 18px; align-items: center;
}
.reel-act { background: none; border: 0; color: #fff; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 26px; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.reel-act b { font-size: 12px; font-weight: 600; }
.reel-act.liked i { color: #fff; }   /* activo en blanco sobre vídeo, sin naranja */
.reel-info {
  position: absolute; left: 0; right: 64px; bottom: 24px; z-index: 4; color: #fff; padding: 0 16px;
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
}
.reel-author { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; cursor: pointer; }
.reel-author b { font-size: 14px; }
.reel-author .avatar-img, .reel-author .avatar { border: 1px solid rgba(255,255,255,.6) !important; }
.reel-caption { font-size: 13px; line-height: 1.4; max-height: 4.2em; overflow: hidden; }
.reel-caption a { color: #fff; font-weight: 600; }
.reel-heart {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%) scale(0);
  color: #fff; font-size: 90px; z-index: 4; pointer-events: none; opacity: 0;
}
.reel-heart.pop { animation: reelHeart 700ms var(--if-ease); }
@keyframes reelHeart { 0% { transform: translate(-50%,-50%) scale(.3); opacity: 0; } 30% { transform: translate(-50%,-50%) scale(1); opacity: .95; } 100% { transform: translate(-50%,-50%) scale(1); opacity: 0; } }
.reels-empty { color: #fff; text-align: center; padding-top: 35vh; }
.reels-empty i { font-size: 40px; opacity: .6; display: block; margin-bottom: 12px; }
.reels-empty p { margin-bottom: 16px; opacity: .8; }

/* comentarios de reel (hoja inferior) */
.reel-sheet { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 260; display: flex; align-items: flex-end; }
.reel-sheet-box { background: var(--if-bg); width: 100%; max-height: 70vh; border-radius: 14px 14px 0 0; display: flex; flex-direction: column; }
.reel-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--if-line); }
.reel-sheet-head b { font-family: var(--if-font-mono); text-transform: uppercase; letter-spacing: .12em; font-size: 12px; }
.reel-sheet-head button { background: none; border: 0; font-size: 16px; cursor: pointer; color: var(--if-ink); }
.reel-sheet-body { flex: 1; overflow-y: auto; padding: 10px 16px; }
.reel-sheet-form { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--if-line); }
.reel-sheet-form input { flex: 1; border: 1px solid var(--if-line); border-radius: 18px; padding: 8px 14px; font-size: 13px; background: var(--if-bg); color: var(--if-ink); }
.reel-sheet-form button { background: none; border: 0; color: var(--if-accent); font-weight: 600; cursor: pointer; font-size: 13px; }

/* en RTL, la columna de acciones va a la izquierda */
html[dir="rtl"] .reel-side { right: auto; left: 12px; }
html[dir="rtl"] .reel-info { right: 0; left: 64px; }

