/* =========================================================
   COMPONENTS.CSS — Các "mảnh ghép" dùng lại nhiều lần:
   nút bấm, thẻ (card), nhãn, bảng, biểu mẫu, bộ lọc...
   ========================================================= */

/* ---------- NÚT BẤM ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn svg { width: 18px; height: 18px; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }

.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { filter: brightness(0.93); }

.btn-outline { border-color: var(--border); color: var(--dark); background: #fff; }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-ghost-light { border-color: rgba(255, 255, 255, 0.35); color: #fff; }
.btn-ghost-light:hover { background: rgba(255, 255, 255, 0.12); }

.btn-white { background: #fff; color: var(--dark); }
.btn-white:hover { background: var(--primary-soft); }

.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-sm { padding: 7px 14px; font-size: 14px; }
.btn-block { width: 100%; }

.link-arrow {
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.link-arrow svg { width: 16px; height: 16px; transition: transform 0.15s; }
.link-arrow:hover svg { transform: translateX(3px); }

/* ---------- THẺ (CARD) ---------- */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s;
}

a.card { color: inherit; display: block; }
a.card:hover,
.card.hoverable:hover {
  box-shadow: var(--shadow-lift);
  transform: translateY(-3px);
}

.icon-box {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
}

.icon-box svg { width: 22px; height: 22px; }

.c-blue   { background: #e0f2fe; color: #0284c7; }
.c-amber  { background: #fef3c7; color: #d97706; }
.c-green  { background: #d1fae5; color: #059669; }
.c-cyan   { background: #cffafe; color: #0891b2; }
.c-rose   { background: #ffe4e6; color: #e11d48; }
.c-violet { background: #ede9fe; color: #7c3aed; }

.feature-card h3 { font-size: 19px; margin-bottom: 8px; }
.feature-card p { color: var(--muted); margin: 0; font-size: 15px; }

/* Thẻ giải đấu */
.tour-card {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.tour-cover {
  height: 140px;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 14px 18px;
  color: #fff;
}

.tour-cover .badge { position: absolute; top: 14px; left: 14px; }

.tour-cover .tour-type {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  background: rgba(0, 0, 0, 0.25);
  padding: 4px 10px;
  border-radius: 999px;
}

.tour-body { padding: 18px; flex: 1; display: flex; flex-direction: column; }
.tour-body h3 { font-size: 18px; margin-bottom: 12px; }

.meta-list { display: grid; gap: 7px; font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.meta-list li { display: flex; align-items: center; gap: 8px; }
.meta-list svg { width: 16px; height: 16px; flex-shrink: 0; }

.tour-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}

.price { font-family: var(--font-display); font-weight: 700; color: var(--dark); font-size: 18px; }

.progress { height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

/* Thẻ tin tức */
.news-card { padding: 0; overflow: hidden; }
.news-cover { aspect-ratio: 16 / 9; display: grid; place-items: center; color: rgba(255, 255, 255, 0.85); }
.news-cover svg { width: 44px; height: 44px; }
.news-body { padding: 18px 20px 22px; }
.news-body h3 { font-size: 18px; margin: 8px 0; }
.news-body p { color: var(--muted); font-size: 15px; margin: 0; }
.news-date { font-size: 13px; color: var(--muted); }

/* Thẻ sản phẩm shop */
.product-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.product-img { aspect-ratio: 1 / 1; display: grid; place-items: center; background: var(--surface); }
.product-img svg { width: 56px; height: 56px; }
.product-body { padding: 16px; display: flex; flex-direction: column; flex: 1; gap: 10px; }
.product-body h3 { font-size: 16px; margin: 0; }
.point-price { color: var(--primary); font-weight: 700; font-family: var(--font-display); font-size: 18px; }
.product-body .btn { margin-top: auto; }

/* Thẻ HLV / trọng tài */
.person-card { text-align: center; }
.avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  color: #fff;
}
.avatar-sm { width: 38px; height: 38px; font-size: 14px; margin: 0; }
.person-card h3 { font-size: 18px; margin-bottom: 4px; }
.person-stats { display: flex; justify-content: center; gap: 22px; margin: 16px 0; font-size: 13px; color: var(--muted); }
.person-stats b { display: block; font-family: var(--font-display); font-size: 18px; color: var(--dark); }

/* ---------- NHÃN (BADGE) ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-open    { background: #d1fae5; color: #047857; }
.badge-soon    { background: #e0f2fe; color: #0369a1; }
.badge-closed  { background: #fef3c7; color: #b45309; }
.badge-done    { background: #f1f5f9; color: #475569; }
.badge-level   { background: var(--primary-soft); color: var(--primary); font-family: var(--font-display); }

/* ---------- BẢNG XẾP HẠNG ---------- */
.table-wrap {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  box-shadow: var(--shadow);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  min-width: 600px;
}

.table th {
  text-align: left;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 600;
  padding: 14px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.table td { padding: 14px 18px; border-bottom: 1px solid var(--border); }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafcff; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

.player-cell { display: flex; align-items: center; gap: 12px; }
.player-cell b { color: var(--dark); display: block; }
.player-cell small { color: var(--muted); }

.rank {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-family: var(--font-display);
  background: var(--surface);
  color: var(--muted);
}

.rank-1 { background: #fde68a; color: #92400e; }
.rank-2 { background: #e2e8f0; color: #334155; }
.rank-3 { background: #fed7aa; color: #9a3412; }

/* ---------- BỘ LỌC (TABS / CHIPS) ---------- */
.toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 24px;
}

.chips { display: flex; gap: 8px; flex-wrap: wrap; }

.chip {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: #fff;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  color: var(--text);
}

.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background: var(--dark); border-color: var(--dark); color: #fff; }

.search {
  position: relative;
  margin-left: auto;
  min-width: 240px;
}

.search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.search input { padding-left: 42px; }

@media (max-width: 640px) {
  .search { margin-left: 0; width: 100%; min-width: 0; }
}

/* ---------- BIỂU MẪU (FORM) ---------- */
.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: var(--dark);
  margin-bottom: 6px;
}

.input,
select.input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--dark);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 150, 255, 0.12);
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

@media (max-width: 560px) {
  .form-row { grid-template-columns: 1fr; }
}

.auth-wrap {
  min-height: calc(100vh - var(--header-h));
  display: grid;
  place-items: center;
  padding: 48px 16px;
  background: radial-gradient(circle at 20% 10%, var(--primary-soft), transparent 45%),
              radial-gradient(circle at 85% 90%, var(--accent-soft), transparent 45%),
              var(--surface);
}

.auth-card { width: 100%; max-width: 460px; padding: 36px; }
.auth-card h1 { font-size: 28px; margin-bottom: 4px; }
.auth-card .text-muted { margin-bottom: 24px; }
.auth-switch { text-align: center; margin-top: 20px; font-size: 15px; }

/* ---------- THÔNG BÁO NHỎ (TOAST) ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--dark);
  color: #fff;
  padding: 12px 20px;
  border-radius: 12px;
  box-shadow: var(--shadow-lift);
  opacity: 0;
  transition: all 0.25s;
  z-index: 100;
  font-size: 15px;
  max-width: calc(100% - 32px);
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.empty {
  text-align: center;
  padding: 48px 16px;
  color: var(--muted);
}
