* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  background: black;
  overflow: hidden;
  touch-action: none;
  font-family: system-ui, -apple-system;
}

#player {
  position: fixed;
  inset: 0;
  background: black;
  overflow: hidden;
  touch-action: none;
}

video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: top;
  background: black;
  will-change: transform;
}

video.hidden {
  opacity: 0;
  pointer-events: none;
}

video.visible {
  opacity: 1;
}

/* 🔘 SIDE CONTROLS */
#controls {
  position: fixed;
  right: 16px;
  bottom: 10px;
  z-index: 10;

  display: flex;
  flex-direction: column;
  gap: 10px;

  align-items: flex-end; /* ✅ FIX: keeps all buttons flush right */
}

/* 🔲 TIKTOK STYLE BUTTONS */
#controls button {
  width: 50px;
  height: 50px;
  padding: 0;

  border-radius: 50%; /* TikTok uses circular buttons */
  background: transparent;
  color: #ffffff;
  border: none;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  font-size: 32px;
  backdrop-filter: none;
  filter: drop-shadow(0px 2px 4px rgba(0,0,0,0.6));
  
  transition: transform 0.15s ease, opacity 0.15s ease;
  margin-bottom: 20px; /* space for text below */
  position: relative;
}

#controls button i {
  margin-top: 2px;
}

.btn-count {
  position: absolute;
  bottom: -22px;
  font-size: 15px;
  font-weight: 600;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.liked i {
  color: #ff2b54;
  animation: heartPop 0.3s ease;
}
.disliked i {
  color: #ffa500;
}

@keyframes heartPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* 🔊 SOUND BUTTON — BIGGER (inside column now) */
#controls #soundToggle {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;

  padding: 0;

  background: transparent !important;
  border: 2px solid #ffffff !important;
  border-radius: 50%;

  color: #ffffff;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  backdrop-filter: none;
  box-shadow: none !important;

  font-size: 18px; /* adjust icon size if needed */
  margin-top: 5px;
  margin-bottom: 0 !important;
}

/* stop pulse while pressed */
#soundToggle:active {
  animation: none;
}

@keyframes soundPulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* animation helper */
.animate {
  transition: transform 0.25s ease-out;
}

/* 🔒 NEXT VIDEO LOCK */
#nextLock {
  position: fixed;
  left: 10px;
  bottom: 10px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8);
  filter: drop-shadow(0 0 4px rgba(255, 204, 0, 0.6));
  z-index: 9999;
}

#nextLock.locked {
  opacity: 1;
  animation: lockPulse 1.4s ease-in-out infinite;
}

#nextLock.unlocked {
  animation: unlockPop 0.35s ease-out forwards;
}

@keyframes lockPulse {
  0%   { transform: scale(0.9); }
  50%  { transform: scale(1.05); }
  100% { transform: scale(0.9); }
}

@keyframes unlockPop {
  0%   { opacity: 1; transform: scale(1); }
  60%  { opacity: 1; transform: scale(1.2); }
  100% { opacity: 0; transform: scale(0.6); }
}

/* 🎮 TAP CONTROLS OVERLAY */
#tapControls {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  pointer-events: none;
  opacity: 0;
  z-index: 9998;
}

#tapControls.visible {
  opacity: 1;
  pointer-events: auto;
}

/* FACEBOOK / iOS STYLE CONTROLS */
.ctrl {
  width: 64px;
  height: 64px;
  padding: 0;
  border-radius: 50%;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
  color: #ffffff;

  transform: scale(0.85);
  animation: ctrlPulse 1.6s ease-in-out infinite;
  transition: transform 0.2s ease, opacity 0.25s ease;
  user-select: none;
}

.ctrl-back,
.ctrl-fwd {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.ctrl-play i {
  font-size: 26px;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.ctrl-play.morph i {
  transform: scale(0.6);
  opacity: 0;
}

.ctrl:active,
#controls button:active {
  transform: scale(0.92);
}

#tapControls.visible .ctrl {
  transform: scale(1);
}

#tapControls.hiding .ctrl {
  opacity: 0;
  transform: scale(0.6);
}

@keyframes ctrlPulse {
  0%   { transform: scale(0.95); }
  50%  { transform: scale(1.05); }
  100% { transform: scale(0.95); }
}

/* 🇸🇴 PROGRESS BAR */
#progressWrap {
  position: fixed;
  left: 0;
  bottom: 60px;
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,0.15);
  z-index: 9999;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.25s ease;
}

#progressWrap.visible {
  opacity: 1;
}

#progressBar {
  height: 100%;
  width: 0%;
  background: #4AA3FF;
  box-shadow:
    0 0 6px rgba(74,163,255,0.9),
    0 0 12px rgba(74,163,255,0.7);
  transition: width 0.08s linear;
}

.playing #progressBar {
  animation: glowPulse 1.4s ease-in-out infinite;
}

@keyframes glowPulse {
  0%   { box-shadow: 0 0 4px rgba(74,163,255,0.5); }
  50%  { box-shadow: 0 0 12px rgba(74,163,255,1); }
  100% { box-shadow: 0 0 4px rgba(74,163,255,0.5); }
}

/* 💬 COMMENT SECTION (White Background) */
#commentPanel {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 70vh;
  background: #ffffff;
  z-index: 10000;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  transform: translateY(100%);
  color: #000;
  box-shadow: 0 -4px 15px rgba(0,0,0,0.2);
}

#commentPanel.visible {
  transform: translateY(0);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid #eee;
}

.panel-header h3 {
  font-size: 18px;
  font-weight: 700;
}

.panel-header button {
  background: none;
  border: none;
  font-size: 20px;
  color: #555;
  cursor: pointer;
}

.panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 15px 20px;
}

.comment-item {
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
}

.comment-author {
  font-weight: 600;
  font-size: 14px;
  color: #333;
}

.comment-text {
  font-size: 15px;
  color: #111;
  margin-top: 2px;
}

.panel-footer {
  padding: 15px 20px;
  border-top: 1px solid #eee;
  background: #fff;
}

.input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8f8f8;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding-right: 15px;
}

.input-wrap:focus-within {
  border-color: #4AA3FF;
  background: #fff;
}

.input-wrap input {
  flex: 1;
  padding: 12px 15px;
  border: none;
  background: transparent;
  font-size: 15px;
  outline: none;
}

#sendCommentBtn {
  background: none;
  border: none;
  color: #4AA3FF;
  font-size: 18px;
  cursor: pointer;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s ease;
}

#sendCommentBtn:active {
  transform: scale(0.9);
}

.comment-actions {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 5px;
}

.comment-actions button {
  background: none;
  border: none;
  color: #777;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.comment-actions button.liked {
  color: #ff2b54;
}

.comment-actions button.disliked {
  color: #ffa500;
}

/* 💬 REPLIES & EMOJIS */
.reply-list {
  margin-left: 30px;
  margin-top: 10px;
  border-left: 2px solid #eee;
  padding-left: 10px;
}

.reply-item {
  margin-bottom: 10px;
}

.reply-indicator {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f0f0f0;
  padding: 8px 15px;
  border-radius: 8px;
  margin-bottom: 10px;
  font-size: 13px;
  color: #555;
}

.reply-indicator.hidden {
  display: none;
}

#cancelReplyBtn {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  font-size: 14px;
}

.panel-footer {
  position: relative;
}

#emojiToggleBtn {
  background: none;
  border: none;
  color: #777;
  font-size: 20px;
  cursor: pointer;
  padding: 5px;
  margin-left: 5px;
}

.emoji-picker {
  position: absolute;
  bottom: 100%;
  left: 20px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  box-shadow: 0 -4px 10px rgba(0,0,0,0.1);
  margin-bottom: 10px;
}

.emoji-picker.hidden {
  display: none;
}

.emoji {
  font-size: 24px;
  cursor: pointer;
  user-select: none;
  transition: transform 0.1s;
}

.emoji:active {
  transform: scale(0.8);
}

/* 🔐 AUTH MODALS */
#authModalOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

#authModalOverlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.auth-box {
  background: #fff;
  width: 90%;
  max-width: 380px;
  padding: 25px;
  border-radius: 16px;
  position: relative;
  display: none;
  flex-direction: column;
  color: #000;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.auth-box.visible-form {
  display: flex;
}

.auth-box h3 {
  text-align: center;
  margin-bottom: 20px;
  font-size: 22px;
}

.auth-box input[type="text"],
.auth-box input[type="email"],
.auth-box input[type="password"] {
  width: 100%;
  padding: 12px 15px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 15px;
  background: #f9f9f9;
}

.primary-btn {
  background: #ff2b54;
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
}

.switch-auth {
  text-align: center;
  margin-top: 15px;
  font-size: 14px;
  color: #666;
}

.switch-auth span {
  color: #4AA3FF;
  font-weight: 600;
  cursor: pointer;
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 20px;
  color: #999;
  cursor: pointer;
}

.terms-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 15px;
  font-size: 13px;
  color: #555;
}

.terms-wrap span {
  color: #4AA3FF;
  text-decoration: underline;
  cursor: pointer;
}

.terms-box .terms-content {
  font-size: 14px;
  color: #444;
  line-height: 1.5;
  margin-bottom: 20px;
}


