/* ============================================================
   Flying Fish Media (FFM) - Giao diện Neon Dark
   ============================================================ */
:root {
  --bg: #070b14;
  --bg-2: #0d1424;
  --card: rgba(255,255,255,0.04);
  --card-border: rgba(255,255,255,0.09);
  --text: #e6edf7;
  --muted: #8b97ad;
  --cyan: #22d3ee;
  --violet: #8b5cf6;
  --pink: #f43f5e;
  --gold: #fbbf24;
  --grad: linear-gradient(120deg, #22d3ee, #8b5cf6 55%, #f43f5e);
  --radius: 18px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Be Vietnam Pro', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
::selection { background: rgba(139,92,246,.5); }

/* ---------- Nền động (blobs) ---------- */
.bg-blobs { position: fixed; inset: 0; z-index: -2; overflow: hidden; }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .35; animation: float 16s ease-in-out infinite alternate; }
.blob-1 { width: 480px; height: 480px; background: #0e7490; top: -140px; left: -120px; }
.blob-2 { width: 420px; height: 420px; background: #6d28d9; top: 30%; right: -160px; animation-delay: -5s; }
.blob-3 { width: 380px; height: 380px; background: #9f1239; bottom: -140px; left: 30%; animation-delay: -10s; }
@keyframes float {
  0%   { transform: translate(0,0) scale(1); }
  100% { transform: translate(60px, -50px) scale(1.15); }
}
.bg-grid {
  position: fixed; inset: 0; z-index: -1;
  background-image: linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 50% 0%, black 30%, transparent 75%);
}

/* ---------- Container ---------- */
.container { max-width: 1180px; margin: 0 auto; padding: 0 22px; }

/* ---------- Header ---------- */
header {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(16px);
  background: rgba(7,11,20,.72);
  border-bottom: 1px solid var(--card-border);
}
.nav { display: flex; align-items: center; gap: 26px; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.25rem; }
.logo .fish { font-size: 1.6rem; display: inline-block; animation: swim 3.5s ease-in-out infinite; }
@keyframes swim {
  0%,100% { transform: translateY(0) rotate(-8deg); }
  50%     { transform: translateY(-6px) rotate(6deg); }
}
.logo .brand { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo .tag { font-size: .62rem; font-weight: 700; color: var(--bg); background: var(--grad); border-radius: 6px; padding: 2px 7px; letter-spacing: 1px; }
.nav-links { display: flex; gap: 4px; margin-left: 8px; flex: 1; }
.nav-links a {
  padding: 8px 14px; border-radius: 10px; color: var(--muted);
  font-weight: 500; font-size: .95rem; transition: .2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); background: rgba(255,255,255,.06); }
.nav-auth { display: flex; gap: 10px; align-items: center; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid var(--card-border); font-size: .9rem; cursor: pointer; }
.user-chip .avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; font-size: .8rem; font-weight: 800; color: #fff; }

/* ---------- Nút ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 12px; border: none; cursor: pointer;
  font-family: inherit; font-size: .95rem; font-weight: 600; transition: .25s;
}
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 6px 24px rgba(139,92,246,.35); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 32px rgba(139,92,246,.5); }
.btn-ghost { background: rgba(255,255,255,.06); color: var(--text); border: 1px solid var(--card-border); }
.btn-ghost:hover { background: rgba(255,255,255,.12); }
.btn-sm { padding: 7px 14px; font-size: .85rem; border-radius: 9px; }
.btn-danger { background: rgba(244,63,94,.15); color: #fda4af; border: 1px solid rgba(244,63,94,.3); }
.btn-danger:hover { background: rgba(244,63,94,.3); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Hero ---------- */
.hero { padding: 84px 0 60px; text-align: center; position: relative; }
.hero .badge-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 16px;
  border-radius: 999px; background: rgba(34,211,238,.08); border: 1px solid rgba(34,211,238,.25);
  color: var(--cyan); font-size: .85rem; font-weight: 600; margin-bottom: 26px;
  animation: pulse-border 2.4s infinite;
}
@keyframes pulse-border {
  0%,100% { box-shadow: 0 0 0 0 rgba(34,211,238,.25); }
  50%     { box-shadow: 0 0 0 8px rgba(34,211,238,0); }
}
.hero h1 { font-size: clamp(2.1rem, 5.4vw, 3.8rem); font-weight: 800; line-height: 1.18; letter-spacing: -1px; }
.hero h1 .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .typing { color: var(--cyan); border-right: 3px solid var(--cyan); padding-right: 4px; animation: blink .8s step-end infinite; }
@keyframes blink { 50% { border-color: transparent; } }
.hero p.sub { max-width: 640px; margin: 22px auto 34px; color: var(--muted); font-size: 1.1rem; }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- Số liệu ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 60px 0 18px; }
.stat {
  background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius);
  padding: 24px 16px; text-align: center; transition: .3s;
}
.stat:hover { transform: translateY(-4px); border-color: rgba(34,211,238,.4); }
.stat .num { font-size: 2rem; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat .lbl { color: var(--muted); font-size: .88rem; margin-top: 4px; }

/* ---------- Section ---------- */
section { padding: 56px 0; }
.sec-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 30px; flex-wrap: wrap; }
.sec-head h2 { font-size: 1.75rem; font-weight: 800; letter-spacing: -.5px; }
.sec-head h2 .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sec-head p { color: var(--muted); margin-top: 6px; }

/* ---------- Card bài viết ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.post-card {
  background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius);
  overflow: hidden; transition: .3s; display: flex; flex-direction: column; position: relative;
}
.post-card:hover { transform: translateY(-6px); border-color: rgba(139,92,246,.5); box-shadow: 0 18px 44px rgba(0,0,0,.45); }
.post-cover {
  height: 150px; display: grid; place-items: center; font-size: 3.4rem;
  background: linear-gradient(135deg, rgba(34,211,238,.13), rgba(139,92,246,.16), rgba(244,63,94,.1));
  position: relative; overflow: hidden;
}
.post-cover::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 70% 20%, rgba(255,255,255,.1), transparent 55%);
}
.post-body { padding: 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.post-meta { display: flex; gap: 10px; align-items: center; font-size: .8rem; color: var(--muted); flex-wrap: wrap; }
.chip { padding: 3px 11px; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.chip-yt { background: rgba(244,63,94,.14); color: #fda4af; }
.chip-ai { background: rgba(34,211,238,.13); color: var(--cyan); }
.chip-kt { background: rgba(139,92,246,.15); color: #c4b5fd; }
.chip-tt { background: rgba(251,191,36,.13); color: var(--gold); }
.chip-premium { background: var(--grad); color: #fff; }
.post-body h3 { font-size: 1.08rem; line-height: 1.45; font-weight: 700; }
.post-card:hover h3 { color: var(--cyan); }
.post-body p { color: var(--muted); font-size: .92rem; flex: 1; }
.post-foot { display: flex; justify-content: space-between; align-items: center; font-size: .82rem; color: var(--muted); }

/* ---------- Card sản phẩm ---------- */
.product-card {
  background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius);
  padding: 26px; transition: .3s; position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 14px;
}
.product-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--grad); opacity: 0; transition: .3s;
}
.product-card:hover { transform: translateY(-6px); border-color: rgba(34,211,238,.45); box-shadow: 0 18px 44px rgba(0,0,0,.45); }
.product-card:hover::before { opacity: 1; }
.product-icon {
  width: 62px; height: 62px; border-radius: 16px; display: grid; place-items: center; font-size: 1.9rem;
  background: linear-gradient(135deg, rgba(34,211,238,.15), rgba(139,92,246,.2));
  border: 1px solid var(--card-border);
}
.product-badge {
  position: absolute; top: 18px; right: 18px; padding: 4px 12px; border-radius: 999px;
  font-size: .72rem; font-weight: 700; background: var(--grad); color: #fff;
  animation: pulse-border 2s infinite;
}
.product-card h3 { font-size: 1.2rem; font-weight: 700; }
.product-card .desc { color: var(--muted); font-size: .92rem; flex: 1; }
.features { list-style: none; display: flex; flex-direction: column; gap: 7px; font-size: .88rem; }
.features li { display: flex; gap: 9px; align-items: start; color: #c3cddd; }
.features li::before { content: '✓'; color: var(--cyan); font-weight: 800; }
.price-row { display: flex; gap: 10px; flex-wrap: wrap; }
.price-box { flex: 1; min-width: 120px; background: rgba(255,255,255,.04); border: 1px solid var(--card-border); border-radius: 12px; padding: 10px 14px; }
.price-box .p-lbl { font-size: .74rem; color: var(--muted); }
.price-box .p-val { font-weight: 800; font-size: 1.02rem; color: var(--cyan); }
.price-box.buy .p-val { color: var(--gold); }
.product-actions { display: flex; gap: 10px; }
.product-actions .btn { flex: 1; }

/* ---------- Quảng cáo ---------- */
.ad-slot { margin: 26px 0; }
.ad-demo {
  border: 1.5px dashed rgba(251,191,36,.4); border-radius: 14px; padding: 22px;
  text-align: center; background: rgba(251,191,36,.04); position: relative;
}
.ad-demo strong { display: block; font-size: 1.05rem; margin-bottom: 4px; }
.ad-demo p { color: var(--muted); font-size: .85rem; }
.ad-tag {
  position: absolute; top: -10px; left: 16px; background: var(--bg); padding: 1px 10px;
  font-size: .68rem; color: var(--gold); border: 1px solid rgba(251,191,36,.4); border-radius: 999px;
}

/* ---------- Trang bài viết ---------- */
.article { max-width: 780px; margin: 0 auto; padding: 48px 0; }
.article h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 800; line-height: 1.3; margin: 14px 0 18px; }
.article-cover { font-size: 4.5rem; text-align: center; padding: 34px; border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(34,211,238,.12), rgba(139,92,246,.15)); margin-bottom: 28px; }
.article-content { font-size: 1.05rem; color: #cdd7e5; white-space: pre-line; }
.locked-box {
  margin-top: 30px; padding: 34px; text-align: center; border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(139,92,246,.12), rgba(244,63,94,.1));
  border: 1px solid rgba(139,92,246,.35); position: relative; overflow: hidden;
}
.locked-box::before { content: '🔒'; font-size: 2.4rem; display: block; margin-bottom: 10px; }
.locked-box h3 { margin-bottom: 8px; }
.locked-box p { color: var(--muted); margin-bottom: 18px; }
.fade-lock { height: 90px; margin-top: -90px; position: relative;
  background: linear-gradient(transparent, var(--bg)); }

/* ---------- Layout blog + sidebar ---------- */
.blog-layout { display: grid; grid-template-columns: 1fr 300px; gap: 30px; align-items: start; }
.sidebar { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 20px; }
.side-card { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 20px; }
.side-card h4 { margin-bottom: 12px; font-size: 1rem; }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.filter-btn {
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--card-border);
  background: rgba(255,255,255,.04); color: var(--muted); cursor: pointer; font-family: inherit;
  font-size: .88rem; font-weight: 600; transition: .2s;
}
.filter-btn:hover { color: var(--text); }
.filter-btn.active { background: var(--grad); color: #fff; border-color: transparent; }
.search-box { display: flex; gap: 8px; margin-bottom: 20px; }
.search-box input { flex: 1; }

/* ---------- Form ---------- */
input, textarea, select {
  width: 100%; padding: 12px 15px; border-radius: 12px; font-family: inherit; font-size: .95rem;
  background: rgba(255,255,255,.05); border: 1px solid var(--card-border); color: var(--text);
  transition: .2s; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(139,92,246,.18); }
label { display: block; font-size: .87rem; font-weight: 600; margin-bottom: 6px; color: #b9c4d6; }
.form-group { margin-bottom: 16px; }
.auth-wrap { max-width: 430px; margin: 60px auto; }
.auth-card {
  background: var(--card); border: 1px solid var(--card-border); border-radius: 22px; padding: 36px;
  backdrop-filter: blur(10px); box-shadow: 0 24px 60px rgba(0,0,0,.4);
}
.auth-card h1 { font-size: 1.5rem; margin-bottom: 6px; text-align: center; }
.auth-card .sub { color: var(--muted); text-align: center; margin-bottom: 26px; font-size: .92rem; }
.auth-alt { text-align: center; margin-top: 18px; font-size: .9rem; color: var(--muted); }
.auth-alt a { color: var(--cyan); font-weight: 600; }
.msg { padding: 11px 15px; border-radius: 11px; font-size: .9rem; margin-bottom: 16px; display: none; }
.msg.error { display: block; background: rgba(244,63,94,.12); color: #fda4af; border: 1px solid rgba(244,63,94,.3); }
.msg.success { display: block; background: rgba(34,211,238,.1); color: var(--cyan); border: 1px solid rgba(34,211,238,.3); }

/* ---------- CTA đăng ký ---------- */
.cta-banner {
  border-radius: 24px; padding: 52px 40px; text-align: center; position: relative; overflow: hidden;
  background: linear-gradient(120deg, rgba(34,211,238,.14), rgba(139,92,246,.18), rgba(244,63,94,.12));
  border: 1px solid rgba(139,92,246,.3);
}
.cta-banner h2 { font-size: 1.9rem; font-weight: 800; margin-bottom: 12px; }
.cta-banner p { color: var(--muted); max-width: 560px; margin: 0 auto 26px; }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--card-border); padding: 48px 0 30px; margin-top: 40px; background: rgba(7,11,20,.6); }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; margin-bottom: 34px; }
.foot-grid h4 { font-size: .95rem; margin-bottom: 14px; }
.foot-grid a { display: block; color: var(--muted); font-size: .9rem; padding: 4px 0; transition: .2s; }
.foot-grid a:hover { color: var(--cyan); }
.foot-desc { color: var(--muted); font-size: .9rem; margin-top: 10px; max-width: 300px; }
.foot-bottom { text-align: center; color: var(--muted); font-size: .85rem; padding-top: 22px; border-top: 1px solid var(--card-border); }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.7); backdrop-filter: blur(6px);
  display: none; place-items: center; z-index: 200; padding: 20px;
}
.modal-overlay.open { display: grid; }
.modal {
  background: var(--bg-2); border: 1px solid var(--card-border); border-radius: 20px;
  padding: 30px; max-width: 480px; width: 100%; max-height: 88vh; overflow-y: auto;
  animation: modal-in .25s ease;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(24px) scale(.97); } }
.modal h3 { margin-bottom: 16px; }

/* ---------- Reveal khi cuộn ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Toast ---------- */
#toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--bg-2); border: 1px solid rgba(34,211,238,.4); color: var(--text);
  padding: 13px 24px; border-radius: 14px; z-index: 300; transition: .35s; opacity: 0;
  box-shadow: 0 12px 40px rgba(0,0,0,.5); font-size: .93rem;
}
#toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ---------- Admin ---------- */
.admin-layout { display: grid; grid-template-columns: 220px 1fr; gap: 26px; padding: 34px 0; align-items: start; }
.admin-menu { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 6px; }
.admin-menu button {
  text-align: left; padding: 12px 16px; border-radius: 12px; border: none; cursor: pointer;
  background: transparent; color: var(--muted); font-family: inherit; font-size: .93rem; font-weight: 600; transition: .2s;
}
.admin-menu button:hover { background: rgba(255,255,255,.05); color: var(--text); }
.admin-menu button.active { background: var(--grad); color: #fff; }
.admin-panel { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 26px; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--card-border); vertical-align: top; }
th { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .5px; }
tr:hover td { background: rgba(255,255,255,.025); }
.stat-mini-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 14px; margin-bottom: 26px; }

/* ---------- Video YouTube nhúng trong bài viết ---------- */
.video-embed {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  border-radius: 16px; overflow: hidden; background: #000;
  margin: 14px 0 22px; border: 1px solid var(--card-border);
  box-shadow: 0 14px 40px rgba(0,0,0,.45);
}
.video-embed iframe { width: 100%; height: 100%; border: 0; display: block; }
.chip-video { background: rgba(96,165,250,.15); color: #93c5fd; }

/* ---------- Link video sản phẩm ---------- */
.video-link {
  display: flex; align-items: center; gap: 6px; padding: 10px 14px;
  border-radius: 11px; font-size: .88rem; font-weight: 600;
  background: rgba(244,63,94,.1); border: 1px solid rgba(244,63,94,.3); color: #fda4af;
  transition: .2s;
}
.video-link:hover { background: rgba(244,63,94,.2); transform: translateY(-1px); }
.video-link-locked { background: rgba(255,255,255,.04); border-color: var(--card-border); color: var(--muted); }
.video-link-locked:hover { background: rgba(255,255,255,.08); color: var(--text); }

/* ---------- Bộ chọn emoji ---------- */
.emoji-picker {
  border: 1px solid var(--card-border); border-radius: 12px; padding: 12px;
  background: rgba(255,255,255,.03); max-height: 190px; overflow-y: auto; margin-top: 8px;
}
.emoji-group-label {
  font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .5px;
  margin: 8px 0 4px; font-weight: 700;
}
.emoji-group-label:first-child { margin-top: 0; }
.emoji-row { display: flex; flex-wrap: wrap; gap: 2px; }
.emoji-btn {
  width: 38px; height: 38px; display: grid; place-items: center; font-size: 1.25rem;
  background: transparent; border: 1.5px solid transparent; border-radius: 9px;
  cursor: pointer; transition: .15s;
}
.emoji-btn:hover { background: rgba(255,255,255,.08); transform: scale(1.18); }
.emoji-btn.selected { border-color: var(--cyan); background: rgba(34,211,238,.12); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .dash-2col { grid-template-columns: 1fr !important; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .blog-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-menu { position: static; flex-direction: row; flex-wrap: wrap; }
  .stat-mini-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 640px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .nav { justify-content: space-between; }
}
