/* ============================================
   GoldTrading TH — main.css
   Design tokens, reset, layout, typography
   ============================================ */

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

/* ---- CSS Custom Properties ---- */
:root {
  /* Colors */
  --color-gold-primary: #D4A853;
  --color-gold-light: #F0C870;
  --color-gold-dark: #8B6914;
  --color-navy: #062A1E;
  --color-navy-mid: #0A3D2C;
  --color-navy-light: #185C42;
  --color-surface: #FFFFFF;
  --color-surface-2: #F7F9FC;
  --color-border: #E1E7F0;
  --color-text: #1A2332;
  --color-text-muted: #637082;
  --color-success: #27AE60;
  --color-danger: #E74C3C;
  --color-badge: #FFF3DC;

  /* Typography */
  --font-family: 'Sarabun', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 2rem;
  --font-size-4xl: clamp(1.8rem, 4vw, 3rem);
  --font-size-h2: clamp(1.4rem, 3vw, 2.2rem);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;
  --space-2xl: 60px;
  --space-3xl: 80px;

  /* Layout */
  --container-max: 1200px;
  --container-pad: 24px;
  --border-radius: 12px;
  --border-radius-sm: 6px;
  --border-radius-lg: 20px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10), 0 2px 6px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.15), 0 4px 12px rgba(0,0,0,0.08);
  --shadow-gold: 0 4px 24px rgba(212,168,83,0.25);

  /* Transitions */
  --transition: 0.2s ease;
  --transition-slow: 0.4s ease;
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--color-text);
  background-color: var(--color-surface-2);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Thai text needs more line height */
p, li, td, th {
  line-height: 1.8;
}

img, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-gold-primary);
  text-decoration: none;
  transition: color var(--transition);
}

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

ul, ol {
  list-style: none;
}

/* ---- Typography ---- */
h1 {
  font-size: var(--font-size-4xl);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--font-size-h2);
  font-weight: 700;
  line-height: 1.3;
}

h3 {
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.4;
}

h4 {
  font-size: 1.05rem;
  font-weight: 600;
}

/* ---- Layout ---- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

.section {
  padding: 28px 0;
}
@media (max-width: 768px) {
  .section { padding: 20px 0; }
}

.section--dark {
  background: var(--color-navy);
  color: #fff;
}

.section--navy-mid {
  background: var(--color-navy-mid);
  color: #fff;
}

.section--light {
  background: var(--color-surface);
}

.section--surface-2 {
  background: var(--color-surface-2);
}

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

.section-header h2 {
  color: var(--color-text);
  margin-bottom: var(--space-md);
}

.section-header p {
  color: var(--color-text-muted);
  font-size: var(--font-size-lg);
  max-width: 640px;
  margin: 0 auto;
}

.section--dark .section-header h2,
.section--navy-mid .section-header h2 {
  color: #fff;
}

.section--dark .section-header p,
.section--navy-mid .section-header p {
  color: rgba(255,255,255,0.7);
}

/* Grid helpers */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
}

/* ---- Scroll reveal ---- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Utility classes ---- */
.text-gold { color: var(--color-gold-primary); }
.text-gold-light { color: var(--color-gold-light); }
.text-muted { color: var(--color-text-muted); }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-center { text-align: center; }
.text-small { font-size: var(--font-size-sm); }
.font-bold { font-weight: 700; }
.font-800 { font-weight: 800; }

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

/* ---- Header / Navigation ---- */
.site-header {
  position: fixed;
  top: 38px;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: background var(--transition-slow), box-shadow var(--transition-slow);
  padding: 0;
}

.site-header.transparent {
  background: transparent;
}

.site-header.solid {
  background: var(--color-navy);
  box-shadow: 0 2px 20px rgba(0,0,0,0.4);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  padding: 0 var(--container-pad);
  max-width: var(--container-max);
  margin: 0 auto;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.site-logo img {
  width: 36px;
  height: 36px;
}

.logo-text {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
}

.logo-text span {
  color: var(--color-gold-primary);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.main-nav a {
  color: rgba(255,255,255,0.85);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition);
  white-space: nowrap;
}

.main-nav a:hover {
  color: var(--color-gold-primary);
}

/* ---- Nav Dropdown ---- */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 5px;
  color: rgba(255,255,255,0.85);
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  white-space: nowrap;
  transition: color var(--transition);
}

.nav-dropdown-trigger:hover,
.nav-dropdown.open .nav-dropdown-trigger {
  color: var(--color-gold-primary);
}

.nav-dropdown-trigger svg {
  transition: transform 0.2s;
  flex-shrink: 0;
}

.nav-dropdown.open .nav-dropdown-trigger svg {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 14px);
  left: -18px;
  background: var(--color-navy);
  border: 1px solid rgba(212,168,83,0.25);
  border-radius: 10px;
  min-width: 210px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  padding: 6px 0;
  z-index: 200;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
  display: block;
}

.nav-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  color: rgba(255,255,255,0.82);
  font-size: 0.88rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.nav-dropdown-menu a:last-child {
  border-bottom: none;
}

.nav-dropdown-menu a:hover {
  background: rgba(212,168,83,0.1);
  color: var(--color-gold-primary);
}

.nav-dropdown-menu .menu-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

@media (max-width: 1024px) {
  .nav-dropdown {
    width: 100%;
  }
  .nav-dropdown-trigger {
    font-size: 1rem;
    padding: var(--space-sm) 0;
    width: 100%;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  .nav-dropdown-menu {
    position: static;
    display: none;
    background: rgba(0,0,0,0.25);
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 4px 0 4px 16px;
    min-width: unset;
  }
  .nav-dropdown.open .nav-dropdown-menu {
    display: block;
  }
  .nav-dropdown-menu a {
    padding: 9px 0;
    font-size: 0.9rem;
    border-bottom: none;
  }
  .nav-dropdown:hover .nav-dropdown-menu {
    display: none;
  }
  .nav-dropdown.open .nav-dropdown-menu {
    display: block;
  }
}

.header-cta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: var(--space-sm);
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  transition: var(--transition);
  border-radius: 2px;
}

/* Mobile nav */
@media (max-width: 1024px) {
  .main-nav {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--color-navy);
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-lg) var(--container-pad);
    gap: var(--space-md);
    transform: translateY(-110%);
    transition: transform var(--transition-slow);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  }

  .main-nav.open {
    transform: translateY(0);
  }

  .main-nav a {
    font-size: 1rem;
    padding: var(--space-sm) 0;
    width: 100%;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }

  .nav-toggle {
    display: flex;
  }
}

@media (max-width: 768px) {
  .header-cta .btn {
    display: none;
  }
}

/* ---- Animations ---- */
@keyframes goldShimmer {
  0% { background-position: -300% center; }
  100% { background-position: 300% center; }
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(212,168,83,0.25), 0 0 40px rgba(212,168,83,0.1); }
  50% { box-shadow: 0 0 40px rgba(212,168,83,0.55), 0 0 80px rgba(212,168,83,0.25), 0 0 120px rgba(212,168,83,0.1); }
}

@keyframes floatOrb {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-18px) scale(1.04); }
}

@keyframes shimmerSweep {
  0% { left: -120%; }
  100% { left: 150%; }
}

@keyframes gradientBar {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes slideInLeft {
  from { transform: translateX(-30px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes badgePop {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

@keyframes borderGlow {
  0%, 100% { border-color: rgba(212,168,83,0.4); box-shadow: 0 0 0 0 rgba(212,168,83,0); }
  50% { border-color: rgba(240,200,112,0.9); box-shadow: 0 0 20px rgba(212,168,83,0.4); }
}

/* ---- Announcement / Hot Bar ---- */
.announce-bar {
  background: linear-gradient(90deg, #6B4F0F, #D4A853, #F0C870, #FFD700, #F0C870, #D4A853, #6B4F0F);
  background-size: 300% 100%;
  animation: gradientBar 5s ease infinite;
  color: #062A1E;
  text-align: center;
  padding: 10px 16px;
  font-size: 0.82rem;
  font-weight: 800;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1002;
  letter-spacing: 0.01em;
  overflow: hidden;
}

.announce-bar::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  animation: shimmerSweep 3s 1s infinite;
}

.announce-bar a {
  color: #062A1E;
  text-decoration: underline;
  font-weight: 800;
}

/* ---- Hero Section ---- */
.hero {
  background: linear-gradient(135deg, #021a11 0%, #062A1E 35%, #0A3D2C 65%, #021510 100%);
  padding: 158px 0 56px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23D4A853' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 1;
  z-index: 0;
}

/* Gold glow orb top-right */
.hero-orb-1 {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,168,83,0.14) 0%, rgba(212,168,83,0.04) 50%, transparent 70%);
  top: -140px;
  right: -80px;
  animation: floatOrb 7s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

/* Gold glow orb bottom-left */
.hero-orb-2 {
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,168,83,0.10) 0%, transparent 70%);
  bottom: -60px;
  left: -60px;
  animation: floatOrb 9s 2s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: var(--space-2xl);
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  background: rgba(212,168,83,0.18);
  border: 1px solid rgba(212,168,83,0.5);
  color: var(--color-gold-light);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: var(--font-size-sm);
  font-weight: 700;
  margin-bottom: var(--space-lg);
  animation: borderGlow 3s ease-in-out infinite;
  letter-spacing: 0.02em;
}

.hero h1 {
  color: #fff;
  margin-bottom: var(--space-lg);
}

.hero h1 .highlight {
  background: linear-gradient(90deg, #D4A853 0%, #F0C870 30%, #FFD700 50%, #F0C870 70%, #D4A853 100%);
  background-size: 300% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: goldShimmer 4s linear infinite;
}

.hero-sub {
  color: rgba(255,255,255,0.75);
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-xl);
  line-height: 1.8;
}

.hero-stats {
  display: flex;
  gap: var(--space-xl);
  flex-wrap: wrap;
}

.hero-stat {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: rgba(255,255,255,0.8);
  font-size: var(--font-size-sm);
}

.hero-stat .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-gold-primary);
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(212,168,83,0.8);
}

/* Live viewers indicator */
.hero-viewers {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  background: rgba(39,174,96,0.12);
  border: 1px solid rgba(39,174,96,0.3);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: var(--font-size-sm);
  color: rgba(255,255,255,0.75);
  font-weight: 600;
}

.viewers-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #27AE60;
  box-shadow: 0 0 8px rgba(39,174,96,0.8);
  animation: livePulse 1.5s ease-in-out infinite;
  flex-shrink: 0;
}

.viewers-count {
  color: #4CD97B;
  font-weight: 800;
}

/* ---- Footer ---- */
.site-footer {
  background: var(--color-navy);
  color: rgba(255,255,255,0.75);
  padding: 60px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-2xl);
  padding-bottom: var(--space-2xl);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-brand .logo-text {
  margin-bottom: var(--space-md);
}

.footer-tagline {
  font-size: var(--font-size-sm);
  line-height: 1.8;
  margin-bottom: var(--space-lg);
}

.footer-cta-btn {
  display: inline-block;
}

.footer-col h4 {
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-col a {
  display: block;
  color: rgba(255,255,255,0.65);
  font-size: var(--font-size-sm);
  padding: 4px 0;
  transition: color var(--transition);
}

.footer-col a:hover {
  color: var(--color-gold-primary);
}

.footer-bottom {
  padding: var(--space-lg) 0;
  font-size: var(--font-size-xs);
  color: rgba(255,255,255,0.5);
}

.footer-disclaimer {
  background: rgba(255,255,255,0.04);
  border-radius: var(--border-radius-sm);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  font-size: var(--font-size-xs);
  line-height: 1.8;
}

.footer-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

/* ---- Risk Warning Banner ---- */
.risk-banner {
  background: #FFF8E7;
  border-top: 3px solid var(--color-gold-primary);
  padding: var(--space-lg);
}

.risk-banner p {
  max-width: 900px;
  margin: 0 auto;
  font-size: var(--font-size-sm);
  color: var(--color-text);
  line-height: 1.8;
  text-align: center;
}

.risk-banner .risk-icon {
  font-size: 1rem;
  margin-right: 4px;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }

  .hero-right {
    max-width: 500px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
  }
}

@media (max-width: 768px) {
  .section {
    padding: 32px 0;
  }

  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 110px 0 60px;
  }

  .section-header {
    margin-bottom: var(--space-xl);
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .footer-meta {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  :root {
    --container-pad: 16px;
  }

  h1 {
    font-size: 1.7rem;
  }

  .hero-stats {
    flex-direction: column;
    gap: var(--space-sm);
  }
}
