/* ═══════════════════════════════════════════════════
   AllSubli Reels – Estilos principales
   Diseño oscuro, mobile-first
═══════════════════════════════════════════════════ */

:root {
  --bg: #000;
  --surface: #111;
  --border: #222;
  --accent: #e63946;
  --text: #fff;
  --muted: #888;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100%;
  overflow-x: hidden;
}

/* ── NAVBAR ─────────────────────────────────────── */
.navbar { z-index: 100; }

/* ── FEED ───────────────────────────────────────── */
.feed-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 0;
  background: var(--bg);
}

/* ── REEL CARD ──────────────────────────────────── */
.reel-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  background: #000;
  border-bottom: 1px solid var(--border);
}

/* ── VIDEO WRAPPER ──────────────────────────────── */
.reel-video-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #000;
}

/* Vertical: llena la pantalla del móvil */
.reel-video-wrap.vertical {
  /* En móvil: 100svh; en escritorio: 85vh máx */
  height: min(100svh, 85vh);
}
@media (min-width: 600px) {
  .reel-video-wrap.vertical {
    height: min(90vh, 720px);
  }
}

/* Horizontal: widescreen, ajuste 16:9 */
.reel-video-wrap.horizontal {
  aspect-ratio: 16 / 9;
  max-height: 60vh;
}

.reel-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: pointer;
  background: #000;
}
.reel-video-wrap.horizontal .reel-video {
  object-fit: contain;
}

/* ── OVERLAY TOP (nick) ─────────────────────────── */
.reel-overlay-top {
  position: absolute;
  top: 12px; left: 12px;
  z-index: 10;
  pointer-events: none;
}
.reel-nick {
  background: rgba(0,0,0,.55);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: .82rem;
  font-weight: 600;
  color: #fff;
  backdrop-filter: blur(4px);
}

/* ── OVERLAY BOTTOM (acciones) ──────────────────── */
.reel-overlay-bottom {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 10;
  background: linear-gradient(to top, rgba(0,0,0,.7) 0%, transparent 100%);
  padding: 16px 12px 12px;
}
.reel-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: flex-end;
}
.action-btn {
  background: none;
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-size: .85rem;
  padding: 0;
  line-height: 1;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.7));
  transition: transform .15s;
}
.action-btn:hover, .action-btn:focus { transform: scale(1.15); outline: none; }
.action-btn svg { display: block; }

/* ── REACT PICKER ───────────────────────────────── */
.reel-react-wrap { position: relative; display: flex; align-items: center; gap: 6px; }
.react-picker {
  position: absolute;
  bottom: 44px;
  right: 0;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 30px;
  padding: 6px 10px;
  display: flex;
  gap: 6px;
  z-index: 20;
  white-space: nowrap;
}
.rx-btn {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  border-radius: 50%;
  padding: 4px;
  transition: transform .15s, background .15s;
  line-height: 1;
}
.rx-btn:hover  { transform: scale(1.3); background: #333; }
.rx-btn.active { background: #333; outline: 2px solid var(--accent); }
.react-count   { color: #fff; font-size: .85rem; min-width: 18px; text-align: center; }

/* ── REEL DESTACADO (link compartido) ────────────────────────────────────── */
.reel-highlighted .reel-video-wrap {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
  animation: pulseHighlight 0.8s ease-out 2;
}
@keyframes pulseHighlight {
  0%   { outline-color: var(--accent); }
  50%  { outline-color: #ff8c94; }
  100% { outline-color: var(--accent); }
}

/* ── POLÍTICA DE CONTENIDO ───────────────────────── */
.policy-notice {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  background: #1a1400;
  border: 1px solid #4a3800;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: .8rem;
  color: #c8a600;
  line-height: 1.4;
}
.policy-notice strong { color: #f0c040; }

.alert-policy {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  background: #1a0000;
  border: 1px solid #5a0000;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: .82rem;
  color: #ff6b6b;
  line-height: 1.4;
}

/* ── UPLOAD PANEL ───────────────────────────────── */
.upload-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 200;
  backdrop-filter: blur(2px);
}
.upload-panel {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 201;
  background: #111;
  border-top: 1px solid #333;
  border-radius: 20px 20px 0 0;
  padding: 24px 20px 32px;
  max-height: 92vh;
  overflow-y: auto;
}
@media (min-width: 600px) {
  .upload-panel {
    max-width: 480px;
    left: 50%; right: auto;
    transform: translateX(-50%);
    border-radius: 16px 16px 0 0;
  }
}
.btn-close-panel {
  position: absolute;
  top: 16px; right: 16px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  opacity: .7;
  transition: opacity .15s;
}
.btn-close-panel:hover { opacity: 1; }

/* ── DROPZONE ────────────────────────────────────── */
.dropzone {
  border: 2px dashed #444;
  border-radius: 12px;
  padding: 32px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  background: #0a0a0a;
}
.dropzone:hover, .dropzone.drag-over {
  border-color: var(--accent);
  background: #1a0000;
}
.reel-preview {
  max-width: 100%;
  max-height: 240px;
  border-radius: 10px;
  object-fit: contain;
  background: #000;
}

/* ── COMMENTS PANEL ──────────────────────────────── */
.comments-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 300;
}
.comments-panel {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 301;
  background: #111;
  border-top: 1px solid #333;
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  height: 75vh;
  max-height: 75vh;
}
@media (min-width: 600px) {
  .comments-panel {
    max-width: 480px;
    left: 50%; right: auto;
    transform: translateX(-50%);
    border-radius: 16px 16px 0 0;
  }
}
.comments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #222;
  flex-shrink: 0;
}
.comments-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.comments-footer {
  padding: 10px 14px 16px;
  border-top: 1px solid #222;
  flex-shrink: 0;
}

/* ── COMENTARIO ──────────────────────────────────── */
.comment-item {
  background: #1a1a1a;
  border-radius: 10px;
  padding: 10px 12px;
}
.comment-nick  { font-size: .78rem; font-weight: 700; color: var(--accent); margin-bottom: 4px; }
.comment-text  { font-size: .9rem; color: #e0e0e0; word-break: break-word; }
.comment-meta  { display: flex; align-items: center; gap: 12px; margin-top: 6px; font-size: .74rem; color: var(--muted); }
.btn-reply     { background: none; border: none; color: var(--muted); font-size: .74rem; cursor: pointer; padding: 0; transition: color .15s; }
.btn-reply:hover { color: #fff; }

/* ── MODAL ───────────────────────────────────────── */
.modal-content { border-radius: 16px; }

/* ── SCROLLBAR personalizada ─────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: #111; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

/* ── Utilidades ──────────────────────────────────── */
.text-accent { color: var(--accent); }
