*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0f172a;
  color: #e5e7eb;
}

@keyframes appFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes slideFade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

body { display: flex; justify-content: center; align-items: stretch; }

.app {
  animation: appFadeIn 0.6s ease;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1100px;
  height: 100vh;
  overflow: hidden;
  background: linear-gradient(135deg, #0f172a 0%, #020617 70%);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 16px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.4);
}

.logo { display: flex; align-items: center; gap: 10px; }
.logo-mark {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(96, 165, 250, 0.9);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  color: #e5e7eb;
  box-shadow: 0 0 8px rgba(96, 165, 250, 0.5);
}
.logo-text { display: flex; flex-direction: column; }
.logo-title { font-size: 15px; font-weight: 600; }
.logo-subtitle { font-size: 11px; color: #9ca3af; }

.header-right { display: flex; align-items: center; gap: 10px; }

.order-btn {
  border-radius: 999px;
  padding: 8px 14px;
  border: 1px solid rgba(96, 165, 250, 0.7);
  background: rgba(37, 99, 235, 0.15);
  color: #e5e7eb;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: 0.2s ease;
}
.order-btn:hover {
  background: rgba(37, 99, 235, 0.4);
  border-color: rgba(129, 140, 248, 1);
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(96, 165, 250, 0.5);
}

.lang-select {
  border-radius: 999px;
  padding: 6px 10px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.8);
  color: #e5e7eb;
  font-size: 12px;
}

.app-body { flex: 1; display: flex; min-height: 0; }

.sidebar {
  width: 260px;
  border-right: 1px solid rgba(148, 163, 184, 0.3);
  display: flex;
  flex-direction: column;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(8px);
}

.tabs {
  display: flex;
  flex-direction: column;
  padding: 8px;
  gap: 6px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.tab-button {
  border-radius: 999px;
  border: none;
  padding: 8px 12px;
  font-size: 13px;
  background: rgba(30, 58, 138, 0.2);
  color: #e5e7eb;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: 0.25s ease;
}
.tab-button:hover { background: rgba(37, 99, 235, 0.35); }
.tab-button.active {
  background: rgba(37, 99, 235, 0.9);
  color: white;
  box-shadow: 0 4px 12px rgba(96, 165, 250, 0.6);
}

.subtabs { padding: 6px 8px 4px; border-bottom: 1px solid rgba(148, 163, 184, 0.35); }
.subtabs-row { display: flex; gap: 6px; margin-bottom: 4px; }

.subtab-button {
  flex: 1;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.7);
  color: #e5e7eb;
  font-size: 11px;
  padding: 5px 8px;
  cursor: pointer;
  transition: 0.2s ease;
  text-align: center;
  white-space: nowrap;
}
.subtab-button:hover {
  background: rgba(37, 99, 235, 0.4);
  border-color: rgba(129, 140, 248, 0.9);
}
.subtab-button.active {
  background: rgba(37, 99, 235, 0.9);
  border-color: rgba(129, 140, 248, 1);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(96, 165, 250, 0.5);
}

.list { flex: 1; overflow-y: auto; padding: 10px; animation: slideFade 0.25s ease; }
.hidden { display: none; }

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.7);
  cursor: pointer;
  transition: 0.25s ease;
  border: 1px solid transparent;
}
.list-item:hover {
  background: rgba(37, 99, 235, 0.35);
  border-color: rgba(96, 165, 250, 0.8);
  transform: scale(1.02);
  box-shadow: 0 4px 16px rgba(96, 165, 250, 0.3);
}
.list-item.playing {
  background: rgba(37, 99, 235, 0.7);
  border-color: rgba(129, 140, 248, 1);
}

.list-item-title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item-icon { font-size: 16px; flex-shrink: 0; }

.content {
  flex: 1;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}

.player-card {
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.95));
  padding: 18px;
  animation: slideFade 0.25s ease;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.5);
}

.player-title { font-size: 17px; font-weight: 600; }
.player-meta  { font-size: 13px; color: #9ca3af; margin-top: 6px; }

audio, iframe, video {
  width: 100%;
  margin-top: 14px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: #020617;
}

/* Responsive video wrapper for 4K + vertical (TikTok) */
.video-wrap{
  width:100%;
  margin-top:14px;
  border-radius: 12px;
  border: 1px solid rgba(148,163,184,.55);
  background:#020617;
  overflow:hidden;
}
.video-wrap video{
  width:100%;
  height: min(70vh, 720px);
  display:block;
  object-fit: contain;
  background:#020617;
  margin:0;
  border:none;
  border-radius:0;
}

/* Close X */
.close-x{
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15,23,42,.6);
  color: #e5e7eb;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.close-x:hover{
  background: rgba(37,99,235,.35);
  border-color: rgba(129,140,248,1);
}

.input, textarea, select {
  width: 100%;
  margin-top: 6px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(148,163,184,.6);
  background: #020617;
  color: #e5e7eb;
  outline: none;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-1 { display: grid; grid-template-columns: 1fr; gap: 10px; }

.footer {
  padding: 10px 14px;
  font-size: 12px;
  color: #9ca3af;
  border-top: 1px solid rgba(148, 163, 184, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.9);
}
.footer-dot { font-size: 16px; }

@media (max-width: 800px) { .sidebar { width: 210px; } }
@media (max-width: 640px) {
  .app-body { flex-direction: column; }
  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid rgba(148, 163, 184, 0.4);
    max-height: 240px;
  }
  .app-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .header-right { align-self: stretch; justify-content: space-between; flex-wrap: wrap; }
  .video-wrap video{ height: min(60vh, 560px); }
}
