* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #fff;
  user-select: none;
}

/* ─── Feed container ───────────────────────────────────────────────────── */

#feed {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.slide {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.slide video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ─── Bottom info overlay (TikTok style) ──────────────────────────────── */

.slide-info {
  position: absolute;
  bottom: 80px;
  left: 20px;
  right: 90px;
  text-shadow: 0 1px 6px rgba(0,0,0,0.9);
  z-index: 10;
}

.slide-username {
  font-size: 17px;
  font-weight: 700;
  display: block;
  margin-bottom: 6px;
}

.slide-title {
  font-size: 14px;
  font-weight: 400;
  display: block;
  margin-bottom: 4px;
  line-height: 1.4;
}

.slide-desc {
  font-size: 12px;
  font-weight: 400;
  display: block;
  margin-bottom: 4px;
  line-height: 1.3;
  opacity: 0.75;
}

.slide-meta {
  font-size: 12px;
  opacity: 0.7;
}

/* ─── Right sidebar actions (TikTok style) ────────────────────────────── */

.slide-sidebar {
  position: absolute;
  right: 12px;
  bottom: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  z-index: 10;
}

.sidebar-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.sidebar-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
}
.sidebar-btn:hover { background: rgba(255,255,255,0.25); }
.sidebar-btn:active { transform: scale(0.9); }

.sidebar-btn.liked {
  color: #FE2C55;
  animation: likePopTT 0.3s ease;
}

@keyframes likePopTT {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.action-count {
  font-size: 12px;
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
  text-align: center;
}

/* ─── Position counter ────────────────────────────────────────────────── */

.slide-counter {
  position: absolute;
  top: 50px;
  right: 16px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0.5;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
  z-index: 10;
}

/* ─── Top bar ──────────────────────────────────────────────────────────── */

.top-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  z-index: 100;
  background: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent);
}

.top-bar .title {
  font-size: 18px;
  font-weight: 700;
}

.mode-switch {
  color: #fff;
  background: rgba(255,255,255,0.15);
  padding: 8px 16px;
  border-radius: 20px;
  text-decoration: none;
  font-size: 13px;
  backdrop-filter: blur(8px);
  transition: background 0.15s;
}
.mode-switch:hover { background: rgba(255,255,255,0.3); }

/* ─── Audio placeholder ────────────────────────────────────────────────── */

.audio-slide {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
}

.audio-icon {
  font-size: 80px;
  opacity: 0.6;
}

.audio-slide .slide-filename {
  font-size: 16px;
  font-weight: 600;
}

.audio-slide audio {
  width: 80%;
  max-width: 400px;
}

/* ─── Comment drawer ──────────────────────────────────────────────────── */

.comment-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 55vh;
  background: #1e1e1e;
  border-radius: 16px 16px 0 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  transform: translateY(0);
  transition: transform 0.3s ease;
}
.comment-drawer.hidden {
  transform: translateY(100%);
  pointer-events: none;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #333;
  font-size: 15px;
  font-weight: 600;
  flex-shrink: 0;
}

.drawer-header button {
  background: none;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
}

#drawer-comments {
  flex: 1;
  overflow-y: auto;
  padding: 12px 20px;
}

.drawer-comment {
  padding: 10px 0;
  border-bottom: 1px solid #2a2a2a;
}
.drawer-comment:last-child { border-bottom: none; }

.drawer-comment-author {
  font-size: 13px;
  font-weight: 700;
  color: #aaa;
  margin-bottom: 3px;
}

.drawer-comment-text {
  font-size: 14px;
  color: #eee;
  line-height: 1.4;
}

.drawer-comment-time {
  font-size: 11px;
  color: #666;
  margin-top: 3px;
}

.drawer-input {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid #333;
  background: #1a1a1a;
  flex-shrink: 0;
}

.drawer-input input {
  flex: 1;
  background: #2a2a2a;
  border: none;
  border-radius: 20px;
  padding: 10px 16px;
  color: #fff;
  font-size: 14px;
  outline: none;
}
.drawer-input input::placeholder { color: #666; }

.drawer-input button {
  background: #FE2C55;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.drawer-input button:hover { background: #e8264d; }

.drawer-empty {
  text-align: center;
  color: #666;
  padding: 40px 0;
  font-size: 14px;
}

/* Drawer backdrop */
.drawer-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 190;
  transition: opacity 0.3s;
}
.drawer-backdrop.hidden {
  opacity: 0;
  pointer-events: none;
}

/* ─── Share toast ──────────────────────────────────────────────────────── */

.share-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255,255,255,0.95);
  color: #000;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  z-index: 300;
  transition: opacity 0.3s;
}
.share-toast.hidden { opacity: 0; pointer-events: none; }

/* ─── Scroll hint ──────────────────────────────────────────────────────── */

.scroll-hint {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  opacity: 0.5;
  animation: pulse 2s ease-in-out infinite;
  pointer-events: none;
  z-index: 10;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.2; }
}

/* ─── Unsupported format fallback ──────────────────────────────────────── */

.unsupported {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  padding: 40px;
}

.unsupported a {
  color: #25F4EE;
  text-decoration: none;
  padding: 8px 20px;
  border: 1px solid #25F4EE;
  border-radius: 20px;
}

/* ─── Progress bar (playback) ─────────────────────────────────────────── */

.video-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: #FE2C55;
  z-index: 10;
  transition: width 0.25s linear;
}
