:root {
  --fg: #fff;
  --bg: #000;
  --blur: 16px;
  --border: rgba(255,255,255,0.08);
  --glass-bg: rgba(20,20,20,0.45);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Inter, "Segoe UI", sans-serif;
  color: var(--fg);
  background: var(--bg);
  overflow: hidden;
  height: 100vh;
}

/* Video background */
#bg-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
}

/* Top bar */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 32px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur)) saturate(180%);
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  z-index: 10;
}

.left, .center, .right {
  position: absolute;
  top: 0;
  height: 32px;
  display: flex;
  align-items: center;
  padding: 0 10px;
}

.left {
  left: 8px;
  cursor: pointer;
}

.center {
  left: 50%;
  transform: translateX(-50%);
  cursor: pointer;
}

.right {
  right: 8px;
  gap: 6px;
  user-select: none;
}

/* Video button */
#video-btn {
  font-size: 20px;
  line-height: 1;
  opacity: 0.7;
  cursor: pointer;
  transition: opacity .2s, transform .2s;
  user-select: none;
}

#video-btn:hover {
  opacity: 1;
  transform: scale(1.2);
}

/* Popup base */
.popup {
  position: absolute;
  top: 40px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur)) saturate(180%);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s cubic-bezier(0.4,0,0.2,1);
  z-index: 20;
}

.popup.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* User menu */
#user-menu {
  position: fixed;
  top: 40px;
  right: 8px;
  background: rgba(20,20,20,0.30);
  backdrop-filter: blur(20px) saturate(180%);
  padding: 4px 0;
  z-index: 999;
  overflow: hidden;
}

#user-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  padding: 6px 14px;
  font-size: 14px;
  line-height: 1;
  height: 32px;
  border-radius: 6px;
  white-space: nowrap;
  transform: translateX(-6px);
  opacity: 0;
  animation: fadeSlideIn .35s cubic-bezier(0.4,0,0.2,1) forwards;
  transition: background .2s, transform .2s;
}

#user-menu a:nth-child(1) { animation-delay: 0.05s; }
#user-menu a:nth-child(2) { animation-delay: 0.1s; }
#user-menu a:nth-child(3) { animation-delay: 0.15s; }
#user-menu a:nth-child(4) { animation-delay: 0.2s; }
#user-menu a:nth-child(5) { animation-delay: 0.25s; }
#user-menu a:nth-child(6) { animation-delay: 0.3s; }

@keyframes fadeSlideIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

#user-menu a:hover {
  background: rgba(255,255,255,0.08);
  transform: translateX(4px);
}

/* Calendar */
#calendar-popup {
  left: 50%;
  transform: translate(-50%, -6px) scale(0.98);
  z-index: 25;
}

#calendar-popup.show {
  transform: translate(-50%, 0) scale(1);
}

.calendar {
  padding: 12px 14px;
  width: 240px;
  text-align: center;
}

.calendar h4 {
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 14px;
}

.calendar table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.calendar th {
  opacity: .6;
  padding: 3px 0;
}

.calendar td {
  padding: 4px 0;
  border-radius: 6px;
  transition: background .2s;
  cursor: pointer;
}

.calendar td:hover {
  background: rgba(255,255,255,.15);
}

.today {
  background: rgba(255,255,255,.3);
  font-weight: bold;
}

/* Search overlay */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(var(--blur));
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
  z-index: 30;
}

.search-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.search-box {
  background: rgba(255,255,255,0.07);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 12px 20px;
  width: 90%;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: popIn .3s cubic-bezier(0.4,0,0.2,1);
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.search-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 15px;
}

.search-box svg {
  width: 20px;
  height: 20px;
  stroke: #fff;
}

/* Video popup - New Modern Design */
#video-popup {
  right: 8px;
  width: 200px;
  padding: 8px;
  overflow: hidden;
  background: rgba(15,15,15,0.40);
  backdrop-filter: blur(24px) saturate(180%);
}

.video-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all .25s cubic-bezier(0.4,0,0.2,1);
  opacity: 0;
  transform: translateY(-8px);
  animation: videoSlideIn .4s cubic-bezier(0.4,0,0.2,1) forwards;
  position: relative;
  overflow: hidden;
}

.video-item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0));
  opacity: 0;
  transition: opacity .3s;
}

.video-item:hover::before {
  opacity: 1;
}

.video-item:nth-child(1) { animation-delay: 0.05s; }
.video-item:nth-child(2) { animation-delay: 0.1s; }
.video-item:nth-child(3) { animation-delay: 0.15s; }
.video-item:nth-child(4) { animation-delay: 0.2s; }
.video-item:nth-child(5) { animation-delay: 0.25s; }

@keyframes videoSlideIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.video-item:hover {
  background: rgba(255,255,255,0.08);
  transform: translateX(4px);
}

.video-item.active {
  background: linear-gradient(135deg, rgba(59,130,246,0.15), rgba(139,92,246,0.15));
  border: 1px solid rgba(59,130,246,0.3);
}

.video-icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.video-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.video-name {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-file {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  font-family: "Courier New", monospace;
}



/* UTE & Donate popups */
#ute-popup, #donate-popup {
  right: 8px;
  width: 320px;
  padding: 12px;
  background: rgba(20,20,20,0.35);
  backdrop-filter: blur(20px) saturate(180%);
  z-index: 1000;
}

.dashboard {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card {
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  text-decoration: none;
  color: white;
  transition: all .25s ease;
  cursor: pointer;
}

.card i {
  font-size: 20px;
  margin-bottom: 4px;
  opacity: 0.9;
}

.card h3 {
  font-size: 14px;
  margin-bottom: 3px;
}

.card p {
  font-size: 12px;
  opacity: 0.7;
}

.card:hover {
  background: rgba(255,255,255,0.12);
  transform: translateX(4px);
}

/* Bank overlay */
.bank-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  cursor: pointer;
}

.bank-overlay.show {
  display: flex;
}

.bank-overlay img {
  max-width: 90%;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

/* 🎵 Nút nhạc YouTube mini */
#music-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 48px;
  height: 48px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 9999;
  transition: transform 0.25s ease;
}
#music-btn:hover { transform: scale(1.15); }
#music-btn svg {
  width: 36px;
  height: 36px;
  fill: #fff;
  opacity: 1;
}

/* Video player */
#player-container {
  position: fixed;
  bottom: 80px;
  left: 20px;
  width: 320px;
  height: 180px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  box-shadow: 0 0 20px rgba(0,0,0,0.6);
  transform: scale(0);
  opacity: 0;
  transform-origin: bottom left;
  transition: all 0.3s ease;
  z-index: 9998;
}
#player-container.active {
  transform: scale(1);
  opacity: 1;
}
iframe { width: 100%; height: 100%; border: none; }

/* Ô nhập link */
#url-input {
  position: fixed;
  bottom: 20px;
  left: 80px;
  width: 220px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #30363d;
  background: rgba(255,255,255,0.08);
  color: #fff;
  outline: none;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 9999;
}
#url-input.active {
  opacity: 1;
  pointer-events: all;
}
#url-input::placeholder { color: #aaa; }
