@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700&family=Prompt:wght@400;500;600;700&display=swap');

:root {
  --primary-color: #8B5A2B;         /* น้ำตาลทองเข้ม สงบ */
  --primary-dark: #654321;
  --primary-light: #C49A45;        /* สีทองอร่าม */
  --gold-accent: #D4AF37;
  --secondary-color: #2D6A4F;       /* เขียวสงบ ร่มเย็น */
  --secondary-light: #52B788;
  --bg-warm: #FAF8F5;               /* พื้นหลังสีงาช้างนวล */
  --bg-card: #FFFFFF;
  --text-main: #2C3E50;
  --text-muted: #667085;
  --border-color: #E6E1DA;
  --success-color: #2E7D32;
  --warning-color: #ED6C02;
  --danger-color: #D32F2F;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(139, 90, 43, 0.08);
  --shadow-lg: 0 8px 24px rgba(139, 90, 43, 0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

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

body {
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-warm);
  color: var(--text-main);
  line-height: 1.65;
  font-size: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Prompt', 'Sarabun', sans-serif;
  color: var(--primary-dark);
  font-weight: 600;
  line-height: 1.3;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: var(--primary-light);
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header & Navigation */
.site-header {
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 2px solid var(--primary-light);
}

.top-bar {
  background: linear-gradient(90deg, #654321 0%, #8B5A2B 50%, #C49A45 100%);
  color: #fff;
  font-size: 13px;
  padding: 6px 0;
}

.top-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.top-bar-links a {
  color: #fff;
  margin-left: 15px;
  opacity: 0.9;
}

.top-bar-links a:hover {
  opacity: 1;
  text-decoration: underline;
}

.main-navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo img {
  height: 52px;
  width: auto;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.brand-text h1 {
  font-size: 18px;
  margin-bottom: 2px;
  color: var(--primary-dark);
}

.brand-text p {
  font-size: 12px;
  color: var(--text-muted);
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 8px;
  align-items: center;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 15px;
  color: #4A5568;
}

.nav-link:hover, .nav-link.active {
  background: rgba(196, 154, 69, 0.12);
  color: var(--primary-dark);
}

.nav-link.btn-register-nav {
  background: linear-gradient(135deg, #8B5A2B 0%, #C49A45 100%);
  color: #ffffff !important;
  font-weight: 600;
  box-shadow: 0 3px 8px rgba(139, 90, 43, 0.25);
}

.nav-link.btn-register-nav:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 12px rgba(139, 90, 43, 0.35);
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--primary-color);
  cursor: pointer;
}

/* Hero Banner */
.hero-banner {
  background: #2b1f13;
  width: 100%;
  text-align: center;
  overflow: hidden;
  box-shadow: inset 0 -4px 12px rgba(0,0,0,0.2);
}

.hero-banner img {
  width: 100%;
  max-width: 1300px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.dhamma-quote-bar {
  background: linear-gradient(135deg, #FAF4E8 0%, #F5E8D3 100%);
  border-top: 1px solid #E6D5B8;
  border-bottom: 1px solid #E6D5B8;
  padding: 16px 0;
  text-align: center;
}

.dhamma-quote-bar .pali {
  font-family: 'Prompt', sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: #B22222;
  letter-spacing: 0.5px;
}

.dhamma-quote-bar .translation {
  font-size: 16px;
  color: var(--primary-dark);
  font-weight: 500;
  margin-top: 4px;
}

/* Content Sections */
.section {
  padding: 50px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 40px;
}

.section-header h2 {
  font-size: 28px;
  position: relative;
  display: inline-block;
  padding-bottom: 12px;
}

.section-header h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 70px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
  border-radius: 2px;
}

.section-header p {
  color: var(--text-muted);
  font-size: 16px;
  margin-top: 8px;
}

/* Cards & Grid */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 25px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 30px;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  background: #fdfbf7;
}

.card-body {
  padding: 24px;
}

.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background: #fcfbfa;
}

/* Course Card Specifics */
.course-card {
  display: flex;
  flex-direction: column;
  border-top: 4px solid var(--primary-light);
}

.course-card .badge-status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

.badge-open { background: #E8F5E9; color: #2E7D32; }
.badge-closed { background: #FFEBEE; color: #C62828; }
.badge-upcoming { background: #FFF3E0; color: #EF6C00; }

.course-date-box {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 15px 0;
  padding: 12px;
  background: #FAF6ED;
  border-radius: var(--radius-sm);
  color: var(--primary-dark);
}

.course-meta {
  list-style: none;
  margin: 15px 0;
  font-size: 14px;
}

.course-meta li {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--text-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-family: 'Prompt', sans-serif;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #8B5A2B 0%, #C49A45 100%);
  color: #fff;
  box-shadow: 0 3px 8px rgba(139, 90, 43, 0.25);
}

.btn-primary:hover {
  color: #fff;
  background: linear-gradient(135deg, #7A4E24 0%, #B0883A 100%);
  box-shadow: 0 5px 12px rgba(139, 90, 43, 0.35);
}

.btn-secondary {
  background: #EAE6DF;
  color: var(--primary-dark);
}

.btn-secondary:hover {
  background: #DCD6CC;
  color: var(--primary-dark);
}

.btn-success {
  background: #2E7D32;
  color: #fff;
}

.btn-success:hover {
  background: #1B5E20;
  color: #fff;
}

.btn-block {
  width: 100%;
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--primary-dark);
  font-size: 15px;
}

.form-label .required {
  color: var(--danger-color);
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 15px;
  color: var(--text-main);
  background-color: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(196, 154, 69, 0.2);
}

.form-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.form-col-6 {
  flex: 1 1 calc(50% - 8px);
}

.form-col-4 {
  flex: 1 1 calc(33.333% - 11px);
}

.form-section-title {
  font-size: 18px;
  color: var(--primary-dark);
  border-bottom: 2px solid #EFEAE1;
  padding-bottom: 8px;
  margin: 30px 0 20px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Luang Pho Profile Section */
.profile-box {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: flex;
  flex-direction: row;
  border: 1px solid var(--border-color);
}

.profile-img-col {
  flex: 0 0 320px;
  background: #f8f6f0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.profile-img-col img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-content-col {
  padding: 35px;
  flex: 1;
}

/* Footer */
.site-footer {
  background: #2C221A;
  color: #D3CDC6;
  padding: 50px 0 20px 0;
  margin-top: auto;
  border-top: 4px solid var(--primary-light);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-col h3 {
  color: #F4E8D1;
  font-size: 18px;
  margin-bottom: 16px;
}

.footer-col p {
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 10px;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 8px;
}

.footer-links a {
  color: #B8B0A5;
  font-size: 14px;
}

.footer-links a:hover {
  color: var(--primary-light);
  padding-left: 4px;
}

.footer-bottom {
  border-top: 1px solid #3F3329;
  padding-top: 20px;
  text-align: center;
  font-size: 13px;
  color: #8C8276;
}

/* Responsive */
@media (max-width: 900px) {
  .menu-toggle {
    display: block;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    padding: 16px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-bottom: 2px solid var(--primary-light);
    gap: 4px;
  }

  .nav-menu.active {
    display: flex;
  }

  .nav-link {
    width: 100%;
    padding: 12px 16px;
  }

  .profile-box {
    flex-direction: column;
  }

  .profile-img-col {
    flex: 0 0 260px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  .form-col-6, .form-col-4 {
    flex: 1 1 100%;
  }
}

/* Print Styles */
@media print {
  .site-header, .site-footer, .btn, .no-print {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
  .receipt-card {
    box-shadow: none !important;
    border: 1px solid #333 !important;
  }
}
