/* hungnguyenmedia — giao diện chung + bộ theme */
:root {
  --font: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius: 18px;
  --radius-sm: 10px;
  --max: 1240px;
  --transition: .25s cubic-bezier(.2,.8,.2,1);
}

/* ===== THEMES ===== */
:root, [data-theme="aurora"] {
  --scheme: dark;
  --bg: #0b0a1a; --bg2: #14122b; --card: rgba(255,255,255,.05); --card-hover: rgba(255,255,255,.09);
  --text: #f3f1ff; --muted: #a4a0c4; --border: rgba(255,255,255,.1);
  --accent: #8b5cf6; --accent2: #22d3ee; --on-accent: #fff;
  --glow: 0 20px 60px -20px rgba(139,92,246,.55);
  --hero-grad: linear-gradient(135deg, rgba(139,92,246,.75), rgba(34,211,238,.55));
  --blob1: #7c3aed; --blob2: #06b6d4;
}
[data-theme="midnight"] {
  --scheme: dark;
  --bg: #050b1a; --bg2: #0c1630; --card: rgba(255,255,255,.05); --card-hover: rgba(255,255,255,.09);
  --text: #eaf0ff; --muted: #92a1c4; --border: rgba(255,255,255,.1);
  --accent: #3b82f6; --accent2: #60a5fa; --on-accent: #fff;
  --glow: 0 20px 60px -20px rgba(59,130,246,.55);
  --hero-grad: linear-gradient(135deg, rgba(37,99,235,.8), rgba(14,165,233,.5));
  --blob1: #2563eb; --blob2: #0ea5e9;
}
[data-theme="ember"] {
  --scheme: dark;
  --bg: #120a08; --bg2: #1f100c; --card: rgba(255,255,255,.05); --card-hover: rgba(255,255,255,.09);
  --text: #fff4ec; --muted: #c7a89a; --border: rgba(255,255,255,.1);
  --accent: #f97316; --accent2: #ef4444; --on-accent: #fff;
  --glow: 0 20px 60px -20px rgba(249,115,22,.55);
  --hero-grad: linear-gradient(135deg, rgba(249,115,22,.8), rgba(239,68,68,.55));
  --blob1: #ea580c; --blob2: #dc2626;
}
[data-theme="ocean"] {
  --scheme: dark;
  --bg: #04141a; --bg2: #072530; --card: rgba(255,255,255,.05); --card-hover: rgba(255,255,255,.09);
  --text: #ecfeff; --muted: #8fbac4; --border: rgba(255,255,255,.1);
  --accent: #14b8a6; --accent2: #38bdf8; --on-accent: #04141a;
  --glow: 0 20px 60px -20px rgba(20,184,166,.55);
  --hero-grad: linear-gradient(135deg, rgba(20,184,166,.8), rgba(56,189,248,.5));
  --blob1: #0d9488; --blob2: #0284c7;
}
[data-theme="forest"] {
  --scheme: dark;
  --bg: #07130c; --bg2: #0f2216; --card: rgba(255,255,255,.05); --card-hover: rgba(255,255,255,.09);
  --text: #f0fdf4; --muted: #94b8a0; --border: rgba(255,255,255,.1);
  --accent: #22c55e; --accent2: #a3e635; --on-accent: #07130c;
  --glow: 0 20px 60px -20px rgba(34,197,94,.5);
  --hero-grad: linear-gradient(135deg, rgba(22,163,74,.8), rgba(132,204,22,.5));
  --blob1: #16a34a; --blob2: #65a30d;
}
[data-theme="daylight"] {
  --scheme: light;
  --bg: #f6f7fb; --bg2: #ffffff; --card: #ffffff; --card-hover: #ffffff;
  --text: #0f172a; --muted: #64748b; --border: rgba(15,23,42,.08);
  --accent: #6366f1; --accent2: #06b6d4; --on-accent: #fff;
  --glow: 0 20px 50px -20px rgba(99,102,241,.35);
  --hero-grad: linear-gradient(135deg, rgba(99,102,241,.85), rgba(6,182,212,.6));
  --blob1: #c7d2fe; --blob2: #a5f3fc;
}
[data-theme="blossom"] {
  --scheme: light;
  --bg: #fff7fa; --bg2: #ffffff; --card: #ffffff; --card-hover: #ffffff;
  --text: #3b1020; --muted: #9a6b7c; --border: rgba(59,16,32,.08);
  --accent: #ec4899; --accent2: #f59e0b; --on-accent: #fff;
  --glow: 0 20px 50px -20px rgba(236,72,153,.35);
  --hero-grad: linear-gradient(135deg, rgba(236,72,153,.85), rgba(245,158,11,.6));
  --blob1: #fbcfe8; --blob2: #fde68a;
}
[data-theme="mono"] {
  --scheme: light;
  --bg: #f2f2f2; --bg2: #ffffff; --card: #ffffff; --card-hover: #ffffff;
  --text: #111111; --muted: #6b6b6b; --border: rgba(0,0,0,.1);
  --accent: #111111; --accent2: #555555; --on-accent: #fff;
  --glow: 0 20px 50px -20px rgba(0,0,0,.3);
  --hero-grad: linear-gradient(135deg, rgba(17,17,17,.85), rgba(85,85,85,.6));
  --blob1: #d4d4d4; --blob2: #e5e5e5;
}

/* ===== BASE ===== */
* { box-sizing: border-box; }
html { color-scheme: var(--scheme); scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); background: var(--bg); color: var(--text);
  line-height: 1.55; -webkit-font-smoothing: antialiased; min-height: 100vh; overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
.container { width: min(var(--max), 100% - 32px); margin-inline: auto; }
.hidden { display: none !important; }

/* nền blob mờ */
.bg-blobs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-blobs::before, .bg-blobs::after {
  content: ''; position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(120px); opacity: .35;
  animation: float 18s ease-in-out infinite alternate;
}
.bg-blobs::before { background: var(--blob1); top: -25vmax; left: -15vmax; }
.bg-blobs::after { background: var(--blob2); bottom: -30vmax; right: -15vmax; animation-delay: -9s; }
@keyframes float { from { transform: translate(0,0) scale(1); } to { transform: translate(6vmax, 4vmax) scale(1.15); } }

/* ===== HEADER ===== */
.topbar {
  position: sticky; top: 0; z-index: 50; backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  background: color-mix(in srgb, var(--bg) 70%, transparent); border-bottom: 1px solid var(--border);
}
.topbar .container { display: flex; align-items: center; gap: 14px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em; font-size: 1.15rem; }
.logo .mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--on-accent);
  background: linear-gradient(135deg, var(--accent), var(--accent2)); box-shadow: var(--glow); font-size: .9rem;
}
.logo .brand-txt span { background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.spacer { flex: 1; }
.nav { display: flex; gap: 4px; }
.nav a { padding: 8px 12px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: .92rem; transition: var(--transition); }
.nav a:hover { color: var(--text); background: var(--card-hover); }

/* nút chung */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--card); cursor: pointer; font-weight: 600; font-size: .9rem; transition: var(--transition); white-space: nowrap;
}
.btn:hover { background: var(--card-hover); transform: translateY(-1px); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: var(--on-accent); border-color: transparent; box-shadow: var(--glow); }
.btn.danger { color: #ef4444; }
.btn.sm { padding: 6px 10px; font-size: .82rem; border-radius: 9px; }
.btn.icon { padding: 8px; width: 38px; height: 38px; justify-content: center; }

/* menu thả xuống */
.dd { position: relative; }
.dd-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; background: var(--bg2); border: 1px solid var(--border);
  border-radius: 14px; padding: 6px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.5); display: none; z-index: 60;
}
.dd.open .dd-menu { display: block; animation: pop .18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
.dd-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 9px; border: 0; background: transparent; cursor: pointer; text-align: left; font-size: .9rem; }
.dd-item:hover { background: var(--card-hover); }
.dd-item.active { background: color-mix(in srgb, var(--accent) 18%, transparent); font-weight: 700; }
.swatch { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); flex: none; }
.flag { font-size: .72rem; font-weight: 800; width: 24px; opacity: .7; }

/* ===== HERO ===== */
.hero { position: relative; margin-top: 22px; border-radius: 28px; overflow: hidden; min-height: 380px; display: flex; align-items: flex-end; isolation: isolate; box-shadow: var(--glow); }
.hero-bg { position: absolute; inset: 0; z-index: -2; background-size: cover; background-position: center; transform: scale(1.02); }
.hero-tint { position: absolute; inset: 0; z-index: -1; background: var(--hero-grad); mix-blend-mode: multiply; opacity: .45; }
.hero-tint::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.8) 0%, rgba(0,0,0,.35) 45%, rgba(0,0,0,0) 100%); }
.hero-content { padding: 40px; display: flex; gap: 26px; align-items: flex-end; width: 100%; color: #fff; }
.avatar {
  width: 128px; height: 128px; border-radius: 30px; flex: none; overflow: hidden; border: 4px solid rgba(255,255,255,.85);
  box-shadow: 0 20px 50px -10px rgba(0,0,0,.6); background: linear-gradient(135deg, var(--accent), var(--accent2)); display: grid; place-items: center;
  font-size: 3rem; font-weight: 800; color: #fff;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; }
.hero h1 { margin: 0; font-size: clamp(1.9rem, 4vw, 3.2rem); letter-spacing: -.03em; line-height: 1.05; text-shadow: 0 4px 30px rgba(0,0,0,.5); }
.hero .owner { opacity: .85; font-weight: 600; margin: 4px 0 8px; }
.hero .tagline { margin: 0; font-size: 1.05rem; max-width: 60ch; opacity: .95; text-shadow: 0 2px 20px rgba(0,0,0,.5); }
.hero-stats { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); backdrop-filter: blur(8px); font-size: .85rem; font-weight: 600; }
.socials { display: flex; gap: 8px; margin-left: auto; }
.socials a { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); backdrop-filter: blur(8px); transition: var(--transition); }
.socials a:hover { background: rgba(255,255,255,.3); transform: translateY(-2px); }
.socials svg { width: 20px; height: 20px; fill: #fff; }

/* ===== TOOLBAR ===== */
.section-head { display: flex; align-items: center; gap: 14px; margin: 40px 0 18px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: 1.5rem; letter-spacing: -.02em; }
.section-head h2 small { color: var(--muted); font-weight: 500; font-size: .95rem; margin-left: 8px; }
.search { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--card); min-width: 240px; }
.search input { border: 0; background: transparent; outline: 0; width: 100%; }
.cats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.cat { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); cursor: pointer; font-size: .86rem; font-weight: 600; color: var(--muted); transition: var(--transition); }
.cat:hover { color: var(--text); }
.cat.active { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: var(--on-accent); border-color: transparent; }

/* ===== GRID ===== */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; cursor: pointer;
  transition: var(--transition); display: flex; flex-direction: column; animation: rise .5s ease-out both;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.card:hover { transform: translateY(-5px); background: var(--card-hover); box-shadow: var(--glow); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.thumb { position: relative; aspect-ratio: 16/9; overflow: hidden; background: #000; }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.card:hover .thumb img { transform: scale(1.06); }
.play {
  position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(to top, rgba(0,0,0,.55), transparent 50%);
  opacity: .9; transition: var(--transition);
}
.play span {
  width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: var(--on-accent); box-shadow: 0 10px 30px rgba(0,0,0,.5); transform: scale(.9); transition: var(--transition);
}
.play svg { width: 26px; height: 26px; fill: currentColor; margin-left: 4px; }
.card:hover .play span { transform: scale(1.05); }
.badge { position: absolute; top: 10px; left: 10px; padding: 4px 9px; border-radius: 8px; background: rgba(0,0,0,.6); color: #fff; font-size: .75rem; font-weight: 700; backdrop-filter: blur(6px); }
.badge.demo { background: #f59e0b; color: #000; }
.views { position: absolute; bottom: 10px; right: 10px; display: inline-flex; gap: 5px; align-items: center; padding: 4px 9px; border-radius: 8px; background: rgba(0,0,0,.6); color: #fff; font-size: .78rem; font-weight: 700; backdrop-filter: blur(6px); }
.views svg { width: 14px; height: 14px; fill: currentColor; }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card h3 { margin: 0; font-size: 1.05rem; line-height: 1.3; letter-spacing: -.01em; }
.card p { margin: 0; color: var(--muted); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { margin-top: auto; display: flex; justify-content: space-between; align-items: center; font-size: .8rem; color: var(--muted); padding-top: 6px; }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); border: 1px dashed var(--border); border-radius: var(--radius); }

/* ===== ABOUT ===== */
.about { margin: 50px 0; display: grid; grid-template-columns: 1.2fr .8fr; gap: 26px; }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
.panel h2 { margin: 0 0 10px; letter-spacing: -.02em; }
.panel p { color: var(--muted); margin: 0; white-space: pre-line; }
.stat-list { display: grid; gap: 12px; }
.stat { display: flex; justify-content: space-between; padding: 12px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--border); }
.stat b { font-size: 1.2rem; background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }

footer { border-top: 1px solid var(--border); padding: 28px 0 40px; color: var(--muted); font-size: .85rem; margin-top: 30px; }
footer .container { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ===== PLAYER MODAL ===== */
.modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal.open { display: flex; }
.modal-bg { position: absolute; inset: 0; background: rgba(0,0,0,.8); backdrop-filter: blur(10px); animation: fade .2s ease-out; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
  position: relative; width: min(1100px, 100%); max-height: 100%; overflow: auto; background: var(--bg2); border: 1px solid var(--border);
  border-radius: 22px; box-shadow: 0 50px 100px -30px rgba(0,0,0,.8); animation: pop .25s ease-out;
}
.player { aspect-ratio: 16/9; background: #000; }
.player iframe { width: 100%; height: 100%; border: 0; display: block; }
.modal-info { padding: 22px 26px 28px; }
.modal-info h2 { margin: 0 0 6px; letter-spacing: -.02em; font-size: 1.4rem; }
.modal-info .line { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: .86rem; margin-bottom: 14px; align-items: center; }
.modal-info .desc-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.modal-info p { margin: 0; white-space: pre-line; }
.modal-close { position: absolute; top: 12px; right: 12px; z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 1.3rem; cursor: pointer; display: grid; place-items: center; }
.modal-close:hover { background: var(--accent); }
.modal-nav { display: flex; gap: 8px; margin-top: 18px; }

/* ===== ADMIN ===== */
.admin-wrap { display: grid; grid-template-columns: 240px 1fr; gap: 24px; margin: 24px auto 60px; }
.side { position: sticky; top: 84px; align-self: start; display: grid; gap: 6px; }
.side a { padding: 10px 14px; border-radius: 12px; color: var(--muted); font-weight: 600; cursor: pointer; }
.side a.active, .side a:hover { background: var(--card-hover); color: var(--text); }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: .82rem; font-weight: 700; color: var(--muted); }
.field input, .field textarea, .field select {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--card); outline: 0; transition: var(--transition);
}
.field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.field textarea { min-height: 90px; resize: vertical; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.lang-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.lang-tabs button { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); cursor: pointer; font-weight: 700; font-size: .82rem; }
.lang-tabs button.active { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: var(--on-accent); border-color: transparent; }
.lang-pane { display: none; } .lang-pane.active { display: block; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
td img { width: 88px; border-radius: 8px; }
.pill { padding: 3px 9px; border-radius: 999px; font-size: .75rem; font-weight: 700; background: color-mix(in srgb, var(--accent) 18%, transparent); }
.pill.off { background: rgba(239,68,68,.18); color: #ef4444; }
.login-box { max-width: 420px; margin: 80px auto; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--accent); color: var(--on-accent); padding: 12px 18px; border-radius: 12px; font-weight: 700; box-shadow: var(--glow); z-index: 200; display: none; }
.toast.show { display: block; animation: pop .2s ease-out; }
.preview-img { width: 100%; max-height: 180px; object-fit: cover; border-radius: 12px; border: 1px solid var(--border); }
.avatar-preview { width: 110px; height: 110px; border-radius: 26px; object-fit: cover; border: 1px solid var(--border); }
.yt-preview { aspect-ratio: 16/9; border-radius: 12px; overflow: hidden; background: #000; }
.yt-preview img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 860px) {
  .hero-content { flex-direction: column; align-items: flex-start; padding: 26px; }
  .socials { margin-left: 0; }
  .about { grid-template-columns: 1fr; }
  .admin-wrap { grid-template-columns: 1fr; }
  .side { position: static; grid-auto-flow: column; overflow-x: auto; }
  .nav { display: none; }
  .avatar { width: 96px; height: 96px; border-radius: 24px; }
  .topbar .container { gap: 8px; }
  .logo { font-size: 1rem; }
  #langName { display: none; }
  .search { min-width: 0; width: 100%; }
}
