/* ============================================================
   TET EDUCATION — Speakers & Agenda
   Theme: VNU-HCM (Đại học Quốc gia TP.HCM) — royal blue chủ đạo,
   nền trắng/xanh rất nhạt, điểm nhấn vàng kim học thuật.
   Be Vietnam Pro (display + body) — sans-serif tối ưu cho tiếng Việt.
   ============================================================ */

:root {
  /* nền & giấy → trắng / xanh rất nhạt */
  --paper:        #F5F8FC;
  --paper-2:      #E8F1FA;
  --card:         #FFFFFF;

  /* chữ */
  --ink:          #15233B;
  --ink-soft:     #41506A;
  --muted:        #6B788C;

  /* điểm nhấn vàng kim (giữ tên --gold để không phải sửa nơi dùng) */
  --gold:         #E8A317;
  --gold-deep:    #B97F0C;

  /* màu nhấn chính: teal → XANH VNU (giữ tên --teal để khỏi sửa chỗ dùng) */
  --teal:         #005BAA;   /* VNU blue */
  --teal-deep:    #003A73;   /* VNU navy */

  /* xanh tint cho chip / badge / vùng nhấn nhẹ */
  --vnu-blue-tint: #E8F1FA;

  --line:         #D6E1EE;
  --shadow:       rgba(0, 58, 115, 0.12);
  --shadow-strong:rgba(0, 58, 115, 0.26);
  --maxw:         1180px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: "Be Vietnam Pro", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(900px 500px at 12% -8%, rgba(0, 91, 170, 0.10), transparent 60%),
    radial-gradient(900px 500px at 95% 8%,  rgba(46, 128, 194, 0.10), transparent 55%),
    var(--paper);
  background-attachment: fixed;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* subtle grain overlay */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: 0.025;
  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'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(20px, 5vw, 56px); position: relative; z-index: 1; }

/* ---------------- HEADER ---------------- */
header.site {
  /* full-bleed: tràn ra toàn bộ chiều ngang trình duyệt, thoát khỏi .wrap */
  width: 100vw;
  position: relative; left: 50%; right: 50%;
  margin-left: -50vw; margin-right: -50vw;
  padding: clamp(40px, 7vw, 84px) 0 clamp(28px, 4vw, 48px);
  overflow: hidden;               /* giữ các vệt sáng chuyển động trong khung header */
  background:
    linear-gradient(105deg,
      rgba(245,248,252,0.97) 0%,
      rgba(245,248,252,0.90) 38%,
      rgba(245,248,252,0.55) 70%,
      rgba(245,248,252,0.35) 100%),
    url("images/background.webp") center 38% / cover no-repeat;
}
/* nội dung header gom về giữa, canh lề trùng với phần còn lại của trang */
.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 56px);
  position: relative; z-index: 1;
}
/* các vệt sáng xanh VNU trôi nhẹ phía sau tiêu đề */
header.site::before,
header.site::after {
  content: ""; position: absolute; z-index: 0; pointer-events: none;
  border-radius: 50%; filter: blur(70px);
}
header.site::before {
  width: 460px; height: 460px;
  top: -120px; right: -40px;
  background: radial-gradient(circle, rgba(0,91,170,0.30), transparent 70%);
  animation: drift1 18s ease-in-out infinite;
}
header.site::after {
  width: 400px; height: 400px;
  top: 90px; right: 40px;
  background: radial-gradient(circle, rgba(232,163,23,0.20), transparent 70%);
  animation: drift2 22s ease-in-out infinite;
}
@keyframes drift1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(-70px, 40px) scale(1.14); }
}
@keyframes drift2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(-60px, -30px) scale(0.88); }
}
/* nội dung header nằm trên các vệt sáng + xuất hiện có hiệu ứng */
header.site > * { position: relative; z-index: 1; }
.brand-row, header.site h1, .header-meta {
  opacity: 0; animation: rise 0.8s cubic-bezier(.2,.7,.2,1) both;
}
.brand-row       { animation-delay: 0.05s; }
header.site h1   { animation-delay: 0.2s; }
.header-meta     { animation-delay: 0.34s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

/* hàng 2 logo: VNU-HCM + TET Education, cùng nằm bên trái */
.brand-row {
  display: flex; align-items: center; justify-content: flex-start;
  gap: clamp(24px, 4vw, 48px); margin-bottom: 30px;
}

/* logo + placeholder tạm thời (thay file thật vào images/…) */
.brand-logo { display: block; }
.brand-logo img { height: 56px; width: auto; display: block; }
.brand-logo.is-empty {
  width: max-content;
  padding: 14px 22px; border: 1.5px dashed var(--line); border-radius: 10px;
  font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase;
  font-weight: 700; color: var(--muted); background: var(--card);
}
.brand-logo.is-empty::after { content: attr(data-ph); }
header.site h1 {
  font-family: "Be Vietnam Pro", system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(2.2rem, 5.2vw, 4rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--ink);
  max-width: 22ch;
  text-wrap: balance;          /* phân bổ đều các dòng, tránh chữ mồ côi */
}
header.site h1 em {
  font-style: italic;
  font-weight: 700;
  color: var(--teal);
}
.header-meta {
  margin-top: 26px;
  display: grid; gap: 10px;
}
.header-meta p {
  display: flex; align-items: center; gap: 8px;
  font-size: clamp(1rem, 1.6vw, 1.15rem); font-weight: 600;
  color: var(--ink-soft);
}
.header-meta p i {
  width: 18px; height: 18px; flex-shrink: 0;
  color: var(--gold);
}

/* ---------------- TABS ---------------- */
.tabs {
  position: sticky; top: 0; z-index: 20;
  display: flex; gap: 6px;
  padding: 14px 0;
  margin-top: 8px;
  background: linear-gradient(var(--paper) 70%, rgba(245,248,252,0));
  backdrop-filter: blur(2px);
}
.tab-btn {
  appearance: none; border: 1px solid transparent; cursor: pointer;
  font-family: inherit; font-size: 0.95rem; font-weight: 600;
  color: var(--muted); background: transparent;
  padding: 11px 22px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 9px;
  transition: all 0.28s cubic-bezier(.2,.7,.2,1);
}
.tab-btn .num {
  font-family: "Be Vietnam Pro", system-ui, sans-serif; font-size: 0.78rem;
  opacity: 0.6;
}
.tab-btn:hover { color: var(--teal); background: var(--vnu-blue-tint); }
.tab-btn.active {
  color: #fff; background: var(--teal);
  border-color: var(--teal);
  box-shadow: 0 8px 22px var(--shadow);
}
.tab-btn.active .num { color: var(--gold); opacity: 1; }

/* ---------------- PANELS ---------------- */
.panel { display: none; padding: 36px 0 100px; }
.panel.active { display: block; animation: fadeUp 0.5s cubic-bezier(.2,.7,.2,1); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.section-head { margin-bottom: 34px; }
.section-head h2 {
  font-family: "Be Vietnam Pro", system-ui, sans-serif; font-weight: 700;
  font-size: clamp(1.7rem, 3.5vw, 2.5rem); letter-spacing: -0.01em;
}
.section-head p { color: var(--muted); margin-top: 6px; max-width: 60ch; }

/* ---------------- SPEAKER GRID ---------------- */
.speaker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr));
  gap: clamp(16px, 2vw, 26px);
}
.speaker-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(16px, 1.6vw, 22px);
  align-items: center;
  padding: clamp(16px, 1.6vw, 20px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 6px 20px var(--shadow);
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(.2,.7,.2,1), box-shadow 0.35s, border-color 0.35s;
  opacity: 0; transform: translateY(22px);
}
.speaker-card.in { opacity: 1; transform: none; }
.speaker-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 22px 44px var(--shadow-strong);
  border-color: var(--teal);
}

/* ảnh diễn giả — tỉ lệ vuông 1:1 */
.sc-photo {
  position: relative;
  width: clamp(96px, 11vw, 128px);
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  overflow: hidden;
  background: var(--paper-2);
  flex-shrink: 0;
}
.sc-photo img {
  width: 100%; height: 100%; object-fit: cover; object-position: top center;
  transition: transform 0.6s cubic-bezier(.2,.7,.2,1);
}
.speaker-card:hover .sc-photo img { transform: scale(1.05); }

/* monogram fallback when no image */
.sc-mono {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, var(--teal) 0%, var(--teal-deep) 100%);
  color: rgba(255,255,255,0.95);
  font-family: "Be Vietnam Pro", system-ui, sans-serif; font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: 0.02em;
}
.sc-mono::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 70% 0%, rgba(232,163,23,0.30), transparent 60%);
}

.sc-body { min-width: 0; }
.sc-name {
  font-family: "Be Vietnam Pro", system-ui, sans-serif;
  font-weight: 700; font-size: clamp(1.1rem, 1.7vw, 1.32rem);
  line-height: 1.2; letter-spacing: -0.01em;
  color: var(--teal);
}
.sc-name-en {
  display: block; margin-top: 4px;
  font-weight: 500; font-style: italic; letter-spacing: 0;
  font-size: 0.9rem; color: var(--ink-soft);
}
.sc-roles { list-style: none; margin-top: 10px; display: grid; gap: 6px; }
.sc-roles li {
  position: relative; padding-left: 16px;
  font-size: 0.9rem; font-style: italic; color: var(--ink-soft); line-height: 1.4;
}
.sc-roles li::before {
  content: ""; position: absolute; left: 0; top: 8px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--teal); opacity: 0.65;
}

/* ---------------- MODAL ---------------- */
.modal-back {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(20,24,33,0.62);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; opacity: 0; pointer-events: none;
  transition: opacity 0.32s ease;
}
.modal-back.open { opacity: 1; pointer-events: auto; }
.modal {
  position: relative;
  background: var(--card);
  border-radius: 20px; overflow: hidden;
  max-width: 720px; width: 100%; max-height: 88vh;
  display: flex; flex-direction: column;
  box-shadow: 0 40px 90px rgba(0,0,0,0.4);
  transform: translateY(20px) scale(0.98); transition: transform 0.4s cubic-bezier(.2,.7,.2,1);
}
.modal-back.open .modal { transform: none; }

.modal-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: clamp(26px, 3.4vw, 44px); }

/* phần đầu: ảnh vuông + thông tin */
.modal-head {
  display: grid; grid-template-columns: auto 1fr; gap: clamp(18px, 2.4vw, 28px);
  align-items: start;
}
.modal-photo {
  position: relative;
  width: clamp(120px, 16vw, 168px);
  aspect-ratio: 1 / 1;
  border-radius: 16px; overflow: hidden;
  background: var(--paper-2); flex-shrink: 0;
}
.modal-photo img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.modal-photo .sc-mono { font-size: clamp(2.4rem, 6vw, 3.4rem); }

.modal-head-info { min-width: 0; padding-right: 40px; }   /* chừa chỗ cho nút đóng */
.modal-head-info .name {
  font-family: "Be Vietnam Pro", system-ui, sans-serif; font-weight: 700;
  font-size: clamp(1.4rem, 3vw, 1.9rem); line-height: 1.14; letter-spacing: -0.01em;
  color: var(--teal);
}
.modal-head-info .name .name-en {
  display: block; margin-top: 5px;
  font-weight: 500; font-style: italic; letter-spacing: 0;
  font-size: clamp(0.95rem, 1.6vw, 1.1rem); color: var(--ink-soft);
}
.modal-head-info .role {
  margin-top: 10px; font-style: italic;
  color: var(--ink-soft); font-size: clamp(0.95rem, 1.4vw, 1.05rem); line-height: 1.5;
}

.modal-social { display: flex; gap: 10px; margin-top: 16px; }
.ln {
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--vnu-blue-tint); color: var(--teal);
  border: 1px solid var(--line); text-decoration: none;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.ln:hover { background: var(--teal); color: #fff; transform: translateY(-2px); }
.ln svg { width: 18px; height: 18px; }

.modal .divider { height: 1px; background: var(--line); margin: 24px 0; }
.modal .bio { color: var(--ink-soft); font-size: 1rem; line-height: 1.7; }
.modal .bio .bio-vi { display: block; }
.modal .bio .bio-en {
  display: block; margin-top: 16px; padding-top: 16px;
  border-top: 1px solid var(--line); font-style: italic;
}

.modal-close {
  position: absolute; top: 16px; right: 16px; z-index: 5;
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); cursor: pointer;
  background: var(--card); color: var(--ink-soft);
  font-size: 1.2rem; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px var(--shadow);
  transition: transform 0.2s, background 0.2s, color 0.2s;
}
.modal-close:hover { transform: rotate(90deg); background: var(--vnu-blue-tint); color: var(--teal); }

/* ---------------- AGENDA TABLE ---------------- */
.agenda-table {
  width: 100%;
  border-collapse: separate; border-spacing: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px; overflow: hidden;
  box-shadow: 0 6px 20px var(--shadow);
}
.agenda-table thead th {
  text-align: left;
  font-family: "Be Vietnam Pro", system-ui, sans-serif;
  font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 700;
  color: #fff;
  background: linear-gradient(120deg, var(--teal-deep), var(--teal));
  padding: 16px 22px;
}
.agenda-table tbody td {
  padding: 20px 22px; vertical-align: top;
  border-top: 1px solid var(--line);
}
.agenda-table tbody tr:first-child td { border-top: none; }

.ag-row { opacity: 0; transform: translateY(16px); }
.ag-row.in { opacity: 1; transform: none; transition: opacity 0.5s, transform 0.5s, background 0.25s; }
.ag-row:hover { background: var(--vnu-blue-tint); }

.col-time { width: 200px; white-space: nowrap; }
.col-session { width: 38%; }

.ag-time {
  display: block; font-family: "Be Vietnam Pro", system-ui, sans-serif;
  font-weight: 700; font-size: 1.05rem; color: var(--ink);
}
.ag-tz { font-weight: 600; font-size: 0.66em; color: var(--muted); }
.ag-mel { display: block; margin-top: 4px; font-size: 0.78rem; color: var(--muted); white-space: nowrap; }

.ag-tag {
  display: inline-block; margin-bottom: 9px;
  font-size: 0.64rem; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700;
  color: var(--teal); background: var(--vnu-blue-tint);
  padding: 4px 11px; border-radius: 999px;
}
.ag-title { display: block; font-weight: 700; font-size: 1rem; color: var(--ink-soft); line-height: 1.4; }

.ag-speakers { list-style: none; display: grid; gap: 13px; }
.ag-sp-name { display: block; font-weight: 700; font-size: 0.95rem; color: var(--ink); line-height: 1.35; }
.ag-sp-role { display: block; margin-top: 2px; font-size: 0.82rem; color: var(--muted); line-height: 1.4; }

/* mobile: bảng xếp chồng thành thẻ */
@media (max-width: 760px) {
  .agenda-table, .agenda-table tbody, .agenda-table tr, .agenda-table td { display: block; width: 100%; }
  .agenda-table thead { display: none; }
  .agenda-table tbody tr { border-top: 6px solid var(--paper); }
  .agenda-table tbody tr:first-child { border-top: none; }
  .agenda-table tbody td { border-top: none; padding: 4px 18px; }
  .agenda-table tbody td.col-time { padding-top: 18px; }
  .agenda-table tbody td.col-speakers { padding-bottom: 18px; }
  .col-time, .col-session { width: auto; white-space: normal; }
}

/* ---------------- FOOTER ---------------- */
footer.site {
  border-top: 1px solid var(--line);
  padding: 34px 0 60px; color: var(--muted); font-size: 0.85rem;
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center;
}
footer.site .brand { font-family: "Be Vietnam Pro", system-ui, sans-serif; font-weight: 600; color: var(--ink); font-size: 1rem; }

/* ---------------- RESPONSIVE ---------------- */
@media (max-width: 720px) {
  .modal { max-height: 90vh; }
}
@media (max-width: 540px) {
  .modal-head { grid-template-columns: 1fr; }
  .modal-head-info { padding-right: 0; }
}

/* ---------------- REDUCED MOTION ---------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .brand-row, header.site h1, header.site .lead, .meta-strip { opacity: 1; }
}
