/* /public_html/assets/css/style.css
   Theme: Dark, mobile-first, gọn nhẹ
   By: GPT x Anh Tú
*/

/* --------- CSS Reset nhẹ ---------- */
*,
*::before,
*::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; }
a { text-decoration: none; color: inherit; }

/* --------- Biến màu & font ---------- */
:root{
  --bg: #0f172a;       /* nền */
  --fg: #e2e8f0;       /* chữ */
  --muted: #94a3b8;    /* chữ phụ */
  --card: #111827;     /* nền thẻ */
  --line: #1f2937;     /* viền */
  --accent-1: #06b6d4; /* xanh lam nhạt */
  --accent-2: #3b82f6; /* xanh lam */
  --danger: #ef4444;
  --success: #34d399;
  --warn: #fbbf24;
  --shadow: 0 1px 2px rgba(0,0,0,.2), 0 8px 24px rgba(0,0,0,.25);
}

html, body{
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --------- Liên kết ---------- */
a { color: var(--accent-1); }
a:hover { text-decoration: underline; }

/* --------- Container ---------- */
.container{
  width: min(1100px, 92%);
  margin: 0 auto;
}

/* --------- Header ---------- */
.site-header{
  padding: 28px 0 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}
.site-header h1{
  margin: 0;
  font-size: clamp(20px, 4vw, 32px);
  letter-spacing: .2px;
}
.site-header .sub{
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14.5px;
}

/* --------- Grid danh sách ---------- */
.grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: stretch; /* các card trong cùng hàng cao bằng nhau */
}
@media (min-width: 560px){
  .grid{ grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px){
  .grid{ grid-template-columns: repeat(3, 1fr); }
}

/* --------- Card voucher ---------- */
.card{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  height: 100%;
}
.card:hover{
  transform: translateY(-2px);
  border-color: #334155;
  box-shadow: 0 6px 18px rgba(0,0,0,.35);
}

/* Ảnh 16:9 cố định */
.img-wrap{
  display: block;
  aspect-ratio: 16 / 9;
  background: #0b1220;
  overflow: hidden;
}
.card img{
  width: 100%;
  height: 100%;
  object-fit: cover; /* giữ 16:9 đẹp, có thể cắt nhẹ mép nếu ảnh lệch */
  transition: transform .35s ease;
}
.img-wrap:hover img{ transform: scale(1.03); }

/* Thân card */
.card-body{
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Tiêu đề: khóa đúng 2 dòng để card đều nhau */
.title{
  margin: 0;
  font-weight: 600;
  font-size: 18px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(18px * 1.35 * 2);
}

/* --------- CTA Button ---------- */
.cta{
  display: inline-block;
  text-align: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  color: #fff;
  font-weight: 700;
  letter-spacing: .2px;
  transition: filter .2s ease, transform .06s ease;
  will-change: transform;
}
.cta:hover{ filter: brightness(1.06); text-decoration: none; }
.cta:active{ transform: translateY(1px); }

/* --------- Empty State ---------- */
.empty{
  padding: 28px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed #334155;
  border-radius: 12px;
}

/* --------- Footer ---------- */
.site-footer{
  margin: 26px 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* --------- Form & Input (tái dùng cho admin) ---------- */
label{ color: var(--muted); font-size: 14px; }
input[type="text"],
input[type="url"],
input[type="password"],
input[type="file"],
select, textarea{
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #334155;
  background: #0b1220;
  color: var(--fg);
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
input:focus, select:focus, textarea:focus{
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(59,130,246,.25);
}

/* Nút chung */
button,
.btn{
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  cursor: pointer;
  transition: filter .2s ease, transform .06s ease;
}
button:hover, .btn:hover{ filter: brightness(1.06); }
button:active, .btn:active{ transform: translateY(1px); }
.btn-danger{ background: var(--danger); }
.btn-success{ background: var(--success); }
.btn-warn{ background: var(--warn); color: #111; }

/* --------- Table (admin) ---------- */
table{ width: 100%; border-collapse: collapse; }
th, td{
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left; vertical-align: middle;
}
th{ color: var(--muted); font-weight: 600; font-size: 14px; }
td a{ color: var(--accent-1); }

.status{ font-weight: 700; }
.status.on{ color: var(--success); }
.status.off{ color: var(--warn); }

.muted{ color: var(--muted); font-size: 13px; }

/* --------- Utility ---------- */
.rounded{ border-radius: 12px; }
.shadow{ box-shadow: var(--shadow); }
.hidden{ display: none !important; }

/* --------- Focus visible (a11y) ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible{
  outline: 2px dashed var(--accent-2);
  outline-offset: 2px;
}

/* --------- Scrollbar (WebKit) ---------- */
::-webkit-scrollbar{ width: 10px; height: 10px; }
::-webkit-scrollbar-thumb{ background: #1f2937; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover{ background: #2b3648; }

/* =======================================================
   POPUP QUẢNG CÁO (ảnh 16:9 + mô tả + 2 nút)
   ======================================================= */
.ads-overlay{
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, .6);
  backdrop-filter: saturate(120%) blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 9998;
  opacity: 0;
  animation: ads-fade-in .18s ease forwards;
}
.ads-modal{
  width: min(680px, 96vw);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transform: translateY(6px);
  animation: ads-pop-in .18s ease forwards;
}
.ads-content{
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ads-img-wrap{
  aspect-ratio: 16 / 9;
  background: #0b1220;
  overflow: hidden;
  border-radius: 10px;
}
.ads-img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ads-text{
  color: var(--fg);
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.ads-actions{
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 0 14px 14px 14px;
}
.ads-btn{
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  cursor: pointer;
  transition: filter .2s ease, transform .06s ease;
}
.ads-btn:hover{ filter: brightness(1.06); }
.ads-btn:active{ transform: translateY(1px); }
.ads-btn-muted{ background: #1f2937; color: #e2e8f0; }
.ads-overlay.closing{ animation: ads-fade-out .16s ease forwards; }
.ads-overlay.closing .ads-modal{ animation: ads-pop-out .16s ease forwards; }
@keyframes ads-fade-in{ from{opacity:0} to{opacity:1} }
@keyframes ads-fade-out{ from{opacity:1} to{opacity:0} }
@keyframes ads-pop-in{ from{opacity:0;transform:translateY(6px) scale(.98)} to{opacity:1;transform:translateY(0) scale(1)} }
@keyframes ads-pop-out{ from{opacity:1;transform:translateY(0) scale(1)} to{opacity:0;transform:translateY(6px) scale(.98)} }

/* =======================================================
   POPUP DANH SÁCH LINK (voucher) – mỗi dòng 1 nút, ẩn URL
   ======================================================= */
.links-list{
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}
.link-item{
  background: #0b1220;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
}
.link-btn{
  display: block;          /* full dòng cho dễ bấm */
  width: 100%;
  text-align: left;
  font-weight: 700;
  padding: 10px 12px;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  color: #fff;
  text-decoration: none;
  transition: filter .2s ease, transform .06s ease;
}
.link-btn:hover{ filter: brightness(1.06); text-decoration: none; }
.link-btn:active{ transform: translateY(1px); }

/* Ẩn URL phụ theo yêu cầu */
.link-url{ display: none; }
