/* =========================================================
   dumaguete.uk — reels.css
   The full-screen vertical player and its upload dialog. The
   rail icon itself inherits .rail button styling; only the
   player and dialog are styled here.
   ========================================================= */

/* ---------- Full-screen player ---------- */
.reels {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overscroll-behavior: contain;
}
body.reels-open { overflow: hidden; }

.reels__stage {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 480px;   /* phone-shaped even on desktop */
  display: flex;
  align-items: center;
  justify-content: center;
}

.reels__item {
  position: relative;
  width: 100%;
  height: 100%;
}
.reels__video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  cursor: pointer;
}

/* Close and add, top corners */
.reels__close,
.reels__add {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  z-index: 1002;
  border: 0;
  cursor: pointer;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(6px);
}
.reels__close {
  right: 12px;
  width: 40px; height: 40px;
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
}
.reels__add {
  left: 12px;
  padding: 0 16px; height: 40px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
}
.reels__close:hover,
.reels__add:hover { background: rgba(255, 255, 255, 0.24); }

/* Sound toggle, lower-right of the video */
.reels__mute {
  position: absolute;
  right: 14px;
  bottom: 96px;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  font-size: 1.2rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1001;
}

/* Caption + uploader, bottom-left over a soft gradient */
.reels__meta {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 40px 16px calc(20px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0) 100%);
  z-index: 1001;
}
.reels__caption {
  margin: 0 0 8px;
  color: #fff;
  font-size: 0.98rem;
  line-height: 1.45;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.reels__by {
  display: inline-block;
  color: #fff;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  padding: 5px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(4px);
}
.reels__by:hover { background: rgba(255, 255, 255, 0.3); }

.reels__del {
  position: absolute;
  right: 14px;
  top: calc(64px + env(safe-area-inset-top));
  z-index: 1002;
  border: 0;
  cursor: pointer;
  color: #fff;
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: 14px;
  background: rgba(200, 40, 40, 0.55);
  backdrop-filter: blur(4px);
}
.reels__del:hover { background: rgba(200, 40, 40, 0.75); }

.reels__count {
  position: absolute;
  top: calc(18px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 1001;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

/* Up/down nav — desktop only; touch swipes instead */
.reels__nav {
  position: fixed;
  right: 16px;
  z-index: 1001;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  color: #fff;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(4px);
}
.reels__nav--up { bottom: calc(50% + 30px); }
.reels__nav--down { bottom: calc(50% - 74px); }
.reels__nav:hover { background: rgba(255, 255, 255, 0.26); }

.reels__loading,
.reels__empty {
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
  padding: 20px;
  line-height: 1.6;
}
.reels__empty p { margin: 4px 0; }

@media (max-width: 900px) {
  .reels__nav { display: none; }    /* swipe on touch */
  .reels__mute { bottom: 110px; }
}

/* ---------- Upload dialog ---------- */
.reels-up {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.reels-up__panel {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}
.reels-up__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.reels-up__head h3 { margin: 0; font-size: 1.15rem; }
.reels-up__x {
  border: 0; background: transparent; cursor: pointer;
  font-size: 1.5rem; line-height: 1; color: var(--ink-faint);
}
.reels-up__note {
  margin: 0 0 16px;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--ink-soft);
}
.reels-up__pick {
  display: block;
  text-align: center;
  padding: 22px;
  border: 2px dashed var(--line);
  border-radius: 12px;
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
  transition: border-color 0.15s, background 0.15s;
}
.reels-up__pick:hover { border-color: var(--accent); background: var(--surface-alt); }
.reels-up__file {
  margin: 10px 0 0;
  font-size: 0.82rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.reels-up__caption {
  width: 100%;
  margin-top: 12px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  background: var(--surface);
  color: var(--ink);
}
.reels-up__caption:focus { outline: none; border-color: var(--accent); }
.reels-up__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
}
.reels-up__err {
  margin: 12px 0 0;
  font-size: 0.85rem;
  color: #c0392b;
}

/* Local button styles so the dialog looks right on every page,
   whether or not the page's own stylesheet defines .btn. */
.reels-up .btn {
  padding: 9px 18px;
  border-radius: 10px;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}
.reels-up .btn--ghost { background: var(--surface-alt); color: var(--ink); }
.reels-up .btn--primary { background: var(--accent); color: var(--accent-ink); }
.reels-up .btn--primary:disabled { opacity: 0.5; cursor: default; }
