/* ==========================================================
   JOBLINK Design System v4 — WHITE LUXURY / EDITORIAL / PREMIUM MOTION
   ----------------------------------------------------------------
   Bảng màu: White/Off-white layered + Black typography + 1 accent
             (Amber tinh chỉnh lại thành "Antique Gold" — vừa khớp
             ngữ nghĩa cũ "thưởng/tiền", vừa đúng tinh thần luxury).
   Type:     Fraunces (editorial serif — dùng CHỌN LỌC cho hero/eyebrow)
             + Sora (display) + Inter (body).
   Nguyên tắc: mọi selector / keyframe / class-name BÊN DƯỚI được GIỮ
   NGUYÊN 100% so với bản trước — chỉ đổi giá trị thị giác + bổ sung
   utility mới — để không phá bất kỳ trang nào trong 76 file PHP đang
   tham chiếu tới các class này (job-card, icon-tile, level-badge,
   modal [id$="-modal"], dropdown-panel, radar-*, anim-*, v.v.)
   ========================================================== */

:root {
  /* ---- Ink (chữ đen + nền dark-mode) — giữ tên biến, đổi giá trị ---- */
  --ink-950: #0A0A0A;
  --ink-900: #151515;
  --ink-800: #212121;

  /* ---- Brand = accent "graphite/black" dùng cho hành động chính ---- */
  --brand-500: #1A1A1A;
  --brand-600: #000000;

  /* ---- Amber = "Antique Gold" — accent DUY NHẤT có sắc màu, dùng cho
     tiền/thưởng/CTA nhấn mạnh — đúng tinh thần "một accent color". ---- */
  --amber-500: #B8925A;
  --amber-600: #96754A;

  /* ---- Nền trắng phân lớp (không phẳng #FFFFFF khắp nơi) ---- */
  --paper: #FAFAFA;
  --paper-0: #FFFFFF;
  --paper-1: #FAFAFA;
  --paper-2: #F6F6F5;
  --paper-3: #F1F0EE;
  --line: rgba(10,10,10,0.09);
  --line-soft: rgba(10,10,10,0.06);

  --emerald-500: #0F9D6C;
  --rose-500: #D93F5C;
  --sky-500: #2F7DBE;

  --radius-card: 1.125rem;
  --radius-pill: 0.75rem;

  /* ---- Motion system — easing "premium" tái sử dụng khắp site ---- */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);      /* expo-out mượt, sang */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-editorial: cubic-bezier(0.22, 1, 0.36, 1);

  /* Motion scale — dùng linh hoạt theo section 26 của brief */
  --dur-micro: 140ms;
  --dur-standard: 320ms;
  --dur-emphasis: 560ms;
  --dur-cinematic: 900ms;

  --shadow-soft: 0 1px 2px rgba(10,10,10,0.03), 0 10px 30px -12px rgba(10,10,10,0.10);
  --shadow-lift: 0 2px 4px rgba(10,10,10,0.04), 0 20px 40px -16px rgba(10,10,10,0.16);
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--paper);
  background-image:
    radial-gradient(60rem 30rem at 12% -10%, rgba(184,146,90,0.06), transparent 60%),
    radial-gradient(50rem 26rem at 110% 10%, rgba(10,10,10,0.035), transparent 55%);
  background-attachment: fixed;
}
.dark body {
  background-color: var(--ink-950);
  background-image:
    radial-gradient(60rem 30rem at 12% -10%, rgba(184,146,90,0.05), transparent 60%),
    radial-gradient(50rem 26rem at 110% 10%, rgba(255,255,255,0.03), transparent 55%);
}

h1, h2, h3, h4, .font-display { font-family: 'Sora', sans-serif; letter-spacing: -0.015em; }

/* Serif editorial — dùng CHỌN LỌC (hero headline, eyebrow, số liệu lớn) */
.font-serif-display { font-family: 'Fraunces', serif; font-optical-sizing: auto; letter-spacing: -0.01em; }

/* Nhãn nhỏ viết hoa kiểu editorial — dùng trước heading để tạo hierarchy */
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--amber-600);
}
.eyebrow::before { content: ''; width: 1.25rem; height: 1px; background: currentColor; opacity: 0.6; }

/* ---------------- Card phẳng (glass = bề mặt "nổi nhẹ" trên nền layered) ---------------- */
.glass {
  background: var(--paper-0);
  border: 1px solid var(--line);
}
.dark .glass {
  background: var(--ink-900);
  border: 1px solid rgba(255,255,255,0.08);
}

/* ---------------- Scrollbar ---------------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #E4E2DD; border-radius: 8px; }
.dark ::-webkit-scrollbar-thumb { background: #333; }

/* ---------------- Form fields ---------------- */
.input-field {
  width: 100%; padding: 0.7rem 1rem; border-radius: 0.65rem;
  border: 1px solid var(--line); background: var(--paper-0);
  font-size: 0.9375rem; transition: box-shadow var(--dur-standard) var(--ease-out), border-color var(--dur-standard);
}
.dark .input-field { border-color: rgba(255,255,255,0.15); background: rgba(255,255,255,0.04); color: var(--paper); }
.input-field::placeholder { color: rgba(10,10,10,0.38); }
.dark .input-field::placeholder { color: rgba(251,250,247,0.35); }
.input-field:focus { outline: none; border-color: var(--amber-500); box-shadow: 0 0 0 3px rgba(184,146,90,0.18); }
.input-field.field-error { border-color: var(--rose-500); animation: field-shake 0.4s var(--ease-out); }
.input-field.field-success { border-color: var(--emerald-500); }
@keyframes field-shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* Visible keyboard focus ring cho mọi phần tử tương tác (accessibility) */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--ink-950);
  outline-offset: 2px;
  border-radius: 4px;
}
.dark a:focus-visible, .dark button:focus-visible, .dark input:focus-visible, .dark select:focus-visible, .dark textarea:focus-visible {
  outline-color: var(--amber-500);
}

/* ---------------- Buttons (component classes) — mỗi loại có "personality" riêng ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.75rem 1.5rem; border-radius: var(--radius-pill);
  font-weight: 600; font-size: 0.9375rem; line-height: 1;
  transition: transform var(--dur-standard) var(--ease-spring), box-shadow var(--dur-standard) var(--ease-out), background-color var(--dur-standard);
  cursor: pointer; border: none;
}
.btn:active { transform: scale(0.965); }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.8125rem; }

/* Primary = "energetic" — đen tuyền, nhấc nhẹ + quét sáng khi hover */
.btn-primary {
  background: var(--brand-500);
  color: #FFFFFF;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15), 0 8px 20px -8px rgba(0,0,0,0.35);
}
.btn-primary:hover { background: var(--brand-600); box-shadow: 0 2px 4px rgba(0,0,0,0.2), 0 14px 28px -10px rgba(0,0,0,0.45); transform: translateY(-2px); }

/* Gold = CTA "phần thưởng" (rút tiền, nhận thưởng) — accent màu duy nhất */
.btn-gold {
  background: linear-gradient(135deg, var(--amber-500), var(--amber-600));
  color: #FFFFFF;
  box-shadow: 0 1px 2px rgba(150,117,74,0.25), 0 10px 22px -8px rgba(150,117,74,0.45);
}
.btn-gold:hover { box-shadow: 0 2px 4px rgba(150,117,74,0.3), 0 16px 30px -10px rgba(150,117,74,0.55); transform: translateY(-2px); }

/* Ghost = "elegant" — viền mảnh, hover chỉ đổi nền rất nhẹ, không nhấc */
.btn-ghost {
  background: transparent; border: 1px solid var(--line); color: inherit;
}
.dark .btn-ghost { border-color: rgba(255,255,255,0.18); }
.btn-ghost:hover { background: rgba(10,10,10,0.035); border-color: rgba(10,10,10,0.22); }
.dark .btn-ghost:hover { background: rgba(255,255,255,0.06); }

.btn-danger { background: var(--rose-500); color: white; box-shadow: 0 8px 18px -8px rgba(217,63,92,0.4); }
.btn-danger:hover { background: #C22F4C; transform: translateY(-1px); }

.btn-success { background: var(--emerald-500); color: white; box-shadow: 0 8px 18px -8px rgba(15,157,108,0.4); }
.btn-success:hover { background: #0C8259; transform: translateY(-1px); }

/* ---------------- Badges ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.3rem 0.8rem; border-radius: var(--radius-pill);
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.01em;
}
.badge-amber { background: rgba(184,146,90,0.12); color: var(--amber-600); }
.badge-emerald { background: rgba(15,157,108,0.1); color: var(--emerald-500); }
.badge-rose { background: rgba(217,63,92,0.1); color: var(--rose-500); }
.badge-sky { background: rgba(47,125,190,0.1); color: var(--sky-500); }

/* Huy hiệu cấp bậc — signature element: vòng phát sáng nhẹ quanh badge */
.level-badge {
  position: relative;
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 1rem; border-radius: var(--radius-pill);
  font-weight: 700; font-size: 0.875rem;
}
.level-badge::before {
  content: ''; position: absolute; inset: -3px; border-radius: inherit;
  background: inherit; filter: blur(8px); opacity: 0.45; z-index: -1;
}

/* ---------------- Skeleton loading ---------------- */
.skeleton {
  background: linear-gradient(90deg, rgba(10,10,10,0.05) 25%, rgba(10,10,10,0.1) 37%, rgba(10,10,10,0.05) 63%);
  background-size: 400% 100%; animation: skeleton-loading 1.4s ease infinite;
}
.dark .skeleton { background: linear-gradient(90deg, rgba(255,255,255,0.06) 25%, rgba(255,255,255,0.14) 37%, rgba(255,255,255,0.06) 63%); background-size: 400% 100%; }
@keyframes skeleton-loading { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------------- Page-load fade-in (tinh tế, không lạm dụng) ---------------- */
main { animation: fade-up var(--dur-emphasis) var(--ease-editorial); }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------------- Empty states ---------------- */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 4rem 1.5rem; text-align: center; color: rgba(10,10,10,0.48);
}
.dark .empty-state { color: rgba(251,250,247,0.45); }
.empty-state svg { width: 48px; height: 48px; margin-bottom: 1rem; opacity: 0.55; }

/* ---------------- Progress bar (EXP) ---------------- */
.progress-track { height: 0.625rem; border-radius: var(--radius-pill); background: rgba(10,10,10,0.07); overflow: hidden; }
.dark .progress-track { background: rgba(255,255,255,0.08); }
.progress-fill {
  height: 100%; border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--amber-500), var(--amber-600));
  transition: width 0.6s var(--ease-out);
}

/* ---------------- Reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------------- Mobile nav drawer ---------------- */
#mobile-nav {
  transition: max-height var(--dur-standard) var(--ease-out), opacity var(--dur-standard) var(--ease-out);
  max-height: 0; opacity: 0; overflow: hidden;
}
#mobile-nav.open { max-height: 480px; opacity: 1; }
#mobile-nav a { transition: transform var(--dur-standard) var(--ease-out), opacity var(--dur-standard) var(--ease-out); }
#mobile-nav:not(.open) a { transform: translateY(-4px); opacity: 0; }

/* ==========================================================
   ANIMATION SYSTEM — scroll reveal, ripple, shimmer, counter
   (GSAP/ScrollTrigger nâng cấp phần reveal ở app.js; các class
   dưới đây vẫn là fallback CSS thuần khi không có JS/GSAP)
   ========================================================== */

html { scroll-behavior: smooth; }
html.has-lenis { scroll-behavior: auto; } /* Lenis tự điều khiển scroll mượt */

/* ---------------- Scroll reveal (card, section xuất hiện khi cuộn tới) ---------------- */
.reveal {
  opacity: 0;
  transform: translateY(22px) scale(0.985);
  transition: opacity var(--dur-emphasis) var(--ease-editorial), transform var(--dur-emphasis) var(--ease-editorial);
  transition-delay: calc(var(--i, 0) * 70ms);
}
.reveal.in-view { opacity: 1; transform: translateY(0) scale(1); }

/* ---------------- Card hover nâng cấp: nhấc nhẹ + đổ bóng "editorial" tinh tế ---------------- */
.card-hover {
  transition: transform var(--dur-standard) var(--ease-out), box-shadow var(--dur-standard) var(--ease-out), border-color var(--dur-standard);
  will-change: transform;
}
.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
}
.dark .card-hover:hover {
  box-shadow: 0 16px 32px -10px rgba(0,0,0,0.5);
}

/* ---------------- 3D tilt tinh tế cho card nổi bật (opt-in qua data-tilt, xem app.js) ---------------- */
.card-tilt { transform-style: preserve-3d; transition: transform 0.2s var(--ease-out); }

/* ---------------- Ripple khi bấm nút ---------------- */
.btn { position: relative; overflow: hidden; }
.btn .ripple {
  position: absolute; border-radius: 50%; transform: scale(0);
  background: rgba(255,255,255,0.45); pointer-events: none;
  animation: ripple-expand 0.6s var(--ease-out);
}
.btn-ghost .ripple { background: rgba(10,10,10,0.14); }
.dark .btn-ghost .ripple { background: rgba(255,255,255,0.2); }
@keyframes ripple-expand { to { transform: scale(2.6); opacity: 0; } }

/* ---------------- Nút loading (spinner khi submit form) ---------------- */
.btn.is-loading { pointer-events: none; opacity: 0.85; }
.btn.is-loading .btn-label { opacity: 0; }
.btn.is-loading::after {
  content: ''; position: absolute; width: 1.1rem; height: 1.1rem;
  border-radius: 50%; border: 2px solid rgba(255,255,255,0.35); border-top-color: currentColor;
  animation: btn-spin 0.6s linear infinite;
}
.btn-ghost.is-loading::after { border-color: rgba(10,10,10,0.2); border-top-color: currentColor; }
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* ---------------- Level-badge: ánh sáng thở nhẹ + tia sáng quét qua (thưởng/huy hiệu) ---------------- */
.level-badge::before { animation: badge-glow 2.6s ease-in-out infinite; }
@keyframes badge-glow { 0%, 100% { opacity: 0.35; } 50% { opacity: 0.65; } }
.level-badge { position: relative; overflow: hidden; }
.level-badge::after {
  content: ''; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(115deg, transparent, rgba(255,255,255,0.5), transparent);
  animation: badge-sheen 3.2s ease-in-out infinite;
}
@keyframes badge-sheen { 0% { left: -60%; } 35%, 100% { left: 130%; } }

/* ---------------- Badge amber (điểm/EXP) nảy nhẹ khi vừa xuất hiện ---------------- */
.badge-pop { animation: badge-pop var(--dur-standard) var(--ease-spring); }
@keyframes badge-pop { 0% { transform: scale(0.6); opacity: 0; } 60% { transform: scale(1.1); opacity: 1; } 100% { transform: scale(1); } }

/* ---------------- Progress bar: chạy ánh sáng dọc theo thanh EXP ---------------- */
.progress-fill { position: relative; overflow: hidden; }
.progress-fill::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: progress-shine 1.8s ease-in-out infinite;
}
@keyframes progress-shine { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* ---------------- Toast: bật nảy nhẹ mượt (responsive personality) ---------------- */
.toast-enter { animation: toast-in var(--dur-standard) var(--ease-spring); }
@keyframes toast-in { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ---------------- Nav link: gạch chân trượt vào khi hover (elegant) ---------------- */
.nav-link { position: relative; }
.nav-link::after {
  content: ''; position: absolute; left: 0; right: 100%; bottom: -2px; height: 1.5px;
  background: var(--amber-500); transition: right var(--dur-standard) var(--ease-out);
}
.nav-link:hover::after, .nav-link.active::after { right: 0; }

/* ---------------- Đếm số mượt (ví, EXP, thống kê) dùng chung với JS counterTo() ---------------- */
[data-count-to] { font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .level-badge::before, .level-badge::after, .progress-fill::after { animation: none !important; }
}

/* ==========================================================
   ICON "PREMIUM" — ô nền gradient rất nhẹ + viền sáng mảnh cho icon
   nổi bật (feature card, thẻ Job, tab nộp bài...)
   ========================================================== */
.icon-tile {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 0.85rem;
  background: linear-gradient(135deg, rgba(10,10,10,0.06), rgba(10,10,10,0.02));
  color: var(--brand-500);
  box-shadow: inset 0 0 0 1px rgba(10,10,10,0.06);
  transition: transform var(--dur-standard) var(--ease-spring);
}
.dark .icon-tile { background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.03)); color: var(--paper); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1); }
.icon-tile svg { width: 52%; height: 52%; }
.card-hover:hover .icon-tile { transform: scale(1.08) rotate(-3deg); }
.icon-tile.tile-amber   { background: linear-gradient(135deg, rgba(184,146,90,0.22), rgba(184,146,90,0.05)); color: var(--amber-600); box-shadow: inset 0 0 0 1px rgba(184,146,90,0.22); }
.icon-tile.tile-emerald { background: linear-gradient(135deg, rgba(15,157,108,0.2), rgba(15,157,108,0.04)); color: var(--emerald-500); box-shadow: inset 0 0 0 1px rgba(15,157,108,0.18); }
.icon-tile.tile-sky     { background: linear-gradient(135deg, rgba(47,125,190,0.2), rgba(47,125,190,0.04)); color: var(--sky-500); box-shadow: inset 0 0 0 1px rgba(47,125,190,0.18); }

/* ---------------- Thẻ Job kiểu mới: viền nhấn trái khi hover + ribbon trạng thái ---------------- */
.job-card { position: relative; overflow: hidden; }
.job-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--amber-500), var(--brand-500));
  opacity: 0; transition: opacity var(--dur-standard) var(--ease-out);
}
.job-card:hover::before { opacity: 1; }
.job-card.is-paused { opacity: 0.72; }
.job-card.is-paused:hover { transform: none !important; box-shadow: none !important; }
.job-card-ribbon {
  position: absolute; top: 0.85rem; right: -2.15rem; transform: rotate(35deg);
  background: linear-gradient(135deg, var(--rose-500), #B7304C); color: #fff;
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.02em;
  padding: 0.22rem 2.2rem; box-shadow: 0 2px 6px rgba(0,0,0,0.18); z-index: 1;
}

/* ---------------- Icon inline (ui_icon()) — mượt hoá mọi nút/badge nhỏ có icon ---------------- */
a svg, button svg { transition: transform var(--dur-standard) var(--ease-out); }
a:hover svg, button:hover svg { transform: scale(1.1); }
.btn:active svg, a:active svg { transform: scale(0.94); }

/* ---------------- Tab icon-tile (job-detail.php) ---------------- */
.tab-icon-tile {
  width: 1.6rem; height: 1.6rem; border-radius: 0.5rem;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(10,10,10,0.055); color: rgba(10,10,10,0.45);
  transition: background var(--dur-standard), color var(--dur-standard);
}
.dark .tab-icon-tile { background: rgba(255,255,255,0.08); color: rgba(251,250,247,0.45); }
.tab-icon-tile svg { width: 60%; height: 60%; }
.job-tab-active .tab-icon-tile { background: linear-gradient(135deg, var(--amber-500), var(--amber-600)); color: #fff; }

/* ==========================================================
   MODAL / DROPDOWN — mượt bằng CSS thuần (@starting-style +
   transition-behavior: allow-discrete), giữ nguyên JS hiện có.
   ========================================================== */

#page-progress {
  position: fixed; top: 0; left: 0; height: 2.5px; width: 0%;
  background: linear-gradient(90deg, var(--amber-500), var(--brand-500));
  z-index: 10000; opacity: 0;
  box-shadow: 0 0 8px rgba(184,146,90,0.5);
  transition: width var(--dur-standard) var(--ease-out), opacity 0.2s;
}
#page-progress.active { opacity: 1; }
#page-progress.done { width: 100% !important; opacity: 0; transition: width 0.2s var(--ease-out), opacity 0.4s 0.15s; }

[id$="-modal"] {
  transition: opacity 0.28s var(--ease-out), background-color 0.28s var(--ease-out), display 0.28s allow-discrete;
}
[id$="-modal"].hidden { opacity: 0; }
[id$="-modal"]:not(.hidden) { opacity: 1; }
@starting-style { [id$="-modal"]:not(.hidden) { opacity: 0; } }

[id$="-modal"] > div:first-child {
  transition: transform 0.36s var(--ease-editorial), opacity 0.32s var(--ease-out);
  transform: scale(0.95) translateY(12px);
}
[id$="-modal"]:not(.hidden) > div:first-child { transform: scale(1) translateY(0); opacity: 1; }
[id$="-modal"].hidden > div:first-child { transform: scale(0.95) translateY(12px); opacity: 0; }
@starting-style {
  [id$="-modal"]:not(.hidden) > div:first-child { transform: scale(0.95) translateY(12px); opacity: 0; }
}

.dropdown-panel {
  transform-origin: top right;
  transition: opacity 0.2s var(--ease-out), transform 0.2s var(--ease-out), display 0.2s allow-discrete;
  transform: scale(0.96) translateY(-6px);
}
.dropdown-panel:not(.hidden) { transform: scale(1) translateY(0); opacity: 1; }
.dropdown-panel.hidden { opacity: 0; }
@starting-style { .dropdown-panel:not(.hidden) { opacity: 0; transform: scale(0.96) translateY(-6px); } }
.notif-row { animation: fade-up 0.3s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 40ms); }

[id^="tab-panel-"]:not(.hidden) { animation: fade-up 0.3s var(--ease-out); }
[id^="tab-btn-"] { transition: color var(--dur-standard) var(--ease-out), border-color var(--dur-standard) var(--ease-out); }

.theme-toggle-btn svg {
  transition: opacity 0.3s var(--ease-out), transform 0.35s var(--ease-out), display 0.3s allow-discrete;
  transform: rotate(0deg) scale(1);
}
.theme-toggle-btn svg.hidden { opacity: 0; transform: rotate(-90deg) scale(0.5); }
.theme-toggle-btn svg:not(.hidden) { opacity: 1; }
@starting-style { .theme-toggle-btn svg:not(.hidden) { opacity: 0; transform: rotate(90deg) scale(0.5); } }

.notif-pulse-badge { animation: notif-pop var(--dur-standard) var(--ease-spring), notif-pulse-ring 2.2s ease-in-out 0.4s infinite; }
@keyframes notif-pop { 0% { transform: scale(0); } 70% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes notif-pulse-ring { 0%, 100% { box-shadow: 0 0 0 0 rgba(217,63,92,0.5); } 50% { box-shadow: 0 0 0 4px rgba(217,63,92,0); } }

tbody tr { transition: background-color 0.18s var(--ease-out); }
tbody tr:hover { background-color: rgba(184,146,90,0.06); }
.dark tbody tr:hover { background-color: rgba(184,146,90,0.08); }

.empty-state svg { animation: empty-float 3s ease-in-out infinite; }
@keyframes empty-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* ---------------- Nút primary/gold: quét sáng nhẹ khi hover ("shine", chỉ 2 loại nút có) ---------------- */
.btn-primary, .btn-gold { position: relative; }
.btn-primary::before, .btn-gold::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,0.28) 50%, transparent 60%);
  background-size: 250% 100%; background-position: 100% 0;
  opacity: 0; transition: opacity 0.2s;
  pointer-events: none;
}
.btn-primary:hover::before, .btn-gold:hover::before { opacity: 1; animation: btn-sheen-sweep 1s ease-in-out; }
@keyframes btn-sheen-sweep { from { background-position: 100% 0; } to { background-position: -50% 0; } }

input[type="checkbox"], input[type="radio"] { transition: transform 0.12s var(--ease-out); accent-color: var(--ink-950); }
input[type="checkbox"]:active, input[type="radio"]:active { transform: scale(0.88); }

.underline-anim { background-image: linear-gradient(currentColor, currentColor); background-position: 0 100%; background-repeat: no-repeat; background-size: 0% 1px; transition: background-size var(--dur-standard) var(--ease-out); }
.underline-anim:hover { background-size: 100% 1px; }

.confetti-piece {
  position: fixed; top: -12px; z-index: 10001; border-radius: 2px; pointer-events: none;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(105vh) rotate(540deg); opacity: 0.9; }
}

@media (prefers-reduced-motion: reduce) {
  #page-progress, .notif-pulse-badge, .empty-state svg, .btn-primary::before, .btn-gold::before, .confetti-piece {
    animation: none !important;
  }
  [id$="-modal"] > div:first-child, .dropdown-panel, .theme-toggle-btn svg { transition: opacity 0.15s !important; transform: none !important; }
}

/* ============================================================
   Radar / trạng thái chờ — dùng cho trang "Tìm List Số"
   ============================================================ */
.radar-wrap { position: relative; width: 9rem; height: 9rem; margin: 0 auto; display: flex; align-items: center; justify-content: center; }
.radar-ring {
  position: absolute; inset: 0; border-radius: 9999px; border: 2px solid var(--amber-500);
  opacity: 0; animation: radar-ping 2.2s cubic-bezier(0.2, 0.6, 0.4, 1) infinite;
}
.radar-ring:nth-child(2) { animation-delay: 0.7s; }
.radar-ring:nth-child(3) { animation-delay: 1.4s; }
@keyframes radar-ping {
  0% { transform: scale(0.35); opacity: 0.7; }
  100% { transform: scale(1); opacity: 0; }
}
.radar-core {
  position: relative; z-index: 1; width: 3.25rem; height: 3.25rem; border-radius: 9999px;
  background: linear-gradient(135deg, var(--amber-500), var(--amber-600));
  display: flex; align-items: center; justify-content: center; color: #fff;
  box-shadow: 0 4px 18px rgba(184,146,90,0.4);
  animation: radar-core-pulse 1.6s ease-in-out infinite;
}
@keyframes radar-core-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.lookup-step { transition: opacity 0.3s ease, transform 0.3s ease; }
.lookup-step[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) {
  .radar-ring, .radar-core { animation: none !important; }
}

/* ============================================================
   Chat ảnh/emoji, nhóm, gọi video, widget hỗ trợ nổi.
   ============================================================ */
.anim-pop-in { animation: pro-pop-in 0.28s var(--ease-out) both; }
@keyframes pro-pop-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

.anim-msg-in { animation: pro-msg-in 0.22s ease-out both; }
@keyframes pro-msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.anim-online-pulse { animation: pro-online-pulse 1.8s ease-in-out infinite; }
@keyframes pro-online-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(15,157,108,0.5); } 50% { box-shadow: 0 0 0 4px rgba(15,157,108,0); } }

.anim-pulse-ring { animation: pro-pulse-ring 1.6s ease-in-out infinite; }
@keyframes pro-pulse-ring { 0%, 100% { box-shadow: 0 0 0 0 rgba(217,63,92,0.55); } 50% { box-shadow: 0 0 0 8px rgba(217,63,92,0); } }

.anim-float { animation: pro-float 2.6s ease-in-out infinite; }
@keyframes pro-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

.hover-nudge { transition: transform 0.15s ease; }
.hover-nudge:hover { transform: scale(1.08); }

.chat-img { transition: transform 0.2s ease, filter 0.2s ease; cursor: zoom-in; }
.chat-img:hover { transform: scale(1.02); filter: brightness(1.03); }

#support-panel { transform-origin: bottom right; }

@media (prefers-reduced-motion: reduce) {
  .anim-pop-in, .anim-msg-in, .anim-online-pulse, .anim-pulse-ring, .anim-float, .hover-nudge, .chat-img {
    animation: none !important; transition: none !important;
  }
}

/* ============================================================
   MỚI — LUXURY MOTION LAYER (header scroll-state, magnetic button,
   split-text reveal cho GSAP, hairline divider, noise nền, cursor)
   ============================================================ */

/* Header: co nhẹ + đổ bóng mảnh khi cuộn xuống (đặt class qua app.js) */
#site-header { transition: box-shadow var(--dur-standard) var(--ease-out), background-color var(--dur-standard) var(--ease-out), padding var(--dur-standard) var(--ease-out); }
#site-header.is-scrolled { box-shadow: 0 1px 0 var(--line), 0 12px 24px -18px rgba(10,10,10,0.18); }

/* Hairline divider editorial (thay cho border dày) */
.hairline { height: 1px; background: var(--line); border: none; }

/* Nút "magnetic" — JS dịch chuyển theo cursor qua transform (desktop only) */
.magnetic { transition: transform 0.35s var(--ease-out); }

/* Noise cực nhẹ phủ lên nền trắng — tạo chiều sâu mà không lộ rõ gradient */
.grain-overlay {
  position: fixed; inset: 0; pointer-events: none; z-index: 1; opacity: 0.035; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.dark .grain-overlay { opacity: 0.05; mix-blend-mode: overlay; }

/* Split-line reveal (chữ lớn) — GSAP bọc từng dòng trong span.split-line */
.split-line { overflow: hidden; display: block; }
.split-line > span { display: inline-block; will-change: transform; }

/* Cinematic image reveal — clip-path quét từ dưới lên, dùng cho ảnh/banner lớn */
.clip-reveal { clip-path: inset(0 0 100% 0); }
.clip-reveal.in-view { clip-path: inset(0 0 0% 0); transition: clip-path 1s var(--ease-editorial); }

/* Section — số thứ tự editorial nhỏ bên cạnh heading lớn (tuỳ chọn) */
.section-index { font-family: 'Fraunces', serif; font-style: italic; color: rgba(10,10,10,0.22); }
.dark .section-index { color: rgba(255,255,255,0.18); }

@media (hover: none) {
  .magnetic { transform: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  .clip-reveal { clip-path: none !important; }
  .split-line > span { transform: none !important; }
}

/* ============================================================
   "MỖI THAO TÁC MỘT CẢM XÚC RIÊNG" — mỗi loại hành động có một
   motion-personality khác nhau, thay vì dùng chung 1 hiệu ứng cho
   tất cả. Các class dưới đây được JS (assets/js/app.js) tự thêm/
   xoá tại đúng thời điểm — trang PHP không cần gọi gì thêm.
   ========================================================== */

/* ---- CORRECTIVE: hành động nguy hiểm (Từ chối / Thu hồi / Xoá) ----
   Rung nhẹ dứt khoát rồi tối màu đi trong chớp mắt trước khi thực sự
   submit — tạo cảm giác "khựng lại một nhịp" thay vì bấm phát ăn ngay,
   đúng tinh thần một hành động không thể hoàn tác. */
@keyframes action-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px) rotate(-1deg); }
  40% { transform: translateX(4px) rotate(1deg); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}
.action-shake { animation: action-shake 0.38s var(--ease-out); filter: brightness(0.92); }

/* ---- REWARDING: hành động tích cực (Duyệt / Kích hoạt / Xác nhận đã
   nhận tiền) — nổ nhẹ một vòng sáng lan ra từ tâm nút, như một tiếng
   "tách" hài lòng, khác hẳn cảm giác dứt khoát của action-shake. */
@keyframes action-burst-ring {
  0% { box-shadow: 0 0 0 0 rgba(15,157,108,0.55); }
  100% { box-shadow: 0 0 0 14px rgba(15,157,108,0); }
}
.action-burst { animation: action-burst-ring 0.5s var(--ease-out); }

/* ---- Nút "Sao chép": icon lật sang dấu tích + nền xanh ngọc thoáng
   qua rồi tự trở lại — khác hẳn 2 personality trên vì đây là phản hồi
   "đã xong việc", không cần chờ, không cảnh báo. ---- */
.btn.is-copied {
  background: var(--emerald-500) !important;
  color: #fff !important;
  transition: background-color 0.25s var(--ease-spring);
}
.btn.is-copied .copy-icon { animation: copy-check-pop 0.4s var(--ease-spring); }
@keyframes copy-check-pop { 0% { transform: scale(0.4) rotate(-20deg); opacity: 0; } 60% { transform: scale(1.15) rotate(4deg); } 100% { transform: scale(1) rotate(0); opacity: 1; } }

/* ---- Chuông thông báo: lắc kiểu chuông thật khi có tin mới — khác
   với notif-pulse-badge (chấm đỏ tự thở đều đặn ở trạng thái nghỉ). ---- */
@keyframes bell-ring {
  0%, 100% { transform: rotate(0); }
  15% { transform: rotate(14deg); }
  30% { transform: rotate(-12deg); }
  45% { transform: rotate(8deg); }
  60% { transform: rotate(-6deg); }
  75% { transform: rotate(3deg); }
}
.bell-ring { animation: bell-ring 0.6s ease-in-out; transform-origin: top center; }

/* ---- Toast: mỗi loại một cách "vào sân khấu" riêng — success nảy vào
   đầy tự tin, error trượt vào rồi khựng lại như đang xin lỗi, info/
   warning giữ kiểu trượt điềm tĩnh mặc định (.toast-enter). ---- */
@keyframes toast-in-success {
  0% { transform: translateX(120%) scale(0.9); opacity: 0; }
  60% { transform: translateX(-6%) scale(1.02); opacity: 1; }
  100% { transform: translateX(0) scale(1); }
}
.toast-enter-success { animation: toast-in-success 0.55s var(--ease-spring); }

@keyframes toast-in-error {
  0% { transform: translateX(120%); opacity: 0; }
  55% { transform: translateX(0); opacity: 1; }
  70% { transform: translateX(6px); }
  85% { transform: translateX(-4px); }
  100% { transform: translateX(0); }
}
.toast-enter-error { animation: toast-in-error 0.5s var(--ease-out); }

/* ---- Xoá 1 dòng/1 thẻ khỏi danh sách bằng JS (không cần reload) —
   thu nhỏ + mờ dần, khác hẳn cách các thẻ MỚI xuất hiện (.reveal). ---- */
@keyframes item-dismiss {
  to { opacity: 0; transform: scale(0.92) translateY(-6px); max-height: 0; margin: 0; padding-top: 0; padding-bottom: 0; }
}
.item-dismissing { animation: item-dismiss 0.32s var(--ease-out) forwards; overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .action-shake, .action-burst, .bell-ring, .btn.is-copied .copy-icon,
  .toast-enter-success, .toast-enter-error, .item-dismissing { animation: none !important; }
}

/* ============================================================
   ĐIỂM TÍN NHIỆM JOBLINK (Trust Ring) — chữ ký thị giác độc quyền,
   không phải component có sẵn của Tailwind/thư viện nào. Vòng tròn vẽ
   bằng conic-gradient thuần CSS, "quay tới" điểm số khi xuất hiện,
   3 lớp bậc thang (thường / vàng / huyền thoại-hào quang xoay).
   ========================================================== */
.trust-ring-wrap { display: inline-flex; flex-direction: column; align-items: center; position: relative; }
.trust-ring-wrap-lg { cursor: default; }

.trust-ring {
  position: relative; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: conic-gradient(var(--trust-color) calc(var(--trust-pct) * 1%), rgba(10,10,10,0.08) 0);
  animation: trust-ring-sweep 1.1s var(--ease-editorial) both;
}
.dark .trust-ring { background: conic-gradient(var(--trust-color) calc(var(--trust-pct) * 1%), rgba(255,255,255,0.12) 0); }
@keyframes trust-ring-sweep {
  from { background: conic-gradient(var(--trust-color) 0%, rgba(10,10,10,0.08) 0); }
}
.trust-ring::before {
  content: ''; position: absolute; inset: var(--trust-stroke); border-radius: 50%;
  background: var(--paper-0);
}
.dark .trust-ring::before { background: var(--ink-900); }
.trust-ring-inner { position: relative; z-index: 1; font-weight: 800; font-family: 'Sora', sans-serif; }

/* Bậc "Vàng/Huyền Thoại" (aura=true) có hào quang mờ xoay chậm phía sau
   vòng — chỉ 2 bậc cao nhất mới có, tạo cảm giác hiếm/đặc biệt. */
.trust-ring-aura { filter: drop-shadow(0 0 10px color-mix(in srgb, var(--trust-color) 55%, transparent)); }
.trust-ring-aura::after {
  content: ''; position: absolute; inset: -8px; border-radius: 50%; z-index: -1;
  background: conic-gradient(from 0deg, transparent, color-mix(in srgb, var(--trust-color) 45%, transparent), transparent 40%);
  animation: trust-aura-spin 4s linear infinite;
}
@keyframes trust-aura-spin { to { transform: rotate(360deg); } }

/* Tooltip breakdown — chỉ hiện ở size 'lg' (profile/ctv-site), bấm/hover
   để lật ra, không chiếm chỗ khi đóng. */
.trust-ring-tooltip {
  position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%) translateY(-6px);
  width: 17rem; max-width: 80vw; background: var(--paper-0); border: 1px solid var(--line);
  border-radius: 1rem; padding: 1rem; box-shadow: var(--shadow-lift); z-index: 40;
  opacity: 0; pointer-events: none; transition: opacity 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}
.dark .trust-ring-tooltip { background: var(--ink-900); border-color: rgba(255,255,255,0.1); }
.trust-ring-wrap-lg:hover .trust-ring-tooltip,
.trust-ring-wrap-lg.trust-tooltip-open .trust-ring-tooltip {
  opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0);
}
.trust-tooltip-row { margin-bottom: 0.65rem; }
.trust-tooltip-row:last-child { margin-bottom: 0; }
.trust-tooltip-bar { height: 4px; border-radius: 999px; background: rgba(10,10,10,0.08); overflow: hidden; }
.dark .trust-tooltip-bar { background: rgba(255,255,255,0.12); }
.trust-tooltip-bar-fill { height: 100%; background: var(--amber-500); border-radius: 999px; transition: width 0.6s var(--ease-out); }

@media (prefers-reduced-motion: reduce) {
  .trust-ring { animation: none !important; }
  .trust-ring-aura::after { animation: none !important; }
}

/* Trust Ring đặt trên nền tối (banner CTV) — viền trắng mờ quanh vòng
   để tách khỏi nền, chữ bậc có bóng nhẹ cho dễ đọc trên mọi màu nền. */
.trust-ring-on-dark .trust-ring { box-shadow: 0 0 0 3px rgba(255,255,255,0.15); }
.trust-ring-on-dark p { text-shadow: 0 1px 3px rgba(0,0,0,0.4); }
