/* ═══════════════════════════════════════
   reels.css — Jellyfish Reels System
   Instagram/TikTok style vertical feed
═══════════════════════════════════════ */

/* ── REELS SCREEN ── */
#reelsScreen {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 500;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
#reelsScreen.show { display: flex; }

/* ── REELS HEADER ── */
.reels-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(env(safe-area-inset-top, 12px), 12px) 16px 12px;
  background: linear-gradient(180deg, #000000cc 0%, transparent 100%);
}

.reels-title {
  font-family: 'Orbitron', monospace;
  font-size: 16px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 3px;
}

.reels-header-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ffffff15;
  border: 1px solid #ffffff22;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  font-size: 18px;
}

/* ── REELS FEED ── */
#reelsFeed {
  flex: 1;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
#reelsFeed::-webkit-scrollbar { display: none; }

/* ── REEL CARD ── */
.reel-card {
  position: relative;
  width: 100%;
  height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── REEL VIDEO ── */
.reel-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

/* ── TAP OVERLAY ── */
.reel-tap-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  /* exclude right action buttons and bottom info */
  right: 72px;
  bottom: 140px;
}

/* ── PLAY/PAUSE ICON ── */
.reel-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  font-size: 60px;
  color: #ffffffcc;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  text-shadow: 0 0 20px #000;
}
.reel-play-icon.flash {
  opacity: 1;
  animation: reelIconFlash 0.6s ease forwards;
}
@keyframes reelIconFlash {
  0%   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  50%  { opacity: 1; transform: translate(-50%, -50%) scale(1.3); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

/* ── GRADIENTS ── */
.reel-top-grad {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 120px;
  background: linear-gradient(180deg, #000000aa 0%, transparent 100%);
  z-index: 3;
  pointer-events: none;
}
.reel-bottom-grad {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 280px;
  background: linear-gradient(0deg, #000000dd 0%, transparent 100%);
  z-index: 3;
  pointer-events: none;
}

/* ── INFO (bottom left) ── */
.reel-info {
  position: absolute;
  bottom: 100px;
  left: 12px;
  right: 80px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reel-user {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.reel-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #fff;
  background: #00d4ff11;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.reel-username {
  font-family: 'Orbitron', monospace;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1px;
  text-shadow: 0 1px 4px #000;
}

.reel-time {
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
  color: #ffffff66;
  margin-top: 2px;
}

.reel-follow-btn {
  padding: 4px 12px;
  border: 1.5px solid #fff;
  border-radius: 20px;
  font-family: 'Orbitron', monospace;
  font-size: 9px;
  color: #fff;
  cursor: pointer;
  letter-spacing: 1px;
  margin-left: 4px;
  flex-shrink: 0;
}

.reel-caption {
  font-size: 13px;
  color: #ffffffee;
  line-height: 1.5;
  text-shadow: 0 1px 4px #000;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.reel-song {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  color: #ffffffaa;
  display: flex;
  align-items: center;
  gap: 6px;
  animation: marquee 8s linear infinite;
}

@keyframes marquee {
  0%   { transform: translateX(0); }
  50%  { transform: translateX(-20px); }
  100% { transform: translateX(0); }
}

/* ── RIGHT ACTIONS ── */
.reel-actions {
  position: absolute;
  right: 10px;
  bottom: 100px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.reel-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.reel-action-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #ffffff15;
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
}
.reel-action-icon:active { transform: scale(0.85); }
.reel-action-icon.liked  { background: #ff2d5522; }

.reel-action-count {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: #fff;
  text-shadow: 0 1px 4px #000;
}

/* ── PROGRESS BAR ── */
.reel-progress {
  position: absolute;
  bottom: 90px;
  left: 12px;
  right: 80px;
  height: 2px;
  background: #ffffff22;
  border-radius: 2px;
  z-index: 5;
}

.reel-progress-fill {
  height: 100%;
  background: #fff;
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s linear;
}

/* ── MUTE BUTTON ── */
.reel-mute-btn {
  position: absolute;
  bottom: 94px;
  right: 14px;
  font-size: 20px;
  z-index: 6;
  cursor: pointer;
  padding: 6px;
}

/* ── REEL UPLOAD SCREEN ── */
#reelUpScreen {
  position: fixed;
  inset: 0;
  background: var(--d);
  z-index: 600;
  display: none;
  flex-direction: column;
  overflow-y: auto;
}
#reelUpScreen.show { display: flex; }

.reel-up-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(env(safe-area-inset-top, 16px), 16px) 16px 16px;
  border-bottom: 1px solid #00d4ff22;
  flex-shrink: 0;
}

.reel-up-title {
  font-family: 'Orbitron', monospace;
  font-size: 14px;
  color: #00d4ff;
  letter-spacing: 3px;
}

.reel-up-body {
  flex: 1;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Video select zone */
.reel-zone {
  width: 100%;
  aspect-ratio: 9/16;
  max-height: 55vh;
  border: 2px dashed #00d4ff33;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  background: #00d4ff06;
  position: relative;
  overflow: hidden;
}

#reelPreview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
  display: none;
}

.reel-zone-icon {
  font-size: 48px;
  pointer-events: none;
}

.reel-zone-text {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: #00d4ff66;
  letter-spacing: 2px;
  pointer-events: none;
}

.reel-zone-limit {
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
  color: #ffffff22;
  letter-spacing: 1px;
  pointer-events: none;
}

/* Input fields */
.reel-input {
  background: #00d4ff08;
  border: 1px solid #00d4ff22;
  border-radius: 12px;
  padding: 12px 16px;
  color: #fff;
  font-size: 14px;
  font-family: 'Rajdhani', sans-serif;
  width: 100%;
  outline: none;
}
.reel-input::placeholder { color: #ffffff33; }
.reel-input:focus { border-color: #00d4ff66; }

.reel-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
  color: #00d4ff66;
  letter-spacing: 2px;
  margin-bottom: -8px;
}

#reelUpStatus {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  color: #00d4ff88;
  letter-spacing: 1px;
  text-align: center;
  min-height: 16px;
}

.reel-up-btn {
  background: linear-gradient(135deg, #00d4ff, #7b2ff7);
  border: none;
  border-radius: 14px;
  padding: 16px;
  color: #fff;
  font-family: 'Orbitron', monospace;
  font-size: 13px;
  letter-spacing: 2px;
  cursor: pointer;
  width: 100%;
  margin-bottom: max(env(safe-area-inset-bottom, 0px), 16px);
}
.reel-up-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.reel-up-cancel {
  background: transparent;
  border: 1px solid #ffffff22;
  border-radius: 14px;
  padding: 14px;
  color: #ffffff44;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  letter-spacing: 2px;
  cursor: pointer;
  width: 100%;
}

/* ── COMMENT SHEET ANIMATION ── */
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

/* ── NAV REELS ICON ── */
#ni-reels .ni-i svg {
  filter: drop-shadow(0 0 6px currentColor);
}
