/* ==== RESET & BASE ==== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(135deg, #121212 0%, #1e1a18 100%);
  color: #e0e0e0;
  padding: 20px;
  transition: all 0.3s ease;
}

/* ==== HEADER ==== */
.dashboard-container {
  max-width: 1200px;
  margin: auto;
  padding: 24px;
}
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 30px;
}
.dashboard-header h2 {
  font-size: 28px;
  font-weight: 600;
  color: #f1f1f1;
}
.emoji-wave {
  animation: wave 2s infinite;
  display: inline-block;
}
@keyframes wave {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(15deg); }
  40% { transform: rotate(-10deg); }
  60% { transform: rotate(10deg); }
  80% { transform: rotate(-5deg); }
}

/* ==== DARK MODE TOGGLE ==== */
.btn-dark-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #2a1d1d;
  color: #f0f0f0;
  border: 1px solid #3b2a2a;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.05);
  transition: background 0.2s ease, box-shadow 0.3s ease;
}
.btn-dark-toggle:hover {
  background: #3e2b2b;
  box-shadow: 0 0 10px rgba(255, 180, 120, 0.1);
}

/* ==== SUBKATEGORI SELECTOR ==== */
.subkategori-filter {
  margin-bottom: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.subkategori-filter label {
  font-weight: 500;
  font-size: 15px;
  color: #ccc;
}
.subkategori-filter select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  width: 100%;
  padding: 10px 16px;
  padding-right: 40px;
  font-size: 14px;
  font-weight: 500;
  color: #eee;
  background-color: #1e1e1e;
  border: 1px solid #444;
  border-radius: 10px;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.03), 0 2px 6px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  cursor: pointer;
}

.subkategori-filter select:focus {
  outline: none;
  border-color: #bb946e;
  background-color: #292929;
  box-shadow: 0 0 0 2px rgba(192,144,96,0.3);
}

/* Container untuk select agar bisa dikustomisasi penuh */
.select-wrapper {
  position: relative;
  display: inline-block;
  width: 230px;
}

.select-wrapper::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  pointer-events: none;
  border-style: solid;
  border-width: 6px 5px 0 5px;
  border-color: #aaa transparent transparent transparent;
  transition: all 0.2s ease;
}

/* ==== KATEGORI ==== */
.kategori-section {
  margin-bottom: 40px;
  opacity: 0;
  transform: translateY(40px);
  animation: fadeInSection 0.6s ease forwards;
  animation-delay: var(--fade-delay, 0s);
}

.kategori-title {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 16px;
  color: #ddd;
}

@keyframes fadeInSection {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.feather {
  transition: transform 0.2s ease, color 0.2s ease;
}
.feather:hover {
  transform: scale(1.1) rotate(5deg);
  color: #f2b97f;
}

body:not(.dark) .feather:hover {
  color: #bb7c3d;
}


/* ==== VIDEO GRID ==== */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  justify-content: center;
}

.video-card {
  background: #161616;
  border-radius: 14px;
  overflow: hidden;
  max-width: 360px;
  margin: 0 auto;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.6),
    inset 0 0 0.5px #3b2a2a;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.video-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.7);
}

/* Untuk menyembunyikan dengan transisi */
.video-card.hidden {
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
  position: absolute;
  visibility: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease;
}


.thumbnail-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.thumbnail-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.thumbnail-wrapper:hover img {
  transform: scale(1.05);
}

.play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: background 0.25s ease, transform 0.25s ease;
}

.video-card:hover .play-icon {
  background: rgba(255, 255, 255, 0.15);
  transform: translate(-50%, -50%) scale(1.1); /* tetap di tengah saat membesar */
  box-shadow: 0 0 10px rgba(255,255,255,0.25);
}

.video-info {
  padding: 14px 16px;
}
.video-info h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #fefefe;
}
.video-info .subkategori {
  font-size: 13px;
  color: #aaa;
}
.video-info .upload-date {
  font-size: 12px;
  color: #777;
}

/* ==== MODAL VIDEO ==== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0, 0, 0, 0.92);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.modal-overlay.show {
  display: flex;
  opacity: 1;
  animation: fadeIn 0.3s ease-in-out forwards;
}
.modal-content {
  position: relative;
  max-width: 850px;
  width: 95%;
  background: #1c1c1c;
  border-radius: 12px;
  padding: 30px 20px 20px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.6);
}
.modal-content video {
  width: 100%;
  border-radius: 8px;
}
.video-wrapper {
  position: relative;
  z-index: 1;
}
.close-modal {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #2c2c2c;
  border: none;
  color: white;
  font-size: 20px;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s ease, transform 0.2s ease;
}
.close-modal:hover {
  background: #444;
  transform: scale(1.05);
}

/* ==== LIGHT MODE PREMIUM ==== */
body:not(.dark) {
  background: linear-gradient(to bottom right, #fcf8f4, #eee7de);
  color: #222;
}
body:not(.dark) .dashboard-header h2 { color: #2b2b2b; }
body:not(.dark) .btn-dark-toggle {
  background: #e6e1da;
  color: #333;
  border: 1px solid #d2cbc3;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
body:not(.dark) .btn-dark-toggle:hover {
  background: #ddd5cc;
}
body:not(.dark) .kategori-title { color: #3b3b3b; }
body:not(.dark) .video-card {
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
body:not(.dark) .video-card:hover {
  box-shadow: 0 16px 32px rgba(0,0,0,0.12);
}
body:not(.dark) .video-info h4 { color: #1f1f1f; }
body:not(.dark) .video-info .subkategori { color: #625a4f; }
body:not(.dark) .video-info .upload-date { color: #999085; }
body:not(.dark) .modal-content {
  background: #fffdfc;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}
body:not(.dark) .close-modal {
  background: #f0f0f0;
  color: #333;
}
body:not(.dark) .close-modal:hover {
  background: #ccc;
}
body:not(.dark) .logout-fixed {
  background: #96725c;
}
body:not(.dark) .logout-fixed:hover {
  background: #7b5b49;
}
body:not(.dark) .subkategori-filter label {
  color: #333;
}
body:not(.dark) .select-wrapper::after {
  border-color: #555 transparent transparent transparent;
}
body:not(.dark) .subkategori-filter select {
  background-color: #fff;
  color: #333;
  border: 1px solid #ccc;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
body:not(.dark) .subkategori-filter select:focus {
  background-color: #f9f5f1;
  border-color: #c4a27f;
  box-shadow: 0 0 0 2px rgba(190,140,100,0.2);
}
body:not(.dark) .emoji-wave {
  filter: brightness(0);
}

/* ==== LOGOUT ==== */
.logout-fixed {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #8b2e2e;
  color: #fff;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 14px;
  border: none;
  box-shadow: 0 6px 14px rgba(0,0,0,0.4);
  transition: background 0.3s ease;
}
.logout-fixed:hover {
  background: #7a2626;
}

/* ==== NO VIDEO ==== */
.no-video {
  font-style: italic;
  color: #aaa;
}

/* ==== TRANSISI & ANIMASI ==== */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}

/* ==== RESPONSIVE ==== */
@media (max-width: 1024px) {
  .dashboard-container {
    padding: 16px;
  }
}
@media (max-width: 768px) {
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .dashboard-header h2 {
    font-size: 22px;
  }
  .video-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}
@media (max-width: 480px) {
  .video-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .video-info {
    padding: 12px;
  }
  .logout-fixed {
    font-size: 13px;
    padding: 8px 12px;
    bottom: 12px;
    right: 12px;
  }
  .modal-content {
    padding: 12px;
  }
  .close-modal {
    top: 8px;
    right: 10px;
  }
}

.dashboard-container {
  max-width: 1200px;
  margin: auto;
  padding: 24px;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.dashboard-header h2 {
  font-size: 28px;
  font-weight: 600;
  color: #f1f1f1;
}
.emoji-wave {
  animation: wave 2s infinite;
  display: inline-block;
}
@keyframes wave {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(15deg); }
  40% { transform: rotate(-10deg); }
  60% { transform: rotate(10deg); }
  80% { transform: rotate(-5deg); }
}

.btn-dark-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #2a1d1d;
  color: #f0f0f0;
  border: 1px solid #3b2a2a;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.05);
  transition: background 0.2s ease, box-shadow 0.3s ease;
}

.btn-dark-toggle:hover {
  background: #3e2b2b;
  box-shadow: 0 0 10px rgba(255, 180, 120, 0.1);
}

.subkategori-filter {
  margin-bottom: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.subkategori-filter label {
  font-weight: 500;
  font-size: 15px;
  color: #ccc;
}

.select-wrapper {
  position: relative;
  display: inline-block;
  width: 230px;
}

.subkategori-filter select {
  appearance: none;
  width: 100%;
  padding: 10px 16px;
  padding-right: 40px;
  font-size: 14px;
  font-weight: 500;
  color: #eee;
  background-color: #1e1e1e;
  border: 1px solid #444;
  border-radius: 10px;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.03), 0 2px 6px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  cursor: pointer;
}

.select-wrapper::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  pointer-events: none;
  border-style: solid;
  border-width: 6px 5px 0 5px;
  border-color: #aaa transparent transparent transparent;
  transition: all 0.2s ease;
}

.subkategori-filter select:focus {
  outline: none;
  border-color: #bb946e;
  background-color: #292929;
  box-shadow: 0 0 0 2px rgba(192,144,96,0.3);
}

.kategori-section {
  margin-bottom: 40px;
}
.kategori-title {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 16px;
  color: #ddd;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  justify-content: center;
}

.video-card {
  background: #161616;
  border-radius: 14px;
  overflow: hidden;
  max-width: 360px;
  margin: 0 auto;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.6),
    inset 0 0 0.5px #3b2a2a;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.video-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.7);
}

.thumbnail-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.thumbnail-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.thumbnail-wrapper:hover img {
  transform: scale(1.05);
}

.play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: background 0.25s ease, transform 0.25s ease;
}

.video-card:hover .play-icon {
  background: rgba(255, 255, 255, 0.15);
  transform: translate(-50%, -50%) scale(1.1);
  box-shadow: 0 0 10px rgba(255,255,255,0.25);
}

.video-info {
  padding: 14px 16px;
}
.video-info h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #fefefe;
}
.video-info .subkategori {
  font-size: 13px;
  color: #aaa;
}
.video-info .upload-date {
  font-size: 12px;
  color: #777;
}

.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0, 0, 0, 0.92);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.modal-overlay.show {
  display: flex;
  opacity: 1;
  animation: fadeIn 0.3s ease-in-out forwards;
}
.modal-content {
  position: relative;
  max-width: 850px;
  width: 95%;
  background: #1c1c1c;
  border-radius: 12px;
  padding: 30px 20px 20px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.6);
}
.modal-content video {
  width: 100%;
  border-radius: 8px;
}
.video-wrapper {
  position: relative;
  z-index: 1;
}
.close-modal {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #2c2c2c;
  border: none;
  color: white;
  font-size: 20px;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s ease, transform 0.2s ease;
}
.close-modal:hover {
  background: #444;
  transform: scale(1.05);
}

body:not(.dark) {
  background: linear-gradient(to bottom right, #fdfbf7, #eee7dd);
  color: #222;
}
body:not(.dark) .dashboard-header h2 { color: #2b2b2b; }
body:not(.dark) .btn-dark-toggle {
  background: #e6e1da;
  color: #333;
  border: 1px solid #d2cbc3;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
body:not(.dark) .btn-dark-toggle:hover {
  background: #ddd5cc;
}
body:not(.dark) .kategori-title { color: #3b3b3b; }
body:not(.dark) .video-card {
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
body:not(.dark) .video-card:hover {
  box-shadow: 0 16px 32px rgba(0,0,0,0.12);
}
body:not(.dark) .video-info h4 { color: #1f1f1f; }
body:not(.dark) .video-info .subkategori { color: #625a4f; }
body:not(.dark) .video-info .upload-date { color: #999085; }
body:not(.dark) .modal-content {
  background: #fffdfc;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}
body:not(.dark) .close-modal {
  background: #f0f0f0;
  color: #333;
}
body:not(.dark) .close-modal:hover {
  background: #ccc;
}
body:not(.dark) .logout-fixed {
  background: #96725c;
}
body:not(.dark) .logout-fixed:hover {
  background: #7b5b49;
}
body:not(.dark) .subkategori-filter label {
  color: #333;
}
body:not(.dark) .select-wrapper::after {
  border-color: #555 transparent transparent transparent;
}
body:not(.dark) .subkategori-filter select {
  background-color: #fff;
  color: #333;
  border: 1px solid #ccc;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
body:not(.dark) .subkategori-filter select:focus {
  background-color: #f9f5f1;
  border-color: #c4a27f;
  box-shadow: 0 0 0 2px rgba(190,140,100,0.2);
}
body:not(.dark) .emoji-wave {
  filter: brightness(0);
}

.logout-fixed {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #8b2e2e;
  color: #fff;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 14px;
  border: none;
  box-shadow: 0 6px 14px rgba(0,0,0,0.4);
  transition: background 0.3s ease;
}
.logout-fixed:hover {
  background: #7a2626;
}

.no-video {
  font-style: italic;
  color: #aaa;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}

@media (max-width: 1024px) {
  .dashboard-container {
    padding: 16px;
  }
}
@media (max-width: 768px) {
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .dashboard-header h2 {
    font-size: 22px;
  }
  .video-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}
@media (max-width: 480px) {
  .video-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .video-info {
    padding: 12px;
  }
  .logout-fixed {
    font-size: 13px;
    padding: 8px 12px;
    bottom: 12px;
    right: 12px;
  }
  .modal-content {
    padding: 12px;
  }
  .close-modal {
    top: 8px;
    right: 10px;
  }
}

