/* home.css — homepage only: logo mirror shine + fire buy buttons + product detail modal
   (S12.9/S12.10/S12.11) + featured ribbon (extracted from S12.7). Requires base.css. */

/* ==================== Section titles — IN HOA (uppercase) ====================
   Tiêu đề CHÍNH mỗi section (h2.font-display bên trong <section>) hiển thị IN HOA.
   KHÔNG áp cho hero (h1, không phải h2), tiêu đề card (h3), hay footer (h4).
   Span gradient bên trong kế thừa uppercase — hiệu ứng gradient giữ nguyên. */
section h2.font-display {
  text-transform: uppercase;
}

/* Logo mirror shine ĐÃ BỎ (2026-08-27, bớt hiệu ứng động phô trương). */

/* ==================== Product detail modal (S12.9) ====================
   Click vào sản phẩm/dịch vụ/tài nguyên/khóa học → mở popup chi tiết.
   Backdrop full-screen, panel max-w-560px, scale-in animation. */

.product-detail-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(12, 35, 64, 0.55);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: backdropFadeIn 0.2s ease-out;
}

.product-detail-backdrop.hidden { display: none; }

@keyframes backdropFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.product-detail-modal {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: linear-gradient(180deg, #FFFFFF 0%, #F6F9FD 100%);
  border-radius: 28px;
  border: 1px solid #C6D5E9;
  box-shadow: 0 30px 60px -20px rgba(12, 35, 64, 0.35), 0 0 0 1px rgba(11, 46, 99, 0.08);
  padding: 28px 26px 24px;
  animation: detailModalIn 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes detailModalIn {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}

.product-detail-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(12, 35, 64, 0.06);
  border: 1px solid transparent;
  color: #3D556F;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 2;
}

.product-detail-close:hover {
  background: rgba(11, 46, 99, 0.12);
  color: #0B2E63;
  transform: rotate(90deg);
}

.product-detail-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
  padding-right: 36px;
}

.product-detail-emoji {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: linear-gradient(135deg, #F6F9FD, #EEF4FC);
  border: 1px solid rgba(11, 46, 99, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  line-height: 1;
  flex-shrink: 0;
  box-shadow: 0 8px 18px -8px rgba(11, 46, 99, 0.35);
}

.product-detail-titles {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.product-detail-eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #0B2E63;
}

.product-detail-name {
  font-family: inherit;
  font-weight: 800;
  font-size: 24px;
  line-height: 1.2;
  color: #0C2340;
  margin: 0;
}

.product-detail-tagline {
  font-size: 13px;
  color: #3D556F;
  font-weight: 500;
}

.product-detail-price-block {
  background: linear-gradient(135deg, rgba(11, 46, 99, 0.08), rgba(27, 79, 160, 0.06));
  border: 1px solid rgba(11, 46, 99, 0.22);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.product-detail-price-block.hidden { display: none; }

.product-detail-price-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #5B6E8C;
  margin-bottom: 4px;
}

.product-detail-price {
  font-family: inherit;
  font-weight: 800;
  font-size: 26px;
  color: #0B2E63;
  line-height: 1.1;
}

.product-detail-desc {
  font-size: 14px;
  line-height: 1.65;
  color: #3D556F;
  margin-bottom: 14px;
}

.product-detail-features {
  list-style: none;
  padding: 0;
  margin: 0 0 18px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product-detail-features.hidden { display: none; }

.product-detail-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  color: #3D556F;
  line-height: 1.5;
}

.detail-feat-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(91, 168, 90, 0.18);
  color: #5BA85A;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 1px;
}

.product-detail-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px dashed #C6D5E9;
}

.detail-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), background 0.25s ease, box-shadow 0.25s ease;
}

.detail-action-buy {
  background: #0B2E63;
  color: #FFFFFF;
  box-shadow: 0 8px 18px -8px rgba(11, 46, 99, 0.5);
}

.detail-action-buy:hover {
  background: #082249;
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -8px rgba(11, 46, 99, 0.6);
}

.detail-action-zalo {
  background: #0068FF;
  color: #FFFFFF;
}

.detail-action-zalo:hover {
  background: #0052D4;
  transform: translateY(-2px);
  box-shadow: 0 10px 22px -8px rgba(0, 104, 255, 0.55);
}

.detail-action-msger {
  background: #FFFFFF;
  color: #0C2340;
  border: 1px solid #C6D5E9;
}

.detail-action-msger:hover {
  background: #EEF4FC;
  border-color: rgba(11, 46, 99, 0.32);
  transform: translateY(-2px);
}

@media (min-width: 481px) {
  .product-detail-actions {
    flex-direction: row;
  }
  .detail-action-btn {
    flex: 1;
  }
}

/* Product info button reset (S12.9) — `<button>` thay <div> để semantic clickable */
button.resource-product-info {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: opacity 0.2s ease;
}

button.resource-product-info:hover {
  opacity: 0.78;
}

button.resource-product-info:focus-visible {
  outline: 2px solid #0B2E63;
  outline-offset: 4px;
  border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  .product-detail-backdrop,
  .product-detail-modal,
  .product-detail-close,
  .detail-action-btn {
    animation: none !important;
    transition: none !important;
  }
}


/* ---- Featured ribbon + featured card (extracted from S12.7 resources region) ---- */
/* ⭐ Featured ribbon trên course/service card public — góc trên trái, gradient cam-vàng nổi bật */
.featured-ribbon {
  position: absolute;
  top: 14px;
  left: -8px;
  z-index: 25;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 14px 5px 12px;
  background: linear-gradient(135deg, #F5B622 0%, #0B2E63 100%);
  color: #FFFFFF;
  font-family: inherit;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 0 999px 999px 0;
  box-shadow: 0 6px 14px -4px rgba(11, 46, 99, 0.5);
  pointer-events: none;
}
.featured-ribbon::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 6px 8px 0 0;
  border-color: #082249 transparent transparent transparent;
}

/* Card có featured: viền accent + glow nhẹ — visual cue admin's choice */
.is-featured-card {
  border-color: rgba(11, 46, 99, 0.55) !important;
  box-shadow:
    0 0 0 2px rgba(245, 182, 34, 0.25),
    0 18px 36px -16px rgba(11, 46, 99, 0.35),
    var(--card-extra-shadow, none);
}

/* ============================================================================
   9ROUTER-BLEND REDESIGN (Track 2 — 2026-07-16)
   Tech-grid ô vuông + đường kẻ động (transform-based, GPU) trên nền cream.
   Thay viền neon cũ (animate `left` = reflow). Reduced-motion an toàn.
   ========================================================================== */

/* --- Card hover 9router: viền accent + lift nhẹ, đồng bộ --- */
.grid-card {
  position: relative;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.35s ease;
}
.grid-card:hover {
  transform: translateY(-5px);
  border-color: rgba(11, 46, 99, 0.4);
  box-shadow: 0 22px 48px -24px rgba(11, 46, 99, 0.28);
}

/* --- Voice app equalizer bars (transform scaleY — GPU) --- */
.voice-bar {
  flex: 1 1 0;
  min-width: 3px;
  border-radius: 9999px;
  background: linear-gradient(to top, #0B2E63, #1B4FA0);
  transform-origin: bottom;
  animation: voiceBar 1.1s ease-in-out infinite;
}
.voice-bar:nth-child(3n)  { animation-duration: 0.9s;  animation-delay: -0.2s; }
.voice-bar:nth-child(3n+1){ animation-duration: 1.3s;  animation-delay: -0.5s; }
.voice-bar:nth-child(4n)  { animation-duration: 0.75s; animation-delay: -0.35s; }
@keyframes voiceBar {
  0%, 100% { transform: scaleY(0.35); opacity: 0.7; }
  50%      { transform: scaleY(1);    opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .voice-bar { animation: none !important; transform: scaleY(0.6); }
}

/* ============================================================
   Icon bay / đường vân động / chip sweep ĐÃ BỎ (2026-08-27, bớt hiệu ứng động phô trương).
   ============================================================ */

/* --- Ánh sáng: halo tĩnh quanh nút CTA chính khi hover (không còn đập nhịp) --- */
.btn-hover { position: relative; }
.btn-hover::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(11,46,99,0.55), rgba(27,79,160,0.5), rgba(245,182,34,0.45));
  filter: blur(10px);
  opacity: 0;
  z-index: -1;
  transition: opacity 0.3s ease;
}
.btn-hover:hover::before { opacity: 0.75; }

/* === Giãn dòng chống dấu tiếng Việt chồng chéo (+~20%) + giãn tracking heading === */
#hero-heading { line-height: 1.25 !important; letter-spacing: -0.005em; }
section h2.font-display { line-height: 1.24 !important; letter-spacing: -0.012em; }
section h3.font-display, .grid-card h3, .comm-name { line-height: 1.32; }
section p, .comm-card p, .blog-card-excerpt, .comm-desc, li { line-height: 1.8; }

/* === Heading + mô tả section: TINH GỌN (S13.3, thu thêm ở S14 — 2026-08-27) ===
   Trước: h2 cố định 60px (text-6xl) nhưng khối chứa chỉ max-w-3xl (672px) →
   tiêu đề xuống 3–4 dòng, chiếm gần hết viewport, trang dài 8687px.
   S13.3: cỡ chữ theo clamp (28→40px). S14: phản hồi "vẫn quá to" → thu thêm
   xuống 24→34px, giảm luôn padding section + card để cả trang gọn hơn hẳn. */
body > section h2.font-display {
  font-size: clamp(1.5rem, 1.05rem + 1.2vw, 2.125rem) !important;
  line-height: 1.18 !important;
  letter-spacing: -0.022em;
  margin-bottom: 0.75rem !important;
}

/* Nới khối chứa heading để tiêu đề gói trong 2 dòng thay vì 4 */
body > section .max-w-3xl { max-width: 52rem; }
body > section .max-w-2xl { max-width: 44rem; }

/* Mô tả dưới tiêu đề — nhỏ gọn, dòng ngắn cho dễ đọc */
body > section h2.font-display + p {
  font-size: 0.9375rem !important;
  line-height: 1.65 !important;
  max-width: 40rem;
}
body > section .text-center h2.font-display + p { margin-left: auto; margin-right: auto; }

/* Khoảng cách dưới khối heading: 36px → 28px */
body > section .mb-14,
body > section .mb-16 { margin-bottom: 1.75rem !important; }

/* === Spacing section (tailwind build cũ thiếu pt-24/py-20/py-28 → set trực tiếp) === */
body > section { padding-top: 2.25rem !important; padding-bottom: 2.25rem !important; }
@media (min-width: 640px) { body > section { padding-top: 3rem !important; padding-bottom: 3rem !important; } }
/* Hero: đủ top để hở navbar (73px) + không dính chữ */
body > section[aria-labelledby="hero-heading"] { padding-top: 5.25rem !important; padding-bottom: 2rem !important; }
@media (min-width: 640px) { body > section[aria-labelledby="hero-heading"] { padding-top: 6rem !important; padding-bottom: 2.5rem !important; } }

/* === Compact mode (S14, 2026-08-27) — "session/khung/text quá to" ===
   Thu gọn thêm: hero h1, tiêu đề card, padding/margin/gap trong card.
   Chỉ áp trong body > section (không đụng header/footer/modal). */

/* Hero h1: 68px → tối đa 48px */
#hero-heading {
  font-size: clamp(1.5rem, 1rem + 3.2vw, 3rem) !important;
}

/* Tiêu đề card khóa học/dịch vụ nhỏ (text-2xl, 24px) → 20px */
body > section h3.text-2xl { font-size: 1.25rem !important; }

/* Tiêu đề card khóa học nổi bật (text-3xl lg:text-5xl, 30-48px) → 24-36px */
[data-course-slot="big"] h3 { font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2.25rem) !important; }

/* Padding trong card: p-5/p-6/p-7/p-8 đang quá rộng so với nội dung */
body > section .p-5 { padding: 0.875rem !important; }
body > section .p-6 { padding: 1rem !important; }
body > section .p-7 { padding: 1.25rem !important; }
body > section .p-8 { padding: 1.5rem !important; }
@media (min-width: 1024px) {
  body > section .lg\:p-6 { padding: 1.125rem !important; }
  body > section .lg\:p-8 { padding: 1.5rem !important; }
  body > section .lg\:p-10 { padding: 1.75rem !important; }
}

/* Margin dưới trong card — bớt khoảng trống thừa giữa các khối */
body > section .mb-5 { margin-bottom: 0.875rem !important; }
body > section .mb-6 { margin-bottom: 1rem !important; }
body > section .mb-8 { margin-bottom: 1.25rem !important; }
body > section .mb-9 { margin-bottom: 1.5rem !important; }

/* Card nổi bật (khóa học/testimonial) — bớt chiều cao tối thiểu ép buộc */
body > section .min-h-\[440px\] { min-height: 340px !important; }

/* Gap giữa card trong grid */
body > section .gap-5 { gap: 1rem !important; }
@media (min-width: 1024px) {
  body > section .lg\:gap-6 { gap: 1.25rem !important; }
}

/* Chữ trong card: siết dòng + bớt cỡ text-lg cho gọn (không đụng text-base — cỡ đọc chuẩn) */
body > section .leading-relaxed { line-height: 1.5 !important; }
body > section .text-lg { font-size: 1rem !important; }
@media (min-width: 1024px) {
  body > section .lg\:text-lg { font-size: 1rem !important; }
}

/* ==================== Hub Carousel — quay quanh bề mặt hình cầu (2026-08-28 v2) ==================== */
/* JS (hub-carousel.js) tính toán transform từng thẻ theo góc thật (sin/cos) —
   thẻ được gắn "hướng ra ngoài" mặt cầu (rotateY cùng dấu với góc vị trí) tạo
   hiệu ứng LỒI ra ngoài (convex), không phải cong lõm vào trong. */

.hub-carousel-wrap {
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
  perspective: 2000px;
  overflow: hidden;
}

.hub-carousel-track {
  position: relative;
  height: 340px; /* JS ghi đè inline theo kích thước thẻ thật tính động */
  transform-style: preserve-3d;
}

.hub-carousel-card {
  /* width/height/margin do JS set inline (hub-carousel.js) — tính theo bề rộng khung,
     tỉ lệ thuận với bán kính, tránh thẻ đè nhau ở màn hẹp. Transform cũng do JS set. */
  position: absolute;
  top: 50%;
  left: 50%;
  text-decoration: none;
  transition: transform 0.6s cubic-bezier(0.34, 1.15, 0.32, 1), opacity 0.6s ease, width 0.3s ease, height 0.3s ease, margin 0.3s ease;
  will-change: transform, opacity;
}

.hub-carousel-card.is-hidden {
  pointer-events: none;
}

.hub-carousel-card .hub-carousel-tile {
  width: 100%;
  height: 100%;
  border-radius: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  color: var(--text-on-dark);
  text-align: center;
  padding: 20px;
  transition: box-shadow 0.4s ease, border-color 0.4s ease, background-color 0.4s ease;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.10),
    0 20px 40px -16px rgba(0, 0, 0, 0.35);
}

.hub-carousel-card.is-active .hub-carousel-tile {
  position: relative;
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(245, 182, 34, 0.55);
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.3),
    0 32px 64px -20px rgba(0, 0, 0, 0.5),
    0 0 40px -8px var(--glow-cyan-soft);
}

.hub-carousel-card.is-active .hub-carousel-tile::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(245, 182, 34, 0.6), rgba(34, 211, 238, 0.3), transparent 60%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.hub-carousel-tile .hub-carousel-icon {
  font-size: 52px;
  line-height: 1;
}

.hub-carousel-tile .hub-carousel-label {
  font-weight: 700;
  font-size: 20px;
  line-height: 1.3;
  text-transform: uppercase;
  color: var(--text-on-dark);
}

@media (max-width: 639px) {
  .hub-carousel-wrap { perspective: 1100px; }
  .hub-carousel-tile .hub-carousel-icon { font-size: 40px; }
  .hub-carousel-tile .hub-carousel-label { font-size: 16px; }
}

.hub-carousel-controls {
  display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 22px;
}

.hub-carousel-arrow {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18); background: rgba(255, 255, 255, 0.06); color: var(--text-on-dark);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-weight: 800; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.hub-carousel-arrow:hover { background: rgba(255, 255, 255, 0.12); border-color: var(--glow-cyan); }
.hub-carousel-arrow:active { transform: scale(0.92); }

.hub-carousel-dots { display: flex; gap: 7px; justify-content: center; margin-top: 14px; }
.hub-carousel-dots span {
  width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, 0.22);
  transition: background-color 0.3s ease, width 0.3s ease; cursor: pointer;
}
.hub-carousel-dots span.is-active { background: #F5B622; width: 20px; border-radius: 4px; }

.hub-carousel-cta {
  display: block; text-align: center; margin-top: 18px;
}

@media (prefers-reduced-motion: reduce) {
  .hub-carousel-card { transition: none !important; }
}
