/* ===========================
   RESET & BASE
   =========================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0a0a0f;
  --bg2: #13131a;
  --bg3: #1a1a26;
  --border: #1e1e2e;
  --text: #e8e8f0;
  --text2: #9998a8;
  --accent: #ff2d55;
  --accent2: #ff6b7a;
  --radius: 10px;
  --shadow: 0 4px 24px rgba(0,0,0,.4);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ===========================
   HEADER
   =========================== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,10,15,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.3px;
}

.admin-btn, .back-btn {
  background: var(--bg3);
  color: var(--text2);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  transition: .2s;
}
.admin-btn:hover, .back-btn:hover { color: var(--text); border-color: #333348; }

/* ===========================
   MAIN LAYOUT
   =========================== */
.main-container {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-title h2 { font-size: 16px; font-weight: 600; }
.section-title .count { color: var(--text2); font-size: 13px; }

/* ===========================
   VIDEO FEED (Grid layout for Shorts/Reels)
   =========================== */
.video-feed {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 600px) {
  .video-feed { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  .video-feed { grid-template-columns: repeat(3, 1fr); }
}

.video-card {
  background: transparent;
  border: none;
  overflow: hidden;
  cursor: pointer;
  transition: transform .18s;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.video-card:hover { transform: translateY(-2px); }
.video-card:active { transform: scale(.98); }

/* Thumbnail */
.thumb-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* Exact 16:9 ratio for 1280x720 */
  background: #1a1a26;
  border-radius: var(--radius);
  overflow: hidden;
}

.thumb-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: .3s;
  display: block;
}

.video-card:hover .thumb-wrap img { opacity: .85; }

.play-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.15);
  transition: transform .2s;
}
.play-btn svg {
  width: 64px; height: 64px;
  fill: var(--accent);
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
  transition: transform .2s;
}
.video-card:hover .play-btn svg { transform: scale(1.1); }

.duration-badge {
  position: absolute;
  bottom: 5px;
  right: 5px;
  background: rgba(0,0,0,.78);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 4px;
  letter-spacing: .3px;
}

.card-info {
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

.card-meta {
  font-size: 12px;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 4px;
}
.dot { opacity: .5; }

/* ===========================
   EMPTY STATE
   =========================== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text2);
}
.empty-state svg { margin: 0 auto 16px; opacity: .4; }
.empty-state p { font-size: 15px; }

/* ===========================
   WATCH PAGE
   =========================== */
.watch-container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 0 40px;
}

.player-wrap {
  background: #000;
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 85vh;
}

.player-wrap video {
  width: 100%;
  height: auto;
  max-height: 85vh;
  display: block;
  background: #000;
  object-fit: contain; /* Automatically handles 9:16 and 16:9 properly */
}

/* Prevent right-click download */
.player-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.video-info {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.video-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 10px;
}

.video-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.meta-left { font-size: 13px; color: var(--text2); display: flex; align-items: center; gap: 4px; }

.action-btns { display: flex; gap: 8px; flex-wrap: wrap; }

.action-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  transition: .2s;
}
.action-btn:hover { color: var(--text); border-color: #333348; }
.action-btn.active { background: rgba(255,45,85,.12); border-color: var(--accent); color: var(--accent); }

.video-desc {
  margin-top: 12px;
  padding: 12px;
  background: var(--bg3);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text2);
  line-height: 1.7;
}

/* ===========================
   COMMENTS
   =========================== */
.comments-section {
  padding: 16px 16px;
  border-bottom: 1px solid var(--border);
}
.comments-section h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.comment-count {
  background: var(--bg3);
  color: var(--text2);
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 500;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}
.comment-form input, .comment-form textarea {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: .2s;
  resize: vertical;
}
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--accent); }
.comment-form button {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: .2s;
}
.comment-form button:hover { background: #e02249; }

.comment-list { display: flex; flex-direction: column; gap: 14px; }

.comment-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.comment-avatar {
  width: 34px;
  height: 34px;
  min-width: 34px;
  background: linear-gradient(135deg, #ff2d55, #b94fff);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.comment-body { flex: 1; }
.comment-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.comment-name { font-size: 13px; font-weight: 600; }
.comment-time { font-size: 11px; color: var(--text2); }
.comment-text { font-size: 13px; color: var(--text2); line-height: 1.6; }
.no-comments { color: var(--text2); font-size: 13px; text-align: center; padding: 20px 0; }

/* ===========================
   SUGGESTED VIDEOS
   =========================== */
.suggested-section {
  padding: 16px 16px;
}
.suggested-section h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
}

/* ===========================
   SHARE MODAL
   =========================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 999;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  width: 100%;
  max-width: 380px;
}
.modal-box h3 { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.share-url-wrap { display: flex; gap: 8px; margin-bottom: 16px; }
.share-url-wrap input {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-family: inherit;
  outline: none;
}
.share-url-wrap button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.share-buttons { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.share-buttons a {
  flex: 1;
  text-align: center;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}
.share-fb { background: #1877f2; }
.share-wa { background: #25d366; }
.share-tw { background: #1da1f2; }
.modal-close {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 9px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}

/* ===========================
   FOOTER
   =========================== */
.footer {
  text-align: center;
  padding: 24px 16px;
  color: var(--text2);
  font-size: 12px;
  border-top: 1px solid var(--border);
}

/* ===========================
   RESPONSIVE TWEAKS
   =========================== */
@media (max-width: 480px) {
  .card-title { font-size: 12px; }
  .video-title { font-size: 15px; }
  .action-btn { padding: 6px 10px; font-size: 12px; }
}
