/* ========================================================
   มูลนิธิอิงบุญ (Ingboon Foundation - 应汶善堂)
   Theme: ขาว-เหลืองทอง สะอาด เรียบหรู มินิมอล สไตล์ราชการร่วมสมัย
   รองรับการแสดงผล 3 ภาษา (ไทย / English / 中文) อย่างสมดุล
   ======================================================== */

@import url('https://fonts.googleapis.com/css2?family=Bai+Jamjuree:wght@400;500;600;700&family=Inter:wght@400;500;600;700&family=Noto+Sans+SC:wght@400;500;600;700&family=Prompt:wght@400;500;600;700&family=Sarabun:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  --primary-gold: #c59b27;
  --primary-gold-dark: #925f09;
  --primary-gold-light: #dfb962;
  --gold-gradient: linear-gradient(135deg, #c59b27 0%, #d8ad3b 50%, #b3851b 100%);
  --gold-subtle: #fdfaf3;
  --gold-border: #ede4d1;
  --official-dark: #1e293b;
  --official-navy: #0f172a;
  --text-muted: #64748b;
  --bg-page: #faf9f6;
  --bg-card: #ffffff;
  --shadow-subtle: 0 2px 10px rgba(0, 0, 0, 0.03);
}

/* Base Body & Smooth Transition */
body {
  font-family: 'Sarabun', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #334155;
  background-color: var(--bg-page);
  line-height: 1.8;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ภาษาจีน: ใช้อักษร Noto Sans SC ขนาด 16.5px ตัวหนังสือจะคมชัด เท่ากับภาษาไทย ไม่ดูเล็กลง */
html[lang="zh"] body, html[data-lang="zh"] body {
  font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 16.5px;
  line-height: 1.85;
  letter-spacing: 0.02em;
}

/* ภาษาอังกฤษ: ใช้ฟอนต์ Inter คมชัด อ่านง่าย มีขนาดสอดคล้องกับภาษาไทย */
html[lang="en"] body, html[data-lang="en"] body {
  font-family: 'Inter', 'Prompt', -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.75;
}

/* ภาษาไทย: ใช้ Sarabun & Prompt */
html[lang="th"] body, html[data-lang="th"] body {
  font-family: 'Sarabun', 'Prompt', sans-serif;
  font-size: 16px;
  line-height: 1.8;
}

/* Language-specific content blocks (Multilingual full-page & section support) */
html[data-lang="th"] [data-lang-block]:not([data-lang-block="th"]) { display: none !important; }
html[data-lang="en"] [data-lang-block]:not([data-lang-block="en"]) { display: none !important; }
html[data-lang="zh"] [data-lang-block]:not([data-lang-block="zh"]) { display: none !important; }
html:not([data-lang]) [data-lang-block]:not([data-lang-block="th"]) { display: none !important; }

h1, h2, h3, h4, h5, h6, .font-heading {
  font-family: 'Prompt', 'Bai Jamjuree', 'Noto Sans SC', sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
}
:where(h1, h2, h3, h4, h5, h6, .font-heading) {
  color: var(--official-navy);
}
.text-white, .text-white h1, .text-white h2, .text-white h3, .text-white h4, .text-white h5, .text-white h6 {
  color: #ffffff;
}

/* ========================================================
   ✨ Smooth Animations & Micro-interactions
   ======================================================== */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Soft gold underline */
.gold-line {
  height: 2px;
  background: var(--gold-gradient);
  border-radius: 9999px;
}

/* การ์ดแบบอ่านง่าย สบายตา มินิมอล */
.clean-card {
  background: #ffffff;
  border: 1px solid var(--gold-border);
  border-radius: 14px;
  box-shadow: var(--shadow-subtle);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.25s ease;
}

.clean-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px -6px rgba(197, 155, 39, 0.12), 0 4px 10px rgba(0, 0, 0, 0.02);
  border-color: var(--primary-gold-light);
}

/* ปุ่มเปลี่ยนภาษาแบบมินิมอล (Minimal Pill Language Switcher) */
.lang-switcher {
  display: inline-flex;
  align-items: center;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  padding: 3px;
  gap: 3px;
  flex-shrink: 0;
  white-space: nowrap;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.35rem 0.75rem;
  min-height: 32px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 500;
  color: #64748b;
  border: none;
  background: transparent;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  white-space: nowrap;
  flex-shrink: 0;
}

.lang-btn:hover {
  color: #0f172a;
  background: rgba(0, 0, 0, 0.05);
}

.lang-btn.active {
  background: #ffffff !important;
  color: #b45309 !important;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

/* Header ทางการ */
.gov-header {
  background: #ffffff;
  border-bottom: 1px solid #ebdcb7;
  transition: all 0.3s ease;
}

/* เมนูนำทาง Sticky Navigation Bar */
.gov-nav {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #ede4d1;
  transition: all 0.3s ease;
}

.gov-nav a.nav-link {
  font-family: 'Prompt', 'Noto Sans SC', sans-serif;
  color: #475569;
  font-weight: 500;
  font-size: 0.92rem;
  padding: 0.85rem 0.95rem;
  transition: color 0.2s ease;
  position: relative;
  display: inline-block;
}

.gov-nav a.nav-link:hover {
  color: var(--primary-gold-dark);
}

.gov-nav a.nav-link.active {
  color: var(--primary-gold-dark);
  font-weight: 600;
}

.gov-nav a.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2.5px;
  background: var(--primary-gold);
  border-radius: 2px 2px 0 0;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transform: translateX(-50%);
}

.gov-nav a.nav-link:hover::after {
  width: 60%;
}

.gov-nav a.nav-link.active::after {
  width: 75%;
}

/* ปุ่มสีทองหลัก */
.btn-gold {
  background: var(--gold-gradient);
  color: #ffffff !important;
  font-family: 'Prompt', 'Noto Sans SC', sans-serif;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  box-shadow: 0 3px 12px rgba(197, 155, 39, 0.22);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.btn-gold:hover {
  background: linear-gradient(135deg, #b3851b 0%, #c59b27 50%, #9e7015 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(197, 155, 39, 0.32);
}

.btn-gold:active {
  transform: translateY(0) scale(0.98);
}

/* ปุ่มขอบทอง Minimal */
.btn-gold-outline {
  border: 1.5px solid var(--primary-gold);
  color: var(--primary-gold-dark);
  background: #ffffff;
  font-family: 'Prompt', 'Noto Sans SC', sans-serif;
  font-weight: 600;
  border-radius: 10px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.btn-gold-outline:hover {
  background: var(--gold-subtle);
  border-color: var(--primary-gold-dark);
  color: #784d06;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(197, 155, 39, 0.1);
}

.btn-gold-outline:active {
  transform: translateY(0) scale(0.98);
}

/* ป้ายสถานะเรียบหรู */
.tag-gold {
  background-color: #fef8eb;
  color: #925f09;
  border: 1px solid #ebd59f;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.22rem 0.6rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* กล่องคำพุทธพจน์ เรียบสงบ */
.motto-banner {
  background: #ffffff;
  border-left: 3.5px solid var(--primary-gold);
  border-top: 1px solid #f2e9d7;
  border-right: 1px solid #f2e9d7;
  border-bottom: 1px solid #f2e9d7;
  border-radius: 0 10px 10px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

/* ปุ่มเลือกจำนวนเงิน */
.amount-btn {
  border: 1.5px solid #e5dcc7;
  background: #ffffff;
  color: #1e293b;
  font-family: 'Prompt', 'Noto Sans SC', sans-serif;
  font-weight: 600;
  padding: 0.75rem 0.5rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
}

.amount-btn:hover {
  border-color: var(--primary-gold);
  background: var(--gold-subtle);
  transform: translateY(-1px);
}

.amount-btn.active {
  border-color: var(--primary-gold-dark);
  background: var(--primary-gold);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(197, 155, 39, 0.25);
}

/* ปุ่มเลือกช่องทางชำระเงิน */
.payment-channel-btn {
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 1rem;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.payment-channel-btn:hover {
  border-color: var(--primary-gold-light);
  background: #fdfcf9;
  transform: translateY(-1px);
}

.payment-channel-btn.selected {
  border-color: var(--primary-gold);
  background: #fdfaf3;
  box-shadow: 0 0 0 3px rgba(197, 155, 39, 0.15);
}

.payment-channel-btn.selected::after {
  content: '✓';
  position: absolute;
  top: 10px;
  right: 12px;
  background: var(--primary-gold);
  color: #ffffff;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
}

/* การ์ดเลือกโครงการ / วัตถุประสงค์บริจาค (Purpose Selection Card) */
.purpose-card {
  position: relative;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  touch-action: manipulation;
}

.purpose-card:hover {
  border-color: #d97706;
  background: #fffdf9;
  transform: translateY(-1px);
}

.purpose-card.selected {
  border-color: #b45309;
  background: #fdfaf3;
  box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.12);
}

.purpose-card .purpose-check-indicator {
  transition: all 0.2s ease;
}

.purpose-card.selected .purpose-check-indicator {
  border-color: #b45309 !important;
  background-color: #b45309 !important;
  color: #ffffff !important;
}

.purpose-card:not(.selected) .purpose-check-indicator {
  border-color: #cbd5e1 !important;
  background-color: #ffffff !important;
  color: transparent !important;
}

/* ========================================================
   📱 Dedicated Mobile App UI Mode
   ======================================================== */

body.mobile-app-ui {
  padding-bottom: 4.5rem;
}

body.mobile-app-ui .gov-header {
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}

body.mobile-app-ui .gov-nav {
  display: none !important;
}

body.mobile-app-ui section {
  padding-top: 2rem !important;
  padding-bottom: 2rem !important;
}

body.mobile-app-ui h1 {
  font-size: 1.6rem !important;
  line-height: 1.35 !important;
}

body.mobile-app-ui h2 {
  font-size: 1.3rem !important;
  line-height: 1.35 !important;
}

body.mobile-app-ui .clean-card {
  padding: 1.25rem !important;
  border-radius: 12px;
}

.mobile-nav-item {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.mobile-nav-item:active {
  transform: scale(0.92);
}

/* Footer ทางการ สไตล์สะอาด */
.gov-footer {
  background: #1e293b;
  color: #cbd5e1;
  border-top: 2px solid var(--primary-gold);
}

.gov-footer h4 {
  color: #f1ebd8;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

/* ========================================================
   💳 Donation Channel Tabs & Cards Styling
   ======================================================== */
.donation-tab-btn {
  background: transparent;
  color: #64748b;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.22s ease-in-out;
}
.donation-tab-btn:hover {
  color: #1e293b;
  background: rgba(255, 255, 255, 0.7);
}
.donation-tab-btn.active {
  background: #ffffff;
  color: #78350f;
  border-color: #f59e0b;
  box-shadow: 0 4px 14px -2px rgba(217, 119, 6, 0.18);
}

