/* language: CSS, file: style.css */
:root {
  --bg: #0a0a0f;
  --card: #14141c;
  --accent: #e50914;
  --accent-hover: #ff1a2b;
  --text: #e8e8ec;
  --muted: #8a8a96;
  --border: #22222c;
  --radius: 10px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,10,15,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1400px; margin: 0 auto;
  height: 68px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 24px;
}
.logo-center { display: flex; align-items: center; justify-content: center; }
.logo-text {
  font-size: 28px; font-weight: 800;
  color: var(--accent); letter-spacing: -0.5px;
}
.logo-text span { color: var(--text); }
.logo-img { max-height: 48px; }

.hero { max-width: 1400px; margin: 24px auto; padding: 0 24px; }
.hero-banner {
  position: relative;
  height: 340px;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(135deg, #1a0a0f 0%, #2a0a15 50%, #0f0a1a 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 32px;
  border: 1px solid var(--border);
}
.hero-banner::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10,10,15,0.95) 0%, transparent 60%);
}
.hero-content { position: relative; z-index: 1; max-width: 700px; text-align: center; }
.hero-center { text-align: center; margin: 0 auto; }
.hero-tag {
  display: inline-block;
  background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 12px;
}
.hero-content h1 { font-size: 36px; font-weight: 800; margin-bottom: 10px; line-height: 1.2; }
.hero-content p { color: var(--muted); font-size: 15px; margin-bottom: 18px; }
.hero-meta { display: flex; gap: 16px; font-size: 13px; color: var(--muted); }
.hero-meta-center { justify-content: center; }
.hero-meta span { display: flex; align-items: center; gap: 4px; }

.section { max-width: 1400px; margin: 40px auto; padding: 0 24px; }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.section-head h2 {
  font-size: 20px; font-weight: 700;
  display: flex; align-items: center; gap: 10px;
}
.section-head h2::before {
  content: ""; width: 4px; height: 20px;
  background: var(--accent); border-radius: 2px;
}
.section-head a { font-size: 13px; color: var(--muted); transition: color .15s; }
.section-head a:hover { color: var(--accent); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .2s, border-color .2s;
  cursor: pointer;
}
.card:hover { transform: translateY(-4px); border-color: var(--accent); }
.card-thumb {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #1a1a24, #22222e);
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.card-thumb::after {
  content: "▶"; position: absolute;
  width: 44px; height: 44px;
  background: rgba(229,9,20,0.9); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px;
  opacity: 0; transition: opacity .2s;
}
.card:hover .card-thumb::after { opacity: 1; }
.card-badge {
  position: absolute; top: 8px; left: 8px;
  background: rgba(0,0,0,0.75); color: #fff;
  font-size: 11px; font-weight: 600;
  padding: 3px 8px; border-radius: 4px;
}
.card-badge.hot { background: var(--accent); }
.card-body { padding: 12px; }
.card-body h3 {
  font-size: 14px; font-weight: 600; margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.card-body .meta { font-size: 12px; color: var(--muted); display: flex; gap: 10px; }

.watch-layout {
  max-width: 1400px; margin: 24px auto; padding: 0 24px;
  display: grid; grid-template-columns: 1fr 340px; gap: 28px;
}
.watch-main { min-width: 0; }
.video-wrap {
  position: relative; background: #000;
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 16/9;
}
.video-wrap video { width: 100%; height: 100%; display: block; }
.video-title { font-size: 22px; font-weight: 800; margin: 20px 0 12px; }
.video-stats {
  display: flex; gap: 18px; font-size: 13px; color: var(--muted);
  padding-bottom: 16px; border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.action-row { display: flex; gap: 10px; margin-bottom: 16px; }
.action-btn {
  padding: 9px 16px; border-radius: 10px;
  background: var(--card); border: 1px solid var(--border);
  font-size: 13px; font-weight: 600; color: var(--text);
  cursor: pointer; transition: all .2s;
}
.action-btn:hover { border-color: var(--accent); }
.action-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.video-desc { color: var(--muted); font-size: 14px; margin-bottom: 16px; line-height: 1.6; }

.hashtag-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.hashtag {
  padding: 6px 12px; border-radius: 20px;
  background: var(--card); border: 1px solid var(--border);
  font-size: 12px; color: var(--muted);
  transition: all .2s; cursor: pointer;
}
.hashtag:hover { border-color: var(--accent); color: var(--accent); }

.comments { margin-top: 32px; }
.comments h3 { font-size: 18px; font-weight: 700; margin-bottom: 16px; }
#commentForm { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
#commentForm input, #commentForm textarea {
  width: 100%; padding: 10px 14px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text);
  font-family: inherit; font-size: 14px; outline: none;
  transition: border-color .15s;
}
#commentForm input:focus, #commentForm textarea:focus { border-color: var(--accent); }
#commentForm textarea { min-height: 80px; resize: vertical; }
.btn-primary {
  padding: 10px 20px; border-radius: 8px;
  background: var(--accent); color: #fff;
  font-size: 14px; font-weight: 600; border: none;
  cursor: pointer; transition: background .15s;
  align-self: flex-start;
}
.btn-primary:hover { background: var(--accent-hover); }

.comment-item {
  display: flex; gap: 12px; padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.comment-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; flex-shrink: 0;
}
.comment-body { flex: 1; }
.comment-name { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.comment-text { font-size: 14px; color: var(--text); margin-bottom: 4px; }
.comment-time { font-size: 12px; color: var(--muted); }

.watch-side h3 { font-size: 16px; font-weight: 700; margin-bottom: 14px; }
.side-list { display: flex; flex-direction: column; gap: 10px; }
.side-card {
  display: flex; gap: 10px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px;
  transition: border-color .2s;
}
.side-card:hover { border-color: var(--accent); }
.side-thumb {
  width: 100px; aspect-ratio: 16/9;
  background: linear-gradient(135deg, #1a1a24, #22222e);
  border-radius: 6px; flex-shrink: 0;
}
.side-info { flex: 1; min-width: 0; }
.side-info h4 {
  font-size: 13px; font-weight: 600; line-height: 1.3;
  margin-bottom: 4px;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.side-info span { font-size: 11px; color: var(--muted); }

.ads-overlay {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,0.9);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.ads-box {
  width: 100%; max-width: 800px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.ads-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px; font-weight: 600;
}
.ads-head button {
  background: transparent; border: none;
  color: var(--text); font-size: 14px; cursor: pointer;
  padding: 6px 12px; border-radius: 6px;
}
.ads-head button:hover { background: var(--border); }
.ads-frame { width: 100%; height: 450px; border: none; display: block; }

footer {
  border-top: 1px solid var(--border);
  margin-top: 60px; padding: 40px 24px 24px;
  background: #08080c;
}
.footer-inner {
  max-width: 1400px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 32px;
}
.footer-col h4 { font-size: 14px; font-weight: 700; margin-bottom: 14px; }
.footer-col a { display: block; font-size: 13px; color: var(--muted); padding: 5px 0; transition: color .15s; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  max-width: 1400px; margin: 32px auto 0;
  padding-top: 20px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--muted);
  flex-wrap: wrap; gap: 10px;
}

.admin-body { background: #06060a; }
.admin-nav {
  background: #0e0e16; border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex; align-items: center; gap: 8px;
  height: 56px; overflow-x: auto;
}
.admin-nav a {
  padding: 8px 14px; border-radius: 8px;
  font-size: 14px; font-weight: 500; color: var(--muted);
  white-space: nowrap; transition: all .15s;
}
.admin-nav a:hover { color: var(--text); background: var(--card); }
.admin-nav a.logout { margin-left: auto; color: var(--accent); }
.admin-container { max-width: 1200px; margin: 32px auto; padding: 0 24px; }
.admin-container h1 { font-size: 24px; font-weight: 800; margin-bottom: 24px; }
.admin-container h2 { font-size: 18px; font-weight: 700; margin: 32px 0 16px; }
.admin-head-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.admin-head-row h1 { margin: 0; }

.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px; margin-bottom: 32px;
}
.stat-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  text-align: center;
}
.stat-num { font-size: 32px; font-weight: 800; color: var(--accent); }
.stat-label { font-size: 13px; color: var(--muted); margin-top: 4px; }

.admin-table {
  width: 100%; border-collapse: collapse;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.admin-table th, .admin-table td {
  padding: 12px 16px; text-align: left;
  font-size: 14px; border-bottom: 1px solid var(--border);
}
.admin-table th { background: #0e0e16; font-weight: 700; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table a { color: var(--accent); }

.admin-form { display: flex; flex-direction: column; gap: 18px; max-width: 700px; }
.admin-form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.admin-form input, .admin-form textarea {
  padding: 10px 14px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text);
  font-family: inherit; font-size: 14px; outline: none;
}
.admin-form input:focus, .admin-form textarea:focus { border-color: var(--accent); }
.admin-form button { align-self: flex-start; }
.logo-preview { max-height: 60px; margin: 8px 0; }

.btn-sm {
  padding: 6px 12px; border-radius: 6px;
  background: var(--card); border: 1px solid var(--border);
  color: var(--text); font-size: 13px; cursor: pointer;
  text-decoration: none; display: inline-block;
  transition: all .15s;
}
.btn-sm:hover { border-color: var(--accent); }
.btn-danger { color: var(--accent); }
.btn-danger:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

.flash {
  background: rgba(229,9,20,0.15);
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 10px 16px; border-radius: 8px;
  margin-bottom: 16px; font-size: 14px;
}

.admin-login-box {
  max-width: 380px; margin: 100px auto;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px;
}
.admin-login-box h1 { font-size: 22px; margin-bottom: 20px; text-align: center; }
.admin-login-box form { display: flex; flex-direction: column; gap: 12px; }
.admin-login-box input {
  padding: 12px 14px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 14px; outline: none;
}
.admin-login-box input:focus { border-color: var(--accent); }
.admin-login-box button { padding: 12px; }

@media (max-width: 900px) {
  .watch-layout { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .hero-banner { height: 240px; padding: 20px; }
  .hero-content h1 { font-size: 24px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .footer-bottom { flex-direction: column; text-align: center; }
}
/* ===== ROW LIST — mỗi video 1 hàng ===== */
.row-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.row-card {
  display: flex;
  gap: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .2s, border-color .2s, box-shadow .2s;
  cursor: pointer;
  text-decoration: none;
}

.row-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 12px 32px rgba(229,9,20,0.15);
}

.row-thumb {
  width: 320px;
  min-width: 320px;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #1a1a24, #22222e);
  position: relative;
  flex-shrink: 0;
}

.row-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  color: rgba(255,255,255,0.95);
  background: rgba(0,0,0,0.35);
  opacity: 0;
  transition: opacity .2s;
  text-shadow: 0 4px 20px rgba(0,0,0,0.8);
}

.row-card:hover .row-play {
  opacity: 1;
}

.row-body {
  flex: 1;
  min-width: 0;
  padding: 20px 20px 20px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.row-body h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.row-card:hover .row-body h3 {
  color: var(--accent);
}

.row-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.row-meta {
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
}

/* Responsive — mobile chuyển về dọc */
@media (max-width: 768px) {
  .row-card {
    flex-direction: column;
    gap: 0;
  }
  .row-thumb {
    width: 100%;
    min-width: 0;
  }
  .row-body {
    padding: 14px;
  }
  .row-body h3 {
    font-size: 15px;
  }
  .row-desc {
    font-size: 13px;
    -webkit-line-clamp: 2;
  }
}