/**
 * 弘易聖道 Hong Yi Sheng Dao - Custom Styles
 * Traditional Chinese aesthetic: ink wash, seal accents, gold accents.
 */

/* ========== FONT FAMILIES ========== */
.font-calligraphy { font-family: 'Ma Shan Zheng', 'STKaiti', 'KaiTi', serif; }
.font-display { font-family: 'Playfair Display', 'Georgia', serif; }
.font-body { font-family: 'Inter', 'Noto Serif SC', system-ui, sans-serif; }
.font-serif { font-family: 'Noto Serif SC', 'STSong', 'SimSun', serif; }

/* ========== LANGUAGE DISPLAY ========== */
/* Default: both languages visible (bilingual mode) */
.lang-primary { display: inline; font-size: inherit; font-weight: inherit; }
.lang-secondary { display: inline; font-size: 0.85em; opacity: 0.7; font-style: italic; }
/* JS-generated content in forced mode uses this class (never hidden) */
.lang-current { display: inline; font-size: inherit; font-weight: inherit; }

/* ========== INK WASH GRADIENT ========== */
.ink-gradient {
  background: linear-gradient(135deg, #1A1A1A 0%, #2D1B1B 30%, #3D2020 60%, #1A1A1A 100%);
}
.ink-gradient-light {
  background: linear-gradient(135deg, #F5F0E8 0%, #EDE5D8 50%, #E8DCC8 100%);
}

/* ========== SEAL ACCENT ========== */
.seal-accent {
  position: relative;
}
.seal-accent::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, transparent, #8B1A1A, transparent);
  border-radius: 2px;
}

/* ========== GOLD DIVIDER ========== */
.gold-divider {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #C8963E, transparent);
  margin: 0 auto;
}

/* ========== CARD STYLES ========== */
.card-hover {
  transition: all 0.3s ease;
  border: 1px solid transparent;
}
.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
  border-color: #C8963E;
}
.card-exclusive {
  border: 2px solid #C8963E;
  position: relative;
}
.card-exclusive::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #8B1A1A, #C8963E, #8B1A1A, transparent);
}

/* ========== CLOUD PATTERN BG ========== */
.cloud-pattern {
  background-color: #F5F0E8;
  background-image: 
    radial-gradient(ellipse at 20% 50%, rgba(200, 150, 62, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(139, 26, 26, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(200, 150, 62, 0.04) 0%, transparent 50%);
}

/* ========== HERO SECTION ========== */
.hero-ink {
  background: linear-gradient(135deg, #0D0D0D 0%, #1A1A1A 30%, #1A0A0A 60%, #0D0D0D 100%);
  position: relative;
  overflow: hidden;
}
.hero-ink::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: 
    radial-gradient(circle at 20% 80%, rgba(139, 26, 26, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 80% 20%, rgba(200, 150, 62, 0.08) 0%, transparent 40%);
  animation: inkFlow 20s ease-in-out infinite alternate;
}
@keyframes inkFlow {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-2%, 2%) scale(1.05); }
}

/* ========== TRUST BAR ========== */
.trust-stat {
  transition: all 0.3s ease;
}
.trust-stat:hover {
  transform: translateY(-2px);
}
.trust-stat:hover .trust-value {
  color: #C8963E;
}
.trust-value {
  transition: color 0.3s ease;
}

/* ========== BUTTON STYLES ========== */
.btn-primary {
  background-color: #8B1A1A;
  color: white;
  padding: 0.75rem 2rem;
  border-radius: 0.375rem;
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-block;
  text-align: center;
}
.btn-primary:hover {
  background-color: #6B0F0F;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 26, 26, 0.3);
}
.btn-gold {
  background-color: #C8963E;
  color: white;
  padding: 0.75rem 2rem;
  border-radius: 0.375rem;
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-block;
  text-align: center;
}
.btn-gold:hover {
  background-color: #A87A2E;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(200, 150, 62, 0.3);
}
.btn-outline {
  border: 2px solid #C8963E;
  color: #C8963E;
  padding: 0.75rem 2rem;
  border-radius: 0.375rem;
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-block;
  text-align: center;
}
.btn-outline:hover {
  background-color: #C8963E;
  color: white;
  transform: translateY(-1px);
}

/* ========== FILTER TABS ========== */
.filter-tab {
  padding: 0.5rem 1.5rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid #D1C7B8;
  background: white;
  color: #666;
}
.filter-tab:hover {
  border-color: #C8963E;
  color: #C8963E;
}
.filter-tab.active {
  background: #8B1A1A;
  color: white;
  border-color: #8B1A1A;
}

/* ========== PRODUCT TAG ========== */
.product-tag {
  font-size: 0.7rem;
  padding: 0.15rem 0.6rem;
  border-radius: 9999px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tag-tool { background: #1A1A1A; color: #C8963E; }
.tag-craft { background: #F5F0E8; color: #8B1A1A; border: 1px solid #8B1A1A; }
.tag-protection { background: #8B1A1A; color: #F5F0E8; }

/* ========== BLOG CARD ========== */
.blog-card {
  transition: all 0.3s ease;
}
.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.1);
}
.blog-card:hover .blog-thumb {
  transform: scale(1.05);
}
.blog-thumb {
  transition: transform 0.5s ease;
}

/* ========== TESTIMONIAL ========== */
.testimonial-card {
  position: relative;
}
.testimonial-card::before {
  content: '"';
  position: absolute;
  top: -10px;
  left: 20px;
  font-size: 4rem;
  color: #C8963E;
  opacity: 0.3;
  font-family: 'Playfair Display', serif;
  line-height: 1;
}

/* ========== MENTORSHIP HIGHLIGHT ========== */
.mentorship-card {
  background: linear-gradient(135deg, #1A1A1A 0%, #2D1B1B 50%, #1A1A1A 100%);
  border: 2px solid #C8963E;
  position: relative;
  overflow: hidden;
}
.mentorship-card::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(200, 150, 62, 0.1) 0%, transparent 70%);
  border-radius: 50%;
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #F5F0E8;
}
::-webkit-scrollbar-thumb {
  background: #C8963E;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #8B1A1A;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem !important;
  }
  .hero-subtitle {
    font-size: 1.2rem !important;
  }
}

/* ========== ANIMATIONS ========== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
}
.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }

/* ========== SECTION SECTION TITLES ========== */
.section-title {
  position: relative;
  display: inline-block;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #C8963E, transparent);
}

/* ========== LEVEL PILL ========== */
.level-pill {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #F5F0E8;
  color: #8B1A1A;
  border: 1px solid #8B1A1A;
  margin: 0.15rem;
}

/* ========== STAT CARD ========== */
.stat-card {
  text-align: center;
  padding: 1.5rem;
  border-radius: 0.5rem;
  background: white;
  border: 1px solid #EDE5D8;
  transition: all 0.3s ease;
}
.stat-card:hover {
  border-color: #C8963E;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

/* ========== LINEAGE ITEM ========== */
.lineage-item {
  border-left: 3px solid #C8963E;
  padding-left: 1.5rem;
  transition: all 0.3s ease;
}
.lineage-item:hover {
  border-left-color: #8B1A1A;
  background: rgba(200, 150, 62, 0.05);
}

/* ========== MOBILE NAV OVERLAY ========== */
@media (max-width: 767px) {
  #mobile-menu {
    animation: slideDown 0.3s ease-out;
  }
}
@keyframes slideDown {
  from { opacity: 0; max-height: 0; }
  to { opacity: 1; max-height: 500px; }
}

/* ========== FEATURE LIST ========== */
.feature-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #C8963E;
  margin-right: 0.5rem;
  flex-shrink: 0;
}

/* ========== MODULE GRID ========== */
.module-tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  border-radius: 0.25rem;
  background: rgba(200, 150, 62, 0.1);
  color: #8B1A1A;
  margin: 0.15rem;
  border: 1px solid rgba(200, 150, 62, 0.3);
}

/* ========== NAVIGATION BAR ========== */
.site-nav {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
  background: rgba(255,255,255,0.95); backdrop-filter: blur(12px);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: box-shadow 0.3s ease;
}
.site-nav.scrolled {
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}
.nav-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 1rem;
}
.nav-left { display: flex; align-items: center; flex-shrink: 0; }
.nav-logo {
  font-family: 'Ma Shan Zheng', 'STKaiti', 'KaiTi', serif;
  font-size: 1.5rem; color: #8B1A1A; text-decoration: none;
  white-space: nowrap; letter-spacing: 0.05em;
  transition: color 0.2s; display: flex; align-items: center;
}
.nav-logo img { height: 40px; width: auto; }
.nav-logo:hover { color: #C8963E; }
.nav-links {
  display: flex; align-items: center; gap: 0.25rem;
  flex-wrap: wrap; justify-content: center; flex: 1;
}
.nav-right {
  display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0;
}
.nav-link {
  display: inline-block; padding: 0.5rem 0.85rem; font-size: 0.875rem;
  color: #444; text-decoration: none; border-radius: 0.375rem;
  font-weight: 500; white-space: nowrap;
  transition: all 0.2s ease;
}
.nav-link:hover { color: #8B1A1A; background: rgba(139,26,26,0.06); }
.nav-link.active { color: #8B1A1A; background: rgba(139,26,26,0.08); font-weight: 600; }
.lang-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.35rem 0.75rem; font-size: 0.75rem; font-weight: 600;
  color: #8B1A1A; background: rgba(139,26,26,0.06); border: 1px solid rgba(139,26,26,0.2);
  border-radius: 9999px; cursor: pointer; white-space: nowrap;
  transition: all 0.2s ease; margin-left: 0.5rem; font-family: inherit;
}
.lang-toggle:hover { background: #8B1A1A; color: #fff; border-color: #8B1A1A; }
.nav-auth { display: inline-flex; align-items: center; gap: 0.25rem; margin-left: 0.5rem; }
.nav-link-signup {
  background: #8B1A1A; color: #fff !important; border-radius: 9999px;
  padding: 0.35rem 1rem !important; font-size: 0.8rem !important;
}
.nav-link-signup:hover { background: #6B0F0F !important; }
.nav-logout {
  display: inline-block; padding: 0.35rem 0.75rem; font-size: 0.75rem;
  color: #999; background: none; border: 1px solid #ddd; border-radius: 0.375rem;
  cursor: pointer; white-space: nowrap; transition: all 0.2s; font-family: inherit;
}
.nav-logout:hover { color: #8B1A1A; border-color: #8B1A1A; }
.mobile-menu-btn {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.mobile-menu-btn span {
  display: block; width: 24px; height: 2px; background: #333;
  border-radius: 2px; transition: all 0.3s ease;
}
.mobile-menu-btn.open span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.mobile-menu-btn.open span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.open span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

/* Mobile nav */
@media (max-width: 1023px) {
  .nav-links {
    position: fixed; top: 64px; left: 0; width: 100%;
    background: rgba(255,255,255,0.98); backdrop-filter: blur(12px);
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 0.5rem 1rem; box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    display: none; max-height: calc(100vh - 64px); overflow-y: auto;
  }
  .nav-links.open { display: flex; }
  .nav-link {
    padding: 0.75rem 1rem; font-size: 1rem; border-radius: 0.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.04);
  }
  .nav-right { display: none; }
  .nav-links.open ~ .nav-right,
  .nav-right { display: none; }
  /* Move auth + lang toggle into mobile menu */
  .nav-links.open .nav-auth,
  .nav-links.open .lang-toggle { display: flex; }
  .mobile-menu-btn { display: flex; }
}

/* ========== FORCED LANGUAGE MODE ========== */
/* In hardcoded HTML: .lang-primary = Chinese, .lang-secondary = English */
/* On English pages: hide Chinese (.lang-primary), show English (.lang-secondary) */
html[data-force-lang="en"] .lang-primary { display: none !important; }
/* On Chinese pages: hide English (.lang-secondary), show Chinese (.lang-primary) */
html[data-force-lang="zh"] .lang-secondary { display: none !important; }
/* Override: forced-mode secondary should be full-size since it's the only one shown */
html[data-force-lang="en"] .lang-secondary { font-size: inherit !important; font-weight: inherit !important; opacity: 1 !important; font-style: normal !important; }
html[data-force-lang="zh"] .lang-primary { font-size: inherit !important; font-weight: inherit !important; opacity: 1 !important; font-style: normal !important; }

/* ========== COURSE CARDS & VIDEO MODAL ========== */
.course-card {
  transition: all 0.3s ease; border-radius: 12px; overflow: hidden;
  background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.course-card:hover { transform: translateY(-4px); box-shadow: 0 12px 24px rgba(0,0,0,0.1); }
.course-thumb {
  position: relative; width: 100%; height: 180px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.course-thumb.locked { filter: blur(8px); }
.course-thumb .lock-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: rgba(0,0,0,0.45); z-index: 2; color: #fff; font-size: 2rem;
}
.course-thumb .lock-overlay span { font-size: 0.875rem; margin-top: 4px; }
.course-thumb .completed-badge {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  background: #22C55E; color: #fff; font-size: 0.75rem;
  padding: 2px 8px; border-radius: 9999px; font-weight: 600;
}
.category-tab {
  transition: all 0.2s; cursor: pointer; padding: 0.5rem 1.25rem;
  border-radius: 9999px; border: 1px solid #ddd;
  font-size: 0.875rem; font-weight: 500; white-space: nowrap;
}
.category-tab.active { background: #C8963E; color: #fff; border-color: #C8963E; }
.category-tab:not(.active):hover { background: rgba(200,150,62,0.1); border-color: #C8963E; }
.video-modal {
  animation: fadeIn 0.3s ease; position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.8); display: flex; align-items: center; justify-content: center;
}
.video-modal-content {
  background: #fff; border-radius: 16px; max-width: 800px; width: 90%;
  max-height: 90vh; overflow-y: auto; position: relative;
}
.video-player-area {
  width: 100%; height: 400px; display: flex; align-items: center;
  justify-content: center; border-radius: 16px 16px 0 0;
}
.video-player-area .play-icon {
  font-size: 4rem; color: #fff; cursor: pointer;
  transition: transform 0.2s; text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.video-player-area .play-icon:hover { transform: scale(1.1); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }