/* =========================================================
   SHINHAN Việt Nam Campus: giao diện trẻ trung, hiệu ứng 3D, 2 chế độ sáng/tối
   Mọi màu dùng biến (token) để đổi giao diện chỉ bằng thuộc tính data-theme trên <html>.
   ========================================================= */
:root {
  --bg: #f4f1ff; --bg-2: #fdf2f8;
  --card: #ffffff; --card-2: #faf8ff; --input: #ffffff;
  --text: #1b1630; --muted: #6b6880; --line: #e7e1f6;
  --primary: #7c3aed; --primary-2: #ec4899; --primary-3: #f97316; --primary-soft: #f1e8ff; --primary-ink: #5b21b6;
  --accent: #06b6d4; --accent-soft: #e0fbff; --accent-ink: #0e7490;
  --gold: #f59e0b; --gold-soft: #fff8e6; --gold-ink: #92400e; --gold-line: #fde68a;
  --good: #10b981; --good-soft: #d1fae5; --good-ink: #065f46;
  --ok: #f59e0b; --ok-soft: #fef3c7; --ok-ink: #92400e;
  --bad: #ef4444; --bad-soft: #fee2e2; --bad-ink: #991b1b;
  --track: #efeaf9; --star-off: #e5e1f0; --act: #f3effb; --topbar: rgba(255,255,255,.78);
  --sky: #0ea5e9; --sky-light: #7dd3fc; --vn-red: #da251d; --vn-yellow: #ffde00;
  /* Đổ bóng nhiều lớp tạo chiều sâu 3D */
  --shadow-1: 0 1px 0 rgba(255,255,255,.9) inset, 0 1px 2px rgba(60,30,120,.06), 0 4px 12px rgba(91,33,182,.07);
  --shadow-2: 0 1px 0 rgba(255,255,255,.9) inset, 0 6px 14px rgba(91,33,182,.10), 0 18px 40px rgba(91,33,182,.12);
  --edge: rgba(91,33,182,.10); /* viền dưới đậm hơn = cạnh khối 3D */
  --r: 20px; --nav-h: 66px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0d0a1a; --bg-2: #1a0f2b;
  --card: #1a1530; --card-2: #211a3d; --input: #15112a;
  --text: #f3efff; --muted: #a8a2c6; --line: #2f2752;
  --primary: #a78bfa; --primary-2: #f472b6; --primary-3: #fb923c; --primary-soft: #2a2050; --primary-ink: #ddd0ff;
  --accent: #22d3ee; --accent-soft: #0f3340; --accent-ink: #a5f3fc;
  --gold: #fbbf24; --gold-soft: #2e2410; --gold-ink: #fde68a; --gold-line: #6b5212;
  --good: #34d399; --good-soft: #0f3328; --good-ink: #a7f3d0;
  --ok: #fbbf24; --ok-soft: #33290d; --ok-ink: #fde68a;
  --bad: #f87171; --bad-soft: #3a1518; --bad-ink: #fecaca;
  --track: #2a2347; --star-off: #3a3360; --act: #262044; --topbar: rgba(16,12,32,.78);
  --sky: #38bdf8; --vn-red: #ff4d45;
  --shadow-1: 0 1px 0 rgba(255,255,255,.05) inset, 0 2px 4px rgba(0,0,0,.35), 0 6px 16px rgba(0,0,0,.30);
  --shadow-2: 0 1px 0 rgba(255,255,255,.06) inset, 0 8px 18px rgba(0,0,0,.45), 0 22px 44px rgba(124,58,237,.18);
  --edge: rgba(0,0,0,.55);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--text); line-height: 1.5;
  background:
    radial-gradient(900px 500px at 110% -10%, color-mix(in srgb, var(--primary-2) 16%, transparent), transparent 60%),
    radial-gradient(800px 500px at -10% 10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  background-attachment: fixed; background-color: var(--bg);
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px);
  transition: background-color .3s, color .3s;
}
.ko { font-family: "Noto Sans KR", "Be Vietnam Pro", sans-serif; }
a { color: var(--primary); text-decoration: none; }
h1 { font-size: 25px; margin: 18px 0 4px; font-weight: 800; letter-spacing: -.4px; }
h2 { font-size: 18px; margin: 0; font-weight: 800; letter-spacing: -.2px; }
.sub { color: var(--muted); margin: 0 0 14px; }
.small { font-size: 13px; color: var(--muted); }
.hint { font-size: 12px; color: var(--muted); font-weight: 400; }
.center { text-align: center; }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }
.danger-text { color: var(--bad); }
.wrap { max-width: 780px; margin: 0 auto; padding: 0 16px 24px; }
.stack { display: grid; gap: 14px; }

/* Khối thẻ 3D dùng chung */
.card, .t-card, .review, .news-item, .exam, .tile {
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--line); border-bottom: 3px solid var(--edge);
  border-radius: var(--r); box-shadow: var(--shadow-1); color: var(--text);
}
.card { padding: 16px; }
.demo-banner:empty { display: none; }
.demo-banner { background: var(--ok-soft); color: var(--ok-ink); padding: 7px 16px; font-size: 13px; text-align: center; border-bottom: 1px solid var(--gold-line); }

/* Hiệu ứng nổi + nghiêng 3D khi rê chuột (máy tính) */
.t-card, .news-item, .tile, .exam { transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s; transform-style: preserve-3d; will-change: transform; }
@media (hover: hover) {
  .t-card:hover, .news-item:hover, .tile:hover { transform: perspective(900px) rotateX(3deg) translateY(-4px); box-shadow: var(--shadow-2); }
}
.t-card:active, .news-item:active, .tile:active { transform: perspective(900px) translateY(1px) scale(.985); }

/* ---------- Thanh trên ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--topbar); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); border-bottom: 1px solid var(--line); padding: 10px 16px; }
.topbar-in { max-width: 780px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--text); font-size: 17px; min-width: 0; }
.nm-sh { color: var(--sky); }
.hero .nm-sh { color: var(--sky-light); text-shadow: 0 2px 0 rgba(0,0,0,.18); }
.nm-vn { color: var(--vn-red); white-space: nowrap; }
.hero .nm-vn { color: var(--vn-yellow); text-shadow: 0 2px 0 rgba(0,0,0,.18); }
.logo.flag { width: 36px; height: 24px; border-radius: 5px; box-shadow: 0 2px 0 rgba(0,0,0,.15), 0 4px 10px rgba(218,37,29,.35); flex-shrink: 0; transform: perspective(200px) rotateY(-12deg); }
/* Ánh sáng chạy qua chữ SHINHAN Việt Nam (thanh trên và banner) */
.nm-sh { --c: var(--sky); } .nm-vn { --c: var(--vn-red); }
.hero .nm-sh { --c: var(--sky-light); } .hero .nm-vn { --c: var(--vn-yellow); }
.brand .nm-sh, .brand .nm-vn, .hero .nm-sh, .hero .nm-vn {
  background: linear-gradient(110deg, var(--c) 0 42%, rgba(255,255,255,.95) 50%, var(--c) 58% 100%);
  background-size: 300% 100%; background-position: 100% 0;
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
  animation: shine-text 4.5s ease-in-out infinite;
}
.hero .nm-sh, .hero .nm-vn { text-shadow: none; filter: drop-shadow(0 2px 0 rgba(0,0,0,.18)); }
.brand .nm-vn, .hero .nm-vn { animation-delay: .35s; } /* ánh sáng đi tiếp từ SHINHAN sang Việt Nam */
@keyframes shine-text { 0%, 55% { background-position: 100% 0; } 85%, 100% { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .brand .nm-sh, .brand .nm-vn, .hero .nm-sh, .hero .nm-vn { animation: none; } }

/* Đổi sáng/tối: vòng giao diện mới lan ra từ nút + luồng sáng hoặc bóng tối */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
.theme-fx { position: fixed; inset: 0; z-index: 9999; pointer-events: none; opacity: 0; animation: theme-fx 1s ease-out forwards; }
.theme-fx.to-light { background: radial-gradient(circle at var(--x) var(--y), rgba(255,244,200,.95), rgba(255,236,170,.45) 18%, rgba(255,255,255,0) 55%); }
.theme-fx.to-dark { background: radial-gradient(circle at var(--x) var(--y), rgba(8,4,24,.9), rgba(20,10,50,.5) 22%, rgba(0,0,0,0) 60%); }
@keyframes theme-fx { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }

.brand em { font-style: normal; background: linear-gradient(90deg, var(--primary), var(--primary-2), var(--primary-3)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Nút đổi sáng/tối (góc phải) */
.theme-btn {
  flex-shrink: 0; position: relative; width: 64px; height: 34px; border-radius: 99px; border: 1px solid var(--line); cursor: pointer; padding: 0;
  background: linear-gradient(180deg, #bfe9ff, #ffe6f3); box-shadow: inset 0 2px 4px rgba(0,0,0,.12), 0 2px 0 var(--edge);
  transition: background .35s;
}
:root[data-theme="dark"] .theme-btn { background: linear-gradient(180deg, #1e1b4b, #3b0764); }
.theme-btn .knob {
  position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 15px;
  background: radial-gradient(circle at 35% 30%, #fff, #ffe08a 60%, #f59e0b); box-shadow: 0 3px 6px rgba(0,0,0,.25), inset 0 -2px 3px rgba(0,0,0,.12);
  transition: transform .35s cubic-bezier(.5,1.6,.4,1), background .35s;
}
:root[data-theme="dark"] .theme-btn .knob { transform: translateX(30px); background: radial-gradient(circle at 35% 30%, #fff, #c7d2fe 60%, #818cf8); }
.theme-btn:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
/* Điện thoại nhỏ: thu gọn tên và nút để không chồng lên nhau */
@media (max-width: 420px) {
  .brand { font-size: 14.5px; gap: 6px; white-space: nowrap; }
  .logo.flag { width: 30px; height: 20px; }
  .theme-btn { width: 54px; height: 30px; }
  .theme-btn .knob { width: 22px; height: 22px; font-size: 13px; }
  :root[data-theme="dark"] .theme-btn .knob { transform: translateX(24px); }
}
@media (max-width: 340px) { .brand em { display: none; } }

/* ---------- Thanh dưới ---------- */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--topbar); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); border-top: 1px solid var(--line); display: flex; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); height: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
.bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--muted); font-weight: 700; border-radius: 14px; max-width: 110px; transition: .2s; }
.bottom-nav a span { font-size: 22px; line-height: 1; filter: grayscale(1); opacity: .65; transition: .25s cubic-bezier(.5,1.6,.4,1); }
.bottom-nav a.active { color: var(--primary); background: var(--primary-soft); }
.bottom-nav a.active span { filter: drop-shadow(0 3px 2px rgba(0,0,0,.2)); opacity: 1; transform: translateY(-3px) scale(1.15); }

/* ---------- Trang chủ ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate; margin-top: 16px; border-radius: 28px; padding: 26px 22px 24px; color: #fff;
  background: linear-gradient(135deg, #7c3aed 0%, #db2777 55%, #f97316 100%);
  box-shadow: 0 2px 0 rgba(255,255,255,.25) inset, 0 -6px 0 rgba(0,0,0,.12) inset, 0 18px 40px rgba(124,58,237,.35);
  transform: perspective(1000px) rotateX(2deg);
}
/* Khối cầu 3D trôi nổi trong banner */
.hero::before, .hero::after {
  content: ""; position: absolute; z-index: -1; border-radius: 50%;
  background: radial-gradient(circle at 30% 28%, rgba(255,255,255,.95), rgba(255,255,255,.25) 35%, rgba(255,255,255,0) 70%);
  box-shadow: inset -10px -14px 24px rgba(0,0,0,.18);
  animation: float 7s ease-in-out infinite;
}
.hero::before { width: 150px; height: 150px; right: -30px; top: -40px; background-color: rgba(34,211,238,.55); }
.hero::after { width: 90px; height: 90px; right: 90px; bottom: -36px; background-color: rgba(250,204,21,.6); animation-delay: -3s; }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-12px) rotate(8deg); } }
.hero h1 { margin: 2px 0 6px; font-size: 30px; text-shadow: 0 3px 0 rgba(0,0,0,.12); }
.hero p { margin: 0 0 16px; opacity: .95; max-width: 30em; }
.hero-kicker { font-weight: 700; opacity: .95; }
.hero-cta { display: inline-block; background: #fff; color: #7c3aed; padding: 11px 18px; border-radius: 99px; font-weight: 800; box-shadow: 0 4px 0 rgba(0,0,0,.18), 0 10px 20px rgba(0,0,0,.15); transition: .15s; }
.hero-cta:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.18); }
.hero-note { background: rgba(255,255,255,.2); padding: 9px 12px; border-radius: 14px; font-size: 14px; backdrop-filter: blur(4px); }
.countdown-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; color: var(--text); border-left: 6px solid var(--accent); }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 0 12px; }
.sec-head a { font-size: 14px; font-weight: 700; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.page-head h1 { margin-bottom: 10px; }
.back { display: inline-block; margin-top: 14px; font-weight: 700; font-size: 14px; }

/* ---------- Thẻ giảng viên ---------- */
.t-card { display: flex; gap: 12px; justify-content: space-between; padding: 14px 16px; flex: 1; min-width: 0; }
.t-main { min-width: 0; }
.t-name { font-weight: 800; font-size: 17px; }
.t-name.big { font-size: 28px; }
.t-meta { color: var(--muted); font-size: 14px; }
.t-email { font-size: 13px; color: var(--muted); word-break: break-all; }
.t-email.link { display: inline-block; margin-top: 4px; color: var(--primary); font-weight: 600; }
.t-subjects { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.subj { background: var(--accent-soft); color: var(--accent-ink); font-size: 12px; padding: 2px 9px; border-radius: 99px; font-weight: 600; }
.t-score { text-align: right; flex-shrink: 0; }
.score { font-size: 28px; font-weight: 800; line-height: 1.1; text-shadow: 0 2px 0 var(--edge); }
.score.big { font-size: 48px; }
.score.good, .r-score.good { color: var(--good); } .score.ok, .r-score.ok { color: var(--ok); } .score.bad, .r-score.bad { color: var(--bad); }
.trusted-mini { display: inline-block; margin-top: 8px; font-size: 12px; background: var(--gold-soft); color: var(--gold-ink); border: 1px solid var(--gold-line); padding: 1px 8px; border-radius: 99px; }
.stars { color: var(--star-off); letter-spacing: 1px; } .stars .on { color: var(--gold); }
.rank-row { display: flex; align-items: center; gap: 8px; font-size: 26px; }
.rank-num { width: 34px; text-align: center; font-size: 16px; font-weight: 800; color: var(--muted); }

/* ---------- Ô nhập, tìm kiếm, bộ lọc ---------- */
.search, select, input[type=text], input[type=url], input[type=password], input[type=email], input[type=datetime-local], input[type=search], textarea {
  width: 100%; padding: 11px 13px; font-size: 16px; border: 1.5px solid var(--line); border-radius: 14px; font-family: inherit;
  background: var(--input); color: var(--text); box-shadow: inset 0 2px 3px rgba(0,0,0,.05); transition: border-color .15s, box-shadow .15s; }
.search:focus, select:focus, input:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.search { margin-bottom: 10px; }
.filter-row { display: flex; gap: 8px; margin-bottom: 12px; }
select.full { margin-bottom: 14px; }
input[type=file] { font-family: inherit; color: var(--muted); }

/* ---------- Trang giảng viên ---------- */
.t-hero { margin: 8px 0 12px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 6px; margin-bottom: 12px; scrollbar-width: none; }
.tab { white-space: nowrap; border: 1.5px solid var(--line); background: var(--card); padding: 7px 14px; border-radius: 99px; font-family: inherit; font-size: 14px; cursor: pointer; color: var(--text); font-weight: 700; box-shadow: 0 2px 0 var(--edge); transition: .15s; }
.tab:active { transform: translateY(2px); box-shadow: none; }
/* Dấu sao nhỏ ở góc trên phải của tab (VD: tab Slide trong Quản trị) */
#atabs { padding-top: 9px; }
.tab:has(.tab-star) { position: relative; overflow: visible; }
.tab-star { position: absolute; top: -8px; right: -4px; font-size: 13px; line-height: 1; filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); pointer-events: none; }
.tab[aria-pressed=true] { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; border-color: transparent; box-shadow: 0 3px 0 color-mix(in srgb, var(--primary) 55%, #000), 0 6px 14px color-mix(in srgb, var(--primary) 35%, transparent); }
.score-panel { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; margin-bottom: 14px; }
.score-box { text-align: center; min-width: 96px; }
.bars { min-width: 0; }
.bar { display: grid; grid-template-columns: minmax(0, 1fr) 70px 30px; gap: 8px; align-items: center; margin: 5px 0; font-size: 13px; }
.bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track { height: 9px; background: var(--track); border-radius: 99px; overflow: hidden; box-shadow: inset 0 1px 2px rgba(0,0,0,.12); }
.fill { height: 100%; border-radius: 99px; background: var(--primary); box-shadow: inset 0 -2px 0 rgba(0,0,0,.15); }
.fill.good { background: var(--good); } .fill.ok { background: var(--ok); } .fill.bad { background: var(--bad); }
.top-tags { grid-column: 1 / -1; margin-top: 0; }
@media (max-width: 480px) { .score-panel { grid-template-columns: 1fr; } }

/* ---------- Đánh giá / bình luận ---------- */
.review { padding: 14px 16px; margin-bottom: 12px; }
.review header { display: flex; align-items: center; gap: 10px; }
.who { flex: 1; min-width: 0; } .who small { display: block; color: var(--muted); font-size: 12px; }
.r-score { font-weight: 800; font-size: 22px; }
.review-admin { border: 2px solid var(--gold); border-bottom-width: 4px; background: linear-gradient(180deg, var(--gold-soft), var(--card)); }
.trusted { font-weight: 800; color: var(--gold-ink); font-size: 13px; margin-bottom: 8px; }
.badge-me { background: var(--primary-soft); color: var(--primary); font-size: 11px; padding: 1px 7px; border-radius: 99px; font-weight: 700; }
.crit-list { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 5px; }
.crit-list li { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; flex-wrap: wrap; }
.c-name { color: var(--muted); }
.pill { padding: 1px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.pill.good { background: var(--good-soft); color: var(--good-ink); } .pill.ok { background: var(--ok-soft); color: var(--ok-ink); } .pill.bad { background: var(--bad-soft); color: var(--bad-ink); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag { background: var(--primary-soft); color: var(--primary-ink); padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.comment { margin: 10px 0 0; white-space: pre-wrap; }
.review footer { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.act { background: var(--act); border: none; padding: 6px 11px; border-radius: 99px; font-size: 13px; cursor: pointer; color: var(--text); font-family: inherit; display: inline-block; font-weight: 600; box-shadow: 0 2px 0 var(--edge); transition: .12s; }
.act:active { transform: translateY(2px); box-shadow: none; }
.act:disabled { opacity: .55; cursor: default; }
.act.danger { color: var(--bad); }
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; flex-shrink: 0; object-fit: cover; box-shadow: 0 3px 0 var(--edge), inset 0 -3px 0 rgba(0,0,0,.08); }
.avatar-letter { background: var(--primary-soft); color: var(--primary); font-weight: 700; }

/* ---------- Form ---------- */
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 5px; font-weight: 700; font-size: 14px; }
.form label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.step { display: grid; gap: 8px; }
.step-title { font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.num { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; box-shadow: 0 3px 0 color-mix(in srgb, var(--primary) 55%, #000); }
.nick-row { display: flex; gap: 8px; }
.avatar-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.avatar-pick button { border: 3px solid transparent; background: none; padding: 1px; border-radius: 50%; cursor: pointer; transition: transform .2s; }
.avatar-pick button[aria-pressed=true] { border-color: var(--primary); transform: translateY(-3px) scale(1.06); }
.crit { border: 1.5px solid var(--line); border-radius: 16px; padding: 12px; transition: .15s; background: var(--card); }
.crit.done { border-color: color-mix(in srgb, var(--primary) 45%, var(--line)); background: var(--primary-soft); }
.crit-name { font-weight: 800; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; margin-bottom: 12px; padding: 2px 2px 6px; }
.chip { border: 1.5px solid var(--line); background: var(--card); padding: 8px 13px; border-radius: 99px; cursor: pointer; font-size: 14px; font-family: inherit; color: var(--text); white-space: nowrap; transition: .12s; box-shadow: 0 3px 0 var(--edge); font-weight: 600; }
.chip:active { transform: translateY(3px); box-shadow: none; }
.chip[aria-pressed=true] { background: var(--primary); color: #fff; border-color: transparent; box-shadow: 0 3px 0 color-mix(in srgb, var(--primary) 55%, #000); }
.chip.s5[aria-pressed=true], .chip.s4[aria-pressed=true], .chip.t-good[aria-pressed=true] { background: var(--good); box-shadow: 0 3px 0 color-mix(in srgb, var(--good) 55%, #000); }
.chip.s3[aria-pressed=true] { background: var(--ok); box-shadow: 0 3px 0 color-mix(in srgb, var(--ok) 55%, #000); }
.chip.s2[aria-pressed=true], .chip.s1[aria-pressed=true], .chip.t-bad[aria-pressed=true] { background: var(--bad); box-shadow: 0 3px 0 color-mix(in srgb, var(--bad) 55%, #000); }
@media (max-width: 480px) { .chip { white-space: normal; text-align: left; } }
.tag-label { font-size: 13px; color: var(--muted); }
details summary { cursor: pointer; color: var(--primary); font-weight: 700; }
details textarea { margin-top: 8px; min-height: 90px; }
.submit-bar { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); margin: 0 -16px -16px; padding: 12px 16px; display: flex; align-items: center; gap: 10px; border-radius: 0 0 var(--r) var(--r); }
.progress { flex: 1; font-size: 13px; color: var(--muted); }

/* ---------- Nút 3D (bấm lún xuống) ---------- */
.btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; border: none; padding: 11px 18px; border-radius: 14px; font-size: 15px; cursor: pointer; font-family: inherit; font-weight: 800; display: inline-block; text-align: center;
  box-shadow: 0 4px 0 color-mix(in srgb, var(--primary) 55%, #000), 0 10px 20px color-mix(in srgb, var(--primary) 30%, transparent); transition: transform .1s, box-shadow .1s, filter .15s;
}
@media (hover: hover) { .btn:hover { filter: brightness(1.06) saturate(1.1); } }
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 color-mix(in srgb, var(--primary) 55%, #000), 0 3px 8px color-mix(in srgb, var(--primary) 25%, transparent); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.block { display: block; width: 100%; margin: 4px 0 10px; }
.btn.secondary, .btn.google { background: var(--card); color: var(--text); border: 1.5px solid var(--line); box-shadow: 0 4px 0 var(--edge); }
.btn.danger { background: var(--bad); box-shadow: 0 4px 0 color-mix(in srgb, var(--bad) 55%, #000); }
.btn.google b { color: #4285f4; margin-right: 6px; }
.small-btn { padding: 7px 12px; font-size: 13px; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.notice { background: var(--primary-soft); color: var(--primary-ink); padding: 12px 14px; border-radius: 14px; font-size: 14px; margin: 6px 0; }
.notice.warn { background: var(--ok-soft); color: var(--ok-ink); }

/* ---------- Tin tức (có ảnh minh hoạ) ---------- */
.news-item { display: flex; gap: 12px; align-items: stretch; padding: 12px; }
.news-thumb { flex-shrink: 0; width: 128px; height: 80px; border-radius: 12px; object-fit: cover; background: var(--track); box-shadow: 0 3px 0 var(--edge), 0 6px 14px rgba(0,0,0,.12); }
.news-text { min-width: 0; flex: 1; padding: 2px 4px; }
.news-top { display: flex; gap: 6px; align-items: center; margin-bottom: 4px; flex-wrap: wrap; }
.chip-mini { font-size: 11px; font-weight: 800; background: var(--accent-soft); color: var(--accent-ink); padding: 2px 8px; border-radius: 99px; }
.chip-mini.pin { background: var(--bad-soft); color: var(--bad-ink); }
.article h1 { font-size: 22px; margin-top: 6px; }
.article .body { margin: 14px 0 18px; line-height: 1.75; }
/* Ảnh bài viết: hiện trọn vẹn đúng tỉ lệ gốc, nền là bản mờ của ảnh */
.article-media { position: relative; overflow: hidden; display: flex; justify-content: center; margin: -16px -16px 14px; border-radius: var(--r) var(--r) 0 0; background: #0b0816; }
.article-blur { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(22px) brightness(.75) saturate(1.2); transform: scale(1.2); }
.article-img { position: relative; display: block; width: 100%; height: auto; max-height: 75vh; object-fit: contain; }

/* Hộp cắt ảnh */
.ask-box.crop-box { width: min(620px, 100%); display: grid; gap: 10px; }
.crop-box p { margin: 0; font-weight: 400; }
.crop-stage { position: relative; overflow: hidden; border-radius: 12px; background: #0b0816; touch-action: none; cursor: grab; user-select: none; box-shadow: 0 0 0 2px var(--primary); }
.crop-stage:active { cursor: grabbing; }
.crop-stage img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; pointer-events: none; }
.crop-grid { position: absolute; inset: 0; pointer-events: none; background:
  linear-gradient(to right, transparent 33.1%, rgba(255,255,255,.35) 33.3%, transparent 33.5%, transparent 66.5%, rgba(255,255,255,.35) 66.7%, transparent 66.9%),
  linear-gradient(to bottom, transparent 33.1%, rgba(255,255,255,.35) 33.3%, transparent 33.5%, transparent 66.5%, rgba(255,255,255,.35) 66.7%, transparent 66.9%); }
.crop-zoom { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.crop-zoom input { flex: 1; accent-color: var(--primary); }
.img-preview { max-width: 220px; max-height: 140px; border-radius: 12px; object-fit: cover; box-shadow: var(--shadow-1); }
@media (max-width: 420px) { .news-thumb { width: 104px; height: 65px; } }

/* ---------- Gia sư ---------- */
.tutor { display: grid; gap: 4px; }
.tutor .comment { margin: 4px 0; }
.tutor .contact { font-weight: 700; font-size: 14px; background: var(--primary-soft); color: var(--primary-ink); padding: 6px 10px; border-radius: 10px; justify-self: start; word-break: break-word; }
.tutor footer { margin-top: 6px; }
.tutor .price { font-weight: 800; color: var(--good); font-size: 15px; }

/* ---------- Chat gia sư ---------- */
.chat-cta { position: relative; }
.dot-new { background: #ef4444; color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 99px; margin-left: 6px; vertical-align: middle; box-shadow: 0 2px 0 #991b1b; }
.chat-box { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.msgs { height: min(55vh, 460px); overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--card-2); }
.bubble { max-width: 80%; padding: 8px 12px; border-radius: 18px; font-size: 15px; line-height: 1.45; word-break: break-word; box-shadow: 0 2px 0 var(--edge); }
.bubble.me { align-self: flex-end; background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; border-bottom-right-radius: 5px; }
.bubble.them { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.b-time { font-size: 11px; opacity: .75; margin-top: 2px; }
.chat-form { display: grid; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: var(--card); }
.chat-row { display: flex; gap: 8px; align-items: flex-end; }
.chat-row textarea { flex: 1; resize: none; min-width: 0; }
.chat-row-item { cursor: pointer; }

/* Bong bóng chat nhỏ ở góc phải dưới (nhắn trực tiếp với admin) */
.mc-fab { position: fixed; right: 16px; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 14px); z-index: 40;
  width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer; font-size: 26px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--primary) 45%, transparent), 0 2px 6px rgba(0,0,0,.2); transition: transform .2s; }
.mc-fab:hover { transform: scale(1.07); } .mc-fab:active { transform: scale(.95); }
/* Top 10 xếp hạng giảng viên: số to viền cách điệu + thẻ đè lên */
.top-row .row-track { gap: 4px; padding: 26px 16px 16px; overflow-y: hidden; } /* .row-wrap kéo lên 14px nên cần chừa đủ khoảng trên, tránh thẻ đè lên tiêu đề */
.top-note { margin: -4px 0 4px; color: var(--muted); }
.top-item { flex: 0 0 auto; display: flex; align-items: flex-end; scroll-snap-align: start; color: #fff; text-decoration: none; }
.top-num { font: 900 168px/0.78 "Arial Black", "Segoe UI Black", Impact, sans-serif; letter-spacing: -10px; margin-right: -30px; position: relative; z-index: 0;
  color: transparent; -webkit-text-stroke: 3px color-mix(in srgb, var(--text) 45%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 35%, transparent), transparent 75%); -webkit-background-clip: text; background-clip: text;
  filter: drop-shadow(4px 6px 0 color-mix(in srgb, var(--primary) 25%, transparent)); transition: transform .3s; }
.top-item:nth-child(n+10) .top-num { letter-spacing: -22px; margin-right: -24px; } /* số 10 có 2 chữ số */
.top-card { position: relative; z-index: 1; width: 132px; height: 186px; border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 10px 34px; text-align: center; box-shadow: 0 10px 24px rgba(0,0,0,.35); transition: transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s; }
.top-card::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 30% 0%, rgba(255,255,255,.35), transparent 55%), linear-gradient(180deg, transparent 50%, rgba(0,0,0,.45)); }
.top-card > * { position: relative; }
.top-avatar { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 32px; line-height: 1; filter: none;
  background: rgba(255,255,255,.22); border: 2px solid rgba(255,255,255,.7); box-shadow: 0 4px 12px rgba(0,0,0,.25), inset 0 2px 6px rgba(255,255,255,.3); backdrop-filter: blur(4px); }

/* Avatar phủ kín khung thẻ như ảnh poster: icon khoa thật to làm nền, tên + khoa nằm phía dưới */
.top-card { justify-content: flex-end; gap: 4px; padding: 10px 10px 34px; }
.top-card .top-avatar { position: absolute !important; inset: 0; width: auto; height: auto; border: 0; border-radius: 0; background: none; box-shadow: none; backdrop-filter: none;
  display: grid; place-items: center; padding-bottom: 46px; font-size: 92px; filter: drop-shadow(0 8px 14px rgba(0,0,0,.35)); transition: transform .4s cubic-bezier(.2,.8,.2,1); }
/* Hạng 1: viền thẻ mờ nhẹ (không tô vàng cho đỡ chói) */
.top-1 .top-card { box-shadow: 0 10px 24px rgba(0,0,0,.35), 0 0 0 1.5px rgba(255,255,255,.35); }
/* Số 1, 2, 3: quầng sáng mờ kiểu đám mây cùng màu tím (giống ô đếm ngược) */
.top-1 .top-num, .top-2 .top-num, .top-3 .top-num { filter: drop-shadow(0 0 10px color-mix(in srgb, var(--primary) 55%, transparent)) drop-shadow(0 0 26px color-mix(in srgb, var(--primary) 30%, transparent)); }
.top-card::before { z-index: 1; background: radial-gradient(circle at 30% 0%, rgba(255,255,255,.3), transparent 55%), linear-gradient(180deg, transparent 45%, rgba(0,0,0,.6)); }
.top-card .top-info, .top-card .top-badge, .top-card .top-crown { z-index: 2; }
@media (hover: hover) { .top-item:hover .top-avatar { transform: scale(1.06); } }
/* Nền thẻ trong suốt (bỏ màu tím chuyển sắc), chữ theo màu chữ của web để đọc được ở cả nền sáng và tối */
.top-card { background: transparent !important; box-shadow: none; border: 0; color: var(--text); }
.top-card::before { display: none; }
.top-1 .top-card { box-shadow: none; }
.top-info b { text-shadow: none; }
.top-card .top-badge { color: #fff; }
.top-card .top-avatar { filter: drop-shadow(0 6px 10px rgba(0,0,0,.25)); }
@media (hover: hover) { .top-item:hover .top-card { box-shadow: none; } } /* không viền khung */
@media (max-width: 480px) { .top-card .top-avatar { font-size: 76px; padding-bottom: 40px; } }
.top-info b { display: block; font-size: 16px; line-height: 1.2; text-shadow: 0 1px 3px rgba(0,0,0,.35); }
.top-info small { display: block; font-size: 11.5px; opacity: .9; margin-top: 3px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.top-badge { position: absolute !important; left: 8px; right: 8px; bottom: 8px; font-size: 11px; font-weight: 800; background: rgba(0,0,0,.45); border-radius: 6px; padding: 3px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-crown { position: absolute !important; top: 6px; right: 6px; width: 26px; height: 26px; display: grid; place-items: center; font-size: 14px; border-radius: 50%; background: rgba(0,0,0,.28); backdrop-filter: blur(4px); }
@media (hover: hover) {
  .top-item:hover .top-card { box-shadow: 0 10px 24px rgba(0,0,0,.35), 0 0 0 2px rgba(255,255,255,.45); } /* không nhấc thẻ lên, giữ thẳng hàng với số */

}
@media (max-width: 480px) { .top-num { font-size: 132px; margin-right: -24px; } .top-card { width: 112px; height: 160px; } .top-avatar { width: 54px; height: 54px; font-size: 25px; } }

/* Chuồng mèo trên nút chat (to hơn 50%: 117px), 2 chú mèo ngồi ở tầng dưới của chuồng (ảnh trong img/) */
.mc-fab { width: 117px; height: 117px; background: transparent; box-shadow: none; overflow: visible; border-radius: 0; }
.mc-house { width: 117px; height: 117px; object-fit: contain; display: block; filter: drop-shadow(0 6px 10px rgba(0,0,0,.28)); }
.mc-fab > * { pointer-events: none; }
.mc-in { position: absolute; bottom: 18px; width: 31px; height: 33px; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0,0,0,.3)); transform-origin: bottom center; animation: mc-breathe 3.2s ease-in-out infinite; }
.mc-in.white { left: 31px; } .mc-in.black { left: 55px; animation-delay: -1.6s; }
.mc-fab:hover .mc-in { animation-duration: .9s; }
@keyframes mc-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05, .96) translateY(1px); } }
.mc-say { position: absolute; white-space: nowrap; font-size: 13px; font-weight: 700; color: var(--text); background: var(--card); border: 1px solid var(--line);
  padding: 7px 12px; border-radius: 14px 14px 4px 14px; box-shadow: 0 6px 18px rgba(0,0,0,.2); }
.mc-hi { right: calc(100% + 4px); top: 30%; opacity: 0; animation: mc-hi 60s ease-in-out 2s infinite; }
.mc-fab[aria-expanded="true"] .mc-hi { display: none; }
/* 60 giây hiện 1 lần, mỗi lần khoảng 3 giây */
@keyframes mc-hi { 0%, 100% { opacity: 0; transform: translateX(6px); } 0.6%, 5.4% { opacity: 1; transform: translateX(0); } 6.2% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .mc-in { animation: none; } }
.mc-fab[hidden] { display: none; }
.mc-fab.has-new::after { content: ""; position: absolute; top: 4px; right: 4px; width: 13px; height: 13px; border-radius: 50%; background: #ef4444; border: 2px solid var(--card); }
.mc-panel { position: fixed; right: 16px; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 138px); z-index: 41;
  width: min(360px, calc(100vw - 32px)); background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
  box-shadow: 0 18px 48px rgba(0,0,0,.3); display: flex; flex-direction: column; animation: mc-in .2s ease-out; }
.mc-panel[hidden] { display: none; }
@keyframes mc-in { from { opacity: 0; transform: translateY(12px) scale(.97); } }
.mc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 10px 14px; color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-2)); }
.mc-x { border: 0; background: rgba(255,255,255,.2); color: #fff; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 14px; }
.mc-msgs { height: min(46vh, 340px); }
.mc-form { padding: 10px; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); }
.chat-row-item.unread b { color: var(--primary); }

/* ---------- Khảo sát & đăng ký ---------- */
.form-card { display: block; color: var(--text); transition: transform .2s; }
/* Ảnh bìa biểu mẫu: trên thẻ danh sách và đầu trang điền biểu mẫu */
.form-card .form-cover { display: block; width: calc(100% + 32px); aspect-ratio: 16 / 9; object-fit: cover; margin: -16px -16px 12px; border-radius: var(--r) var(--r) 0 0; }
.form-hero { margin: 0 0 14px; border-radius: var(--r); max-height: 320px; }
@media (hover: hover) { .form-card:hover { transform: translateY(-3px); } }
.form-card.closed { opacity: .6; }
.req { color: var(--bad); font-weight: 800; }
.q-edit { display: grid; gap: 8px; padding: 12px; }
.q-row { display: flex; gap: 8px; align-items: center; }
.q-row input { flex: 1; min-width: 0; }
.q-row select { width: auto; max-width: 46%; }
@media (max-width: 480px) { .q-row { flex-wrap: wrap; } .q-row select { max-width: 100%; width: 100%; } }
.img-q { display: grid; gap: 8px; justify-items: start; }
.file-btn { cursor: pointer; }
.img-q .img-preview { max-width: 200px; max-height: 240px; object-fit: contain; background: var(--card-2); }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.img-cell { display: grid; gap: 4px; color: var(--text); background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 6px; min-height: 60px; }
.img-cell img { width: 100%; aspect-ratio: 3 / 4; object-fit: contain; border-radius: 8px; background: var(--track); }
.img-cell .small { word-break: break-all; font-size: 11px; }
.ans-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 14px; }

/* ---------- Bài giảng: bộ lọc ---------- */
.filter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.filter-grid select { min-width: 0; }
#lcount { margin: 0 0 8px; }

/* ---------- Lịch thi ---------- */
.exam { display: flex; gap: 14px; align-items: center; padding: 14px 16px; }
.exam.past { opacity: .55; }
.dday { flex-shrink: 0; min-width: 78px; text-align: center; font-weight: 800; font-size: 20px; color: #fff; background: linear-gradient(135deg, var(--accent), #3b82f6); padding: 12px 8px; border-radius: 16px; box-shadow: 0 4px 0 #1e40af, 0 10px 18px rgba(59,130,246,.3); text-shadow: 0 2px 0 rgba(0,0,0,.15); }
.dday.soon { background: linear-gradient(135deg, #f97316, var(--bad)); box-shadow: 0 4px 0 #9a3412, 0 10px 18px rgba(239,68,68,.3); }
.exam.past .dday { background: #8f8aa3; font-size: 14px; box-shadow: 0 4px 0 #5f5a72; }
.exam-info { min-width: 0; flex: 1; }
/* Ô đếm ngược D-x: không nền, không viền, cùng màu với khung thẻ; chỉ chữ có màu (Trang chủ và Lịch thi) */
/* Chữ luôn màu tím, phía sau có quầng sáng mờ kiểu đám mây cùng màu */
.dday, .dday.soon, .exam.past .dday { box-shadow: none; color: var(--primary); text-shadow: 0 0 12px color-mix(in srgb, var(--primary) 45%, transparent);
  background: radial-gradient(closest-side, color-mix(in srgb, var(--primary) 22%, transparent), color-mix(in srgb, var(--primary) 8%, transparent) 60%, transparent); }
.dday .dday-sub { background: transparent; padding: 0; opacity: 1; }
.countdown-card { border-left: 1px solid var(--line); }
/* Ô màu có chữ tự đặt: chữ lớn + đếm ngược nhỏ bên dưới */
.dday.custom { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; line-height: 1.1; min-width: 88px; }
.dday-label { font-size: 15px; word-break: break-word; }
.dday-sub { font-size: 12px; font-weight: 700; opacity: .9; background: rgba(0,0,0,.18); padding: 1px 7px; border-radius: 99px; }
.exam-details { margin-top: 6px; }
.exam-details summary { font-size: 13px; }
.exam-body { margin-top: 6px; font-size: 14px; line-height: 1.6; background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.left { margin-top: 4px; font-weight: 800; color: var(--primary); font-size: 14px; }
.past-wrap { margin-top: 18px; }
.past-wrap .stack { margin-top: 10px; }

/* ---------- Thêm ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tile { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 16px; }
.tile-icon { font-size: 32px; filter: drop-shadow(0 4px 3px rgba(0,0,0,.2)); transform: translateZ(20px); }
.tile.soon { opacity: .6; }
.soon-badge { position: absolute; top: 10px; right: 10px; font-size: 10px; font-weight: 800; background: var(--text); color: var(--card); padding: 2px 7px; border-radius: 99px; }

/* ---------- Admin ---------- */
.t-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.card > .t-row:last-child { border-bottom: none; }
.card.t-row { padding: 14px 16px; margin-bottom: 10px; }
.slide-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.slide-thumb { width: 72px; height: 42px; border-radius: 8px; object-fit: cover; flex-shrink: 0; display: grid; place-items: center; background: var(--track); font-size: 20px; box-shadow: 0 2px 0 var(--edge); }
.round-state { font-weight: 800; font-size: 18px; color: var(--bad); }
.round-state.open { color: var(--good); }

/* Hộp xác nhận của web */
.ask-wrap { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 16px; background: rgba(8,6,18,.55); backdrop-filter: blur(3px); animation: askIn .15s ease-out; }
.ask-box { width: min(380px, 100%); padding: 20px; box-shadow: var(--shadow-2); animation: askPop .2s cubic-bezier(.5,1.6,.4,1); }
.ask-box p { margin: 0 0 16px; font-weight: 700; font-size: 16px; }
.ask-box .row-btns { justify-content: flex-end; }
@keyframes askIn { from { opacity: 0; } }
@keyframes askPop { from { transform: scale(.9); opacity: 0; } }

#toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 20px); transform: translateX(-50%) translateY(20px); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 14px; opacity: 0; transition: .25s; pointer-events: none; z-index: 99; max-width: 90vw; font-size: 14px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* =========================================================
   Hiệu ứng kiểu "rạp phim": banner điện ảnh, hàng thẻ trượt ngang, thẻ phóng to khi rê chuột, intro mở đầu
   ========================================================= */
.hero.cine { min-height: 300px; display: flex; align-items: flex-end; padding: 0; transform: none; }
.hero-content { position: relative; z-index: 2; padding: 26px 22px 22px; width: 100%; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transform: scale(1.06); animation: kenburns 18s ease-in-out infinite alternate; }
@keyframes kenburns { from { transform: scale(1.06) translate(0, 0); } to { transform: scale(1.16) translate(-2%, -2%); } }
.hero-shade { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero.has-img::before, .hero.has-img::after { display: none; }
.hero.has-img { background: #0b0816; }
.hero.has-img .hero-shade { background: linear-gradient(to top, rgba(8,6,18,.96) 0%, rgba(8,6,18,.55) 45%, rgba(8,6,18,.05) 100%), linear-gradient(to right, rgba(8,6,18,.7), transparent 70%); }
.hero-tag { display: inline-block; font-size: 12px; font-weight: 800; background: rgba(255,255,255,.2); padding: 2px 8px; border-radius: 6px; margin-right: 4px; backdrop-filter: blur(4px); }
.hero-btns { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.hbtn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 20px; border-radius: 8px; font-weight: 800; font-size: 15px; transition: transform .15s, background .15s; }
.hbtn.play { background: #fff; color: #111; box-shadow: 0 4px 0 rgba(0,0,0,.25); }
.hbtn.info { background: rgba(109,109,110,.7); color: #fff; backdrop-filter: blur(6px); box-shadow: 0 4px 0 rgba(0,0,0,.25); }
@media (hover: hover) { .hbtn.play:hover { background: rgba(255,255,255,.82); } .hbtn.info:hover { background: rgba(109,109,110,.45); } }
.hbtn:active { transform: translateY(3px); box-shadow: none; }
.hero.cine h1 { font-size: 32px; }

/* Slide trình chiếu trang chủ: chuyển mờ dần, chấm chỉ vị trí, nút ‹ › */
.hero.slideshow { min-height: 320px; background: #0b0816; }
.hero.slideshow::before, .hero.slideshow::after { display: none; }
.slide { position: absolute; inset: 0; display: flex; align-items: flex-end; opacity: 0; visibility: hidden; transition: opacity .9s ease, visibility 0s .9s; overflow: hidden; isolation: isolate; }
.slide.on { opacity: 1; visibility: visible; transition: opacity .9s ease; z-index: 1; }
.slide .hero-bg { animation: none; transform: scale(1.04); }
.slide.on .hero-bg { animation: kenburns 14s ease-in-out infinite alternate; }
.slide.has-img .hero-shade { background: linear-gradient(to top, rgba(8,6,18,.95) 0%, rgba(8,6,18,.5) 45%, rgba(8,6,18,.05) 100%), linear-gradient(to right, rgba(8,6,18,.65), transparent 70%); }
.slide:not(.has-img) .hero-shade { background: radial-gradient(circle at 85% 15%, rgba(255,255,255,.28), transparent 45%); }
.slide .hero-content { padding-bottom: 40px; }
.slide .hero-content > * { transform: translateY(14px); opacity: 0; transition: transform .7s cubic-bezier(.2,.8,.2,1) .25s, opacity .7s .25s; }
.slide.on .hero-content > * { transform: none; opacity: 1; }
.ss-dots { position: absolute; z-index: 3; left: 22px; bottom: 14px; display: flex; gap: 6px; }
.ss-dots button { width: 18px; height: 4px; padding: 0; border: none; border-radius: 99px; background: rgba(255,255,255,.4); cursor: pointer; transition: width .3s, background .3s; }
.ss-dots button[aria-pressed=true] { width: 34px; background: #fff; }
.ss-nav { position: absolute; z-index: 3; top: 50%; transform: translateY(-50%); width: 40px; height: 56px; border: none; border-radius: 10px; background: rgba(0,0,0,.35); color: #fff; font-size: 30px; cursor: pointer; opacity: 0; transition: opacity .2s; display: none; }
.ss-nav.prev { left: 8px; } .ss-nav.next { right: 8px; }
@media (hover: hover) { .ss-nav { display: block; } .hero.slideshow:hover .ss-nav { opacity: 1; } }
@media (max-width: 480px) { .hero.slideshow { min-height: 280px; } }

/* Hàng trượt ngang */
.row { margin-top: 26px; }
.row-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.row-head { gap: 10px; }
.row-head a { font-size: 14px; font-weight: 700; opacity: .85; transition: .2s; white-space: nowrap; }
@media (hover: hover) { .row-head a { opacity: 0; transform: translateX(-6px); } .row:hover .row-head a { opacity: 1; transform: none; } }
.row-wrap { position: relative; margin: -14px -16px 0; } /* bù khoảng trống phía trên dành cho thẻ phóng to */
.row-track {
  display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 16px; padding: 32px 16px 24px; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 16px, #000 calc(100% - 28px), transparent 100%);
          mask-image: linear-gradient(to right, transparent 0, #000 16px, #000 calc(100% - 28px), transparent 100%);
}
.row-track::-webkit-scrollbar { display: none; }
.row-arrow {
  position: absolute; top: 32px; bottom: 24px; z-index: 5; width: 44px; border: none; cursor: pointer; font-size: 34px; font-weight: 300; color: #fff;
  background: rgba(10,8,20,.5); opacity: 0; transition: opacity .2s, background .2s; display: none;
}
.row-arrow.left { left: 0; border-radius: 0 10px 10px 0; } .row-arrow.right { right: 0; border-radius: 10px 0 0 10px; }
@media (hover: hover) and (min-width: 600px) {
  .row-arrow { display: block; }
  .row-wrap:hover .row-arrow { opacity: 1; }
  .row-arrow:hover { background: rgba(10,8,20,.75); }
  .row-wrap.at-start .row-arrow.left, .row-wrap.at-end .row-arrow.right { opacity: 0 !important; pointer-events: none; }
}

/* Thẻ poster: phóng to + nổi lên khi rê chuột (có độ trễ nhẹ như rạp phim) */
.poster {
  flex: 0 0 auto; width: 172px; scroll-snap-align: start; color: var(--text); border-radius: 12px; overflow: hidden; position: relative;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-1);
  transition: transform .3s cubic-bezier(.2,.8,.2,1) .08s, box-shadow .3s .08s; transform-origin: center bottom;
}
.row-track .poster:first-child { transform-origin: left bottom; } .row-track .poster:last-child { transform-origin: right bottom; }
.poster-art { position: relative; aspect-ratio: 16 / 10; display: grid; place-items: center; overflow: hidden; }
/* Ảnh trong thẻ: hiện trọn ảnh (không cắt), nền là bản mờ của ảnh */
.poster-art .poster-blur { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(14px) brightness(.8); transform: scale(1.25); }
.poster-art .poster-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s; } /* ảnh đã cắt đúng khung 16:10 nên lấp đầy */
.poster-icon { font-size: 40px; filter: drop-shadow(0 6px 6px rgba(0,0,0,.3)); transition: transform .4s cubic-bezier(.5,1.6,.4,1); }
.poster-badge { position: absolute; left: 8px; top: 8px; max-width: calc(100% - 16px); font-size: 11px; font-weight: 800; color: #fff; background: rgba(0,0,0,.55); backdrop-filter: blur(4px); padding: 2px 8px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.poster-body { padding: 9px 11px 11px; }
.poster-body b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; line-height: 1.35; }
.poster-body .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
@media (hover: hover) {
  .poster:hover { transform: scale(1.12) translateY(-6px); z-index: 4; box-shadow: 0 18px 40px rgba(0,0,0,.35), 0 0 0 2px var(--primary); }
  .poster:hover .poster-art .poster-img { transform: scale(1.06); }
  .poster:hover .poster-icon { transform: scale(1.2) rotate(-6deg); }
}
.poster:active { transform: scale(.97); }
/* Giảng viên nổi bật: khung và ô màu trong suốt */
.row-teachers .poster { border-color: transparent; }
.row-teachers .poster-art { background: transparent !important; }
@media (hover: hover) { .row-teachers .poster:hover { box-shadow: 0 18px 40px rgba(0,0,0,.35); } }
@media (max-width: 480px) { .poster { width: 148px; } .hero.cine { min-height: 260px; } .hero.cine h1 { font-size: 26px; } }

/* Thanh trên: trong suốt ở đầu trang, đậm dần khi cuộn */
.topbar { transition: background .3s, box-shadow .3s; }
.topbar.scrolled { box-shadow: 0 6px 20px rgba(0,0,0,.12); }

/* Intro mở đầu (1 lần mỗi phiên): logo phóng to rồi mờ dần */
#intro { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: #07050f; animation: introOut .45s ease-in 1.05s forwards; cursor: pointer; }
#intro .intro-logo { display: flex; align-items: center; gap: 14px; font-weight: 900; font-size: clamp(28px, 7vw, 54px); letter-spacing: -1px; color: #fff;
  animation: introZoom 1.4s cubic-bezier(.2,.8,.2,1) both; text-shadow: 0 0 30px rgba(236,72,153,.6), 0 0 60px rgba(124,58,237,.5); }
#intro .intro-logo svg { width: 1.6em; height: 1.07em; border-radius: 6px; box-shadow: 0 0 30px rgba(218,37,29,.7); }
#intro .intro-glow { position: absolute; width: 60vmin; height: 60vmin; border-radius: 50%; background: radial-gradient(circle, rgba(236,72,153,.45), rgba(124,58,237,.2) 45%, transparent 70%); animation: introGlow 1.4s ease-out both; }
@keyframes introZoom { 0% { transform: scale(.6); opacity: 0; filter: blur(8px); } 35% { opacity: 1; filter: blur(0); } 100% { transform: scale(1.12); } }
@keyframes introGlow { from { transform: scale(.2); opacity: 0; } 50% { opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
@keyframes introOut { to { opacity: 0; visibility: hidden; } }

/* Hiện nội dung mượt khi chuyển trang */
#view > * { animation: rise .35s cubic-bezier(.2,.8,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Tôn trọng người dùng tắt hiệu ứng chuyển động */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .hero { transform: none; }
}
