/* CardDiwa Core CSS Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Kanit:wght@300;400;500;600;700&display=swap');

:root {
  --bg-dark: #090d16;
  --bg-card: #131a2a;
  --bg-card-hover: #1c263c;
  --bg-glass: rgba(19, 26, 42, 0.75);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(245, 158, 11, 0.3);
  
  --primary-gold: #f59e0b;
  --primary-gold-hover: #d97706;
  --gold-glow: rgba(245, 158, 11, 0.25);
  
  --accent-cyan: #06b6d4;
  --accent-cyan-glow: rgba(6, 182, 212, 0.25);
  
  --accent-emerald: #10b981;
  --accent-purple: #8b5cf6;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-sub: #cbd5e1;
  
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(245, 158, 11, 0.15);
  
  --font-family: 'Kanit', sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  
  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body, input, select, textarea, button, optgroup {
  font-family: var(--font-family);
}

/* Ensure FontAwesome pseudo-elements are never overridden by site font */
.fa, .fas, .far, .fab, .fa-solid, .fa-brands {
  font-family: "Font Awesome 6 Free" !important;
}

.fab, .fa-brands {
  font-family: "Font Awesome 6 Brands" !important;
}

.fas, .fa-solid {
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900 !important;
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(245, 158, 11, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(6, 182, 212, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.04) 0%, transparent 60%);
  background-attachment: fixed;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: var(--font-family);
  cursor: pointer;
  border: none;
  outline: none;
}

input, select, textarea {
  font-family: var(--font-family);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-main);
}

.text-gradient-gold {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-cyan {
  background: linear-gradient(135deg, #38bdf8 0%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
}

.nav-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* จอใหญ่พิเศษ (Desktop > 1024px) — ดันเมนูไปอยู่กึ่งกลางแถบ
   ให้โลโก้ทางซ้ายกับช่องว่างเปล่าทางขวากินพื้นที่เท่ากัน เมนูตรงกลางจึงอยู่กึ่งกลางพอดี */
@media (min-width: 1025px) {
  .nav-container:has(> .nav-menu) > .brand-logo {
    flex: 1;
  }

  .nav-container:has(> .nav-menu)::after {
    content: '';
    flex: 1;
  }
}



.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
}

.brand-logo i {
  font-size: 1.8rem;
  color: var(--primary-gold);
  filter: drop-shadow(0 0 8px var(--gold-glow));
}

/* โลโก้รูปภาพ (PNG พื้นหลังโปร่งใส ลายเส้นสีขาว)
   .brand-mark        = แบบแนวนอนบรรทัดเดียว ใช้บนแถบเมนู
   .brand-mark-stack  = แบบสองบรรทัดตามต้นฉบับ ใช้ใน footer ที่มีพื้นที่มากกว่า */
.brand-mark {
  height: 26px;
  width: auto;
  display: block;
  filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.2));
  transition: var(--transition-fast);
}

.brand-logo:hover .brand-mark {
  filter: drop-shadow(0 0 14px var(--gold-glow));
}

.brand-mark-stack {
  height: 56px;
}

/* จอกลางเริ่มแคบ ซ่อนป้าย GRADING ไว้ให้โลโก้มีที่หายใจ */
@media (max-width: 991px) {
  .navbar .brand-badge {
    display: none;
  }
}

@media (max-width: 576px) {
  .brand-mark {
    height: 22px;
  }

  .brand-mark-stack {
    height: 46px;
  }
}

.brand-badge {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.15);
  color: var(--primary-gold);
  border: 1px solid rgba(245, 158, 11, 0.3);
  font-weight: 500;
  letter-spacing: 0.5px;
}

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

.nav-link {
  font-size: 0.95rem;
  color: var(--text-sub);
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary-gold);
}

.nav-link.active {
  position: relative;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary-gold);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--primary-gold);
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-primary {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #000;
  font-weight: 600;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
  box-shadow: 0 4px 14px var(--gold-glow);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  font-weight: 500;
  padding: 0.65rem 1.2rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.mobile-toggle {
  display: none;
  background: transparent;
  color: var(--text-main);
  font-size: 1.5rem;
}

/* Footer */
footer {
  margin-top: auto;
  background: #060910;
  border-top: 1px solid var(--border-color);
  padding: 3rem 0 1.5rem;
}

.footer-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 2.5rem;
}

.footer-col h4 {
  color: var(--text-main);
  font-size: 1.1rem;
  margin-bottom: 1.2rem;
  position: relative;
}

.footer-col h4::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 30px;
  height: 2px;
  background: var(--primary-gold);
}

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

.footer-links li {
  margin-bottom: 0.6rem;
}

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

.footer-text-list li {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.6rem;
}

/* สถาบันที่ยังไม่เปิดให้บริการ — จางลงและมีวงเล็บ "เร็ว ๆ นี้" ต่อท้าย
   พอเปิดจริงให้ลบ class "is-soon" กับ <span class="soon-note"> ของบรรทัดนั้นออก */
.footer-text-list li.is-soon {
  opacity: 0.5;
}

.footer-text-list li.is-soon .soon-note {
  font-size: 0.78rem;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: var(--transition-fast);
}

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

/* ไอคอนในลิงก์ช่องทางติดต่อ กว้างเท่ากันทุกตัว ข้อความจะได้เรียงตรงเป็นแนวเดียว */
.footer-links a i {
  width: 1.15em;
  text-align: center;
  margin-right: 0.15rem;
}

/* ที่อยู่ร้านในฟุตเตอร์ — เป็น <li> เปล่า ไม่ใช่ลิงก์ จึงต้องจัดสไตล์ให้ตรงกับลิงก์ข้างบนเอง
   ไอคอนกว้างเท่ากับ .footer-links a i เพื่อให้ข้อความเรียงตรงเป็นแนวเดียวกัน */
.footer-links li.footer-address {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  display: flex;
  gap: 0.15rem;
}

.footer-links li.footer-address i {
  width: 1.15em;
  text-align: center;
  flex-shrink: 0;
  margin-top: 0.2em;
}

/* ลิงก์เชิงกฎหมายท้ายเว็บ (นโยบายความเป็นส่วนตัว) */
.footer-legal-link {
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.footer-legal-link:hover {
  color: var(--primary-gold);
}

.footer-bottom {
  max-width: 1240px;
  margin: 2.5rem auto 0;
  padding: 1.5rem 1.5rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Responsive utilities */
@media (max-width: 992px) {
  .footer-container {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 576px) {
  .footer-container {
    grid-template-columns: 1fr 1fr;
    gap: 2rem 1rem;
  }

  .footer-col:nth-child(1) {
    grid-column: span 2;
    order: 1;
  }

  .footer-col:nth-child(2) {
    grid-column: span 1;
    order: 2;
  }

  .footer-col:nth-child(4) {
    grid-column: span 1;
    order: 3;
  }

  .footer-col:nth-child(3) {
    grid-column: span 2;
    order: 4;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

/* Lock background scrolling when mobile/tablet overlay menu is open */
body.no-scroll {
  overflow: hidden !important;
  height: 100vh !important;
  touch-action: none;
}

@media (max-width: 1024px) {
  .nav-menu {
    display: none;
    position: fixed;
    top: 58px;
    left: 0;
    width: 100%;
    height: calc(100vh - 58px);
    background: rgba(9, 13, 22, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 2.2rem;
    padding: 3rem 1.5rem 2rem;
    border-bottom: none;
    box-shadow: var(--shadow-lg);
    z-index: 999;
    overflow-y: auto;
  }
  
  .nav-menu.active {
    display: flex;
  }

  .nav-menu .nav-link {
    font-size: 1.2rem;
    font-weight: 500;
  }

  .mobile-toggle {
    display: block;
  }
}

/* ปรับขนาดตัวอักษรและเว้นระยะห่างปุ่มเมนูบน iPad ให้ห่างกันสวยงาม */
@media (min-width: 577px) and (max-width: 1024px) {
  .nav-menu {
    gap: 3.2rem;
    padding-top: 4.2rem;
  }

  .nav-menu .nav-link {
    font-size: 1.6rem;
    font-weight: 600;
    gap: 0.75rem;
  }

  .mobile-toggle {
    font-size: 1.75rem;
  }
}
