/* ====== RESET & GLOBAL ====== */
* {
  box-sizing: border-box;
}
html, body {
  height: 100%;
}
body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
  background-color: #f9f9f9;
  color: #222;
  transition: background-color 0.3s, color 0.3s;
}
body.dark {
  background-color: #121212;
  color: #eee;
}
.hidden {
  display: none !important;
}

/* ====== HEADER ====== */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  background-color: #fff;
  border-bottom: 1px solid #ddd;
  position: sticky;
  top: 0;
  z-index: 1000;
}
body.dark header {
  background-color: #1e1e1e;
  border-color: #333;
}
.logo-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.logo-title img {
  height: 28px;
  width: 28px;
}
.logo-title h1 {
  font-size: 18px;
  line-height: 1;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.controls {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
#searchInput {
  padding: 6px 10px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  min-width: 200px;
  background: #fff;
  color: #222;
  outline: none;
}
#searchInput:focus {
  border-color: #0078d4;
  box-shadow: 0 0 0 2px rgba(0,120,212,0.15);
}
body.dark #searchInput {
  background: #2a2a2a;
  border-color: #444;
  color: #eee;
}
#toggleTheme {
  font-size: 18px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
}
#toggleTheme:hover {
  background: rgba(0,0,0,0.06);
}
body.dark #toggleTheme:hover {
  background: rgba(255,255,255,0.08);
}

/* ====== KOMPONEN: Kartu Video di Galeri ====== */
.media-item {
  cursor: pointer;
  background-color: #fff;
  padding: 10px;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.media-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}
body.dark .media-item {
  background-color: #181818;
  box-shadow: none;
}
.media-item img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  background-color: #000;
}
.video-info {
  margin-top: 10px;
}
.video-title {
  font-weight: 700;
  font-size: 16px; /* diperbesar agar seimbang dengan kartu yang lebih besar */
  line-height: 1.3;
  margin: 0 0 4px 0;
}
.video-meta {
  font-size: 13px; /* sedikit lebih besar dari sebelumnya */
  color: #666;
}
body.dark .video-meta {
  color: #aaa;
}

/* ====== KOMPONEN: Item Rekomendasi ====== */
.recommend-item {
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 10px;
  align-items: center;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.recommend-item:hover {
  background-color: #f2f2f2;
  transform: translateY(-1px);
}
body.dark .recommend-item:hover {
  background-color: #222;
}
.recommend-item img {
  width: 128px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  background: #000;
}
.recommend-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
}

/* ====== KOMENTAR ====== */
#commentSection {
  margin-top: 20px;
}
#commentsList {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.comment-item {
  background-color: #f5f5f5;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #ddd;
}
body.dark .comment-item {
  background-color: #1e1e1e;
  border-color: #333;
}
.comment-text {
  font-size: 14px;
  line-height: 1.45;
  margin-bottom: 6px;
  word-wrap: break-word;
}
.comment-meta {
  font-size: 12px;
  color: #777;
}
body.dark .comment-meta {
  color: #aaa;
}
#commentInput {
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
  resize: vertical;
  min-height: 80px;
  color: #222;
}
#commentInput:focus {
  border-color: #0078d4;
  box-shadow: 0 0 0 2px rgba(0,120,212,0.15);
  outline: none;
}
body.dark #commentInput {
  background-color: #2a2a2a;
  border-color: #444;
  color: #eee;
}
#submitComment {
  margin-top: 8px;
  padding: 10px 14px;
  font-size: 14px;
  background-color: #0078d4;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
#submitComment:hover {
  background-color: #005fa3;
}
body.dark #submitComment {
  background-color: #0a84ff;
}
body.dark #submitComment:hover {
  background-color: #006edc;
}

/* ====== TOMBOL & LOADING ====== */
#loadMoreBtn {
  margin-top: 18px;
  padding: 10px 18px;
  font-size: 14px;
  background-color: #0078d4;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: inline-block;
}
#loadMoreBtn:hover {
  background-color: #005fa3;
}
body.dark #loadMoreBtn {
  background-color: #0a84ff;
}
body.dark #loadMoreBtn:hover {
  background-color: #006edc;
}
#loadingIndicator,
#recommendLoading {
  margin-top: 10px;
  font-size: 14px;
  color: #555;
}
body.dark #loadingIndicator,
body.dark #recommendLoading {
  color: #aaa;
}

/* ====== FILTER LANJUTAN (jika digunakan) ====== */
.filters-bar {
  background: #fff;
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin-bottom: 14px;
}
body.dark .filters-bar {
  background: #1a1a1a;
  box-shadow: none;
}
.filters-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
}
@media (max-width: 1024px) {
  .filters-row { grid-template-columns: 1fr; }
}
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.filter-group label {
  font-weight: 600;
  font-size: 13px;
}
#categoryMulti,
#channelFilter,
#sortBy,
#dateFrom,
#dateTo {
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
  color: #222;
  font-size: 14px;
  outline: none;
}
#categoryMulti:focus,
#channelFilter:focus,
#sortBy:focus,
#dateFrom:focus,
#dateTo:focus {
  border-color: #0078d4;
  box-shadow: 0 0 0 2px rgba(0,120,212,0.15);
}
body.dark #categoryMulti,
body.dark #channelFilter,
body.dark #sortBy,
body.dark #dateFrom,
body.dark #dateTo {
  background: #2a2a2a;
  border-color: #444;
  color: #eee;
}
#categoryMulti { min-height: 100px; }
.date-row { display: flex; align-items: center; gap: 8px; }
.date-sep { opacity: 0.6; }
.filters-actions {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#clearFilters {
  padding: 8px 12px;
  border: none;
  background: #e74c3c;
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
}
#clearFilters:hover { background: #c44133; }
#resultCount { font-size: 13px; opacity: 0.8; }

/* ====== MISC ====== */
img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}
a {
  color: inherit;
  text-decoration: none;
}