/* ===== CSS Variables (iTemSpot Color Scheme) ===== */
:root {
  --accent: #0D9488;
  --brand-primary: #0D9488;
  --primary-light: #14B8A6;
  --primary-dark: #0F766E;
  --primary-muted: #99F6E4;
  --bg-primary: #FFFFFF;
  --bg-secondary: #F9FAFB;
  --surface-card: #FFFFFF;
  --text-primary: #111827;
  --text-secondary: #6B7280;
  --text-tertiary: #9CA3AF;
  --gradient-start: #0D9488;
  --gradient-end: #14B8A6;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 50px rgba(0,0,0,0.15);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
}

[data-theme="dark"] {
  --accent: #14B8A6;
  --brand-primary: #14B8A6;
  --primary-light: #14B8A6;
  --primary-dark: #0F766E;
  --primary-muted: #99F6E4;
  --bg-primary: #111827;
  --bg-secondary: #1F2937;
  --surface-card: #1F2937;
  --text-primary: #FFFFFF;
  --text-secondary: #9CA3AF;
  --text-tertiary: #6B7280;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.35);
  --shadow-xl: 0 20px 50px rgba(0,0,0,0.4);
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.8;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.85; }

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

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ===== Navigation ===== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  transition: background 0.3s, box-shadow 0.3s;
}

[data-theme="dark"] .navbar {
  background: rgba(17,24,39,0.85);
  border-bottom-color: rgba(255,255,255,0.06);
}

.navbar.scrolled { box-shadow: var(--shadow-md); }

.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1200px; margin: 0 auto; padding: 0 24px; height: 64px;
}

.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.25rem; font-weight: 700; color: var(--text-primary);
}

.nav-logo img { width: 36px; height: 36px; border-radius: 8px; }

.nav-links { display: flex; align-items: center; gap: 28px; list-style: none; }
.nav-links a { color: var(--text-secondary); font-size: 0.9rem; font-weight: 500; transition: color 0.2s; }
.nav-links a:hover { color: var(--accent); opacity: 1; }

.lang-toggle {
  display: flex; align-items: center; gap: 4px;
  background: var(--bg-secondary); border-radius: 20px; padding: 3px;
}

.lang-btn {
  border: none; background: transparent; padding: 6px 14px;
  border-radius: 18px; font-size: 0.8rem; font-weight: 600;
  cursor: pointer; color: var(--text-secondary); transition: all 0.2s;
}
.lang-btn.active { background: var(--accent); color: #fff; }

.mobile-menu-btn {
  display: none; background: none; border: none; cursor: pointer;
  width: 40px; height: 40px; align-items: center; justify-content: center;
}
.mobile-menu-btn span {
  display: block; width: 22px; height: 2px; background: var(--text-primary);
  transition: all 0.3s; position: relative;
}
.mobile-menu-btn span::before, .mobile-menu-btn span::after {
  content: ''; position: absolute; width: 22px; height: 2px;
  background: var(--text-primary); transition: all 0.3s;
}
.mobile-menu-btn span::before { top: -7px; }
.mobile-menu-btn span::after { top: 7px; }

/* ===== Hero Section ===== */
.hero {
  padding: 140px 0 80px;
  background: linear-gradient(180deg, rgba(13,148,136,0.04) 0%, transparent 60%);
  text-align: center; position: relative; overflow: hidden;
}

.hero::before {
  content: ''; position: absolute; top: -200px; left: 50%; transform: translateX(-50%);
  width: 800px; height: 800px; border-radius: 50%;
  background: radial-gradient(circle, rgba(20,184,166,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(13,148,136,0.1); color: var(--accent);
  padding: 8px 18px; border-radius: 50px; font-size: 0.85rem; font-weight: 600;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem); font-weight: 800;
  line-height: 1.3; margin-bottom: 20px;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-dark) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1.05rem, 2.5vw, 1.25rem); color: var(--text-secondary);
  max-width: 600px; margin: 0 auto 40px; line-height: 1.9;
}

.hero-cta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 60px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 32px; border-radius: 50px; font-size: 1rem; font-weight: 600;
  border: none; cursor: pointer; transition: all 0.3s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: #fff; box-shadow: 0 4px 15px rgba(13,148,136,0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(13,148,136,0.4); color: #fff; }

.btn-secondary {
  background: var(--bg-secondary); color: var(--text-primary);
  border: 1px solid rgba(0,0,0,0.08);
}
.btn-secondary:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

[data-theme="dark"] .btn-secondary { border-color: rgba(255,255,255,0.1); }

/* ===== Hero Devices Layout ===== */
.hero-devices {
  position: relative;
  max-width: 780px;
  margin: 0 auto;
  aspect-ratio: 1.45 / 1;
}

.device img {
  width: 100%;
  height: auto;
  display: block;
}

.device {
  position: absolute;
  filter: drop-shadow(0 12px 30px rgba(0,0,0,0.2));
}

.device-ipad {
  width: 75%;
  left: 0;
  bottom: 0;
  z-index: 1;
}

.device-iphone {
  width: 17%;
  right: 12%;
  bottom: 0;
  z-index: 3;
}

.device-watch {
  width: 12%;
  left: 56%;
  bottom: 0;
  z-index: 2;
}

/* ===== Features Section ===== */
.features { padding: 100px 0; background: var(--bg-secondary); }

.section-header { text-align: center; margin-bottom: 60px; }
.section-label {
  display: inline-block; color: var(--accent); font-size: 0.85rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 12px;
}
.section-title { font-size: clamp(1.8rem, 4vw, 2.5rem); font-weight: 800; margin-bottom: 16px; }
.section-subtitle { color: var(--text-secondary); font-size: 1.05rem; max-width: 550px; margin: 0 auto; }

.features-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--surface-card); border-radius: var(--radius-lg); padding: 36px;
  border: 1px solid rgba(0,0,0,0.04); transition: all 0.3s;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

[data-theme="dark"] .feature-card { border-color: rgba(255,255,255,0.06); }

.feature-icon {
  width: 56px; height: 56px; border-radius: 16px;
  background: rgba(13,148,136,0.1); display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; margin-bottom: 20px;
}
.feature-icon-img { width: 32px; height: 32px; object-fit: contain; }

.feature-card h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 10px; }
.feature-card p { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.8; }

/* ===== How It Works ===== */
.how-it-works { padding: 100px 0; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 40px; counter-reset: step; }

.step { text-align: center; position: relative; }
.step::before {
  counter-increment: step; content: counter(step);
  display: flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: #fff; font-size: 1.1rem; font-weight: 800;
  margin: 0 auto 20px;
}

.step-icon { font-size: 2.5rem; margin-bottom: 16px; }
.step h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.step p { color: var(--text-secondary); font-size: 0.9rem; }

/* ===== Platforms ===== */
.platforms { padding: 100px 0; background: var(--bg-secondary); }

.platforms-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 24px; }

.platform-card {
  background: var(--surface-card); border-radius: var(--radius-lg); padding: 32px;
  text-align: center; border: 1px solid rgba(0,0,0,0.04); transition: all 0.3s;
}
.platform-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

[data-theme="dark"] .platform-card { border-color: rgba(255,255,255,0.06); }

.platform-icon { font-size: 2.5rem; margin-bottom: 16px; display: flex; justify-content: center; }
.platform-icon-img { width: 56px; height: 56px; object-fit: contain; }
.platform-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.platform-card p { color: var(--text-secondary); font-size: 0.9rem; }

/* ===== Privacy & Security Section ===== */
.privacy-security { padding: 100px 0; }

.security-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.security-card {
  background: var(--surface-card); border-radius: var(--radius-lg); padding: 36px;
  border: 1px solid rgba(0,0,0,0.04); transition: all 0.3s; text-align: center;
}
.security-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

[data-theme="dark"] .security-card { border-color: rgba(255,255,255,0.06); }

.security-icon { font-size: 2.5rem; margin-bottom: 16px; }
.security-card h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 10px; }
.security-card p { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.8; }

/* ===== CTA Section ===== */
.cta-section {
  padding: 100px 0; text-align: center;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--accent) 50%, var(--primary-light) 100%);
  color: #fff; position: relative; overflow: hidden;
}
.cta-section::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='%23ffffff' 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");
}
.cta-section h2 { font-size: clamp(1.8rem, 4vw, 2.5rem); font-weight: 800; margin-bottom: 16px; position: relative; }
.cta-section p { font-size: 1.1rem; opacity: 0.9; margin-bottom: 36px; max-width: 500px; margin-left: auto; margin-right: auto; position: relative; }
.cta-section .btn-primary { background: #fff; color: var(--primary-dark); box-shadow: 0 4px 15px rgba(0,0,0,0.2); position: relative; }
.cta-section .btn-primary:hover { box-shadow: 0 6px 25px rgba(0,0,0,0.3); }

/* ===== Footer ===== */
.footer {
  padding: 60px 0 30px; background: var(--bg-secondary);
  border-top: 1px solid rgba(0,0,0,0.06);
}

[data-theme="dark"] .footer { border-top-color: rgba(255,255,255,0.06); }

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

.footer-brand p { color: var(--text-secondary); font-size: 0.9rem; margin-top: 12px; max-width: 280px; }

.footer-col h4 { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 16px; color: var(--text-tertiary); }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: var(--text-secondary); font-size: 0.9rem; }
.footer-col a:hover { color: var(--accent); }

.footer-bottom {
  border-top: 1px solid rgba(0,0,0,0.06); padding-top: 24px;
  display: flex; justify-content: space-between; align-items: center;
  color: var(--text-tertiary); font-size: 0.8rem;
}

[data-theme="dark"] .footer-bottom { border-top-color: rgba(255,255,255,0.06); }

/* ===== Docs Pages (Support & Privacy) ===== */
.docs-page { padding: 120px 0 80px; }

.docs-content {
  max-width: 800px; margin: 0 auto;
  background: var(--surface-card); border-radius: var(--radius-lg);
  padding: 48px; border: 1px solid rgba(0,0,0,0.04);
}

[data-theme="dark"] .docs-content { border-color: rgba(255,255,255,0.06); }

.docs-content h1 { font-size: 2rem; font-weight: 800; margin-bottom: 8px; }
.docs-content .docs-updated { color: var(--text-tertiary); font-size: 0.85rem; margin-bottom: 32px; }
.docs-content h2 { font-size: 1.3rem; font-weight: 700; margin-top: 36px; margin-bottom: 12px; color: var(--accent); }
.docs-content h3 { font-size: 1.1rem; font-weight: 600; margin-top: 24px; margin-bottom: 8px; }
.docs-content p { color: var(--text-secondary); margin-bottom: 16px; line-height: 1.9; }
.docs-content ul, .docs-content ol { color: var(--text-secondary); margin-bottom: 16px; padding-left: 24px; }
.docs-content li { margin-bottom: 8px; line-height: 1.8; }
.docs-content a { color: var(--accent); text-decoration: underline; }

.contact-card {
  background: rgba(13,148,136,0.06); border-radius: var(--radius-md);
  padding: 24px; margin-top: 24px;
}
.contact-card h3 { margin-top: 0; }

/* ===== Animations ===== */
.fade-in {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .mobile-menu-btn { display: flex; }

  .nav-links.open {
    display: flex; flex-direction: column; position: absolute;
    top: 64px; left: 0; right: 0; background: var(--bg-primary);
    padding: 20px 24px; gap: 16px; border-bottom: 1px solid rgba(0,0,0,0.06);
    box-shadow: var(--shadow-lg);
  }

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

  .footer-inner { grid-template-columns: 1fr; gap: 30px; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }

  .docs-content { padding: 28px 20px; }

  .features-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero-devices { max-width: 320px; }
}

/* ===== App Store Badge ===== */
.app-store-badge {
  height: 54px; transition: transform 0.2s;
}
.app-store-badge:hover { transform: scale(1.05); }

/* ===== Scroll to top ===== */
.scroll-top {
  position: fixed; bottom: 24px; right: 24px; z-index: 999;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent); color: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; box-shadow: var(--shadow-md);
  opacity: 0; transform: translateY(10px); transition: all 0.3s; pointer-events: none;
}
.scroll-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }

/* ===== Theme Toggle ===== */
.theme-toggle {
  background: var(--bg-secondary); border: 1px solid rgba(0,0,0,0.06);
  border-radius: 50px; padding: 4px; cursor: pointer;
  display: flex; align-items: center; gap: 2px;
  transition: all 0.3s;
}
[data-theme="dark"] .theme-toggle { border-color: rgba(255,255,255,0.1); }

.theme-toggle-option {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  font-size: 0.95rem; transition: all 0.3s; background: transparent;
}
.theme-toggle-option.active {
  background: var(--accent); box-shadow: 0 2px 8px rgba(13,148,136,0.3);
}

/* ===== Thai Language Support ===== */
html[lang="th"] body { line-height: 2; }
html[lang="th"] .hero h1 { line-height: 1.5; }
html[lang="th"] .hero-subtitle { line-height: 2.1; }
html[lang="th"] .hero-badge { padding: 10px 18px; }
html[lang="th"] .feature-card p,
html[lang="th"] .platform-card p,
html[lang="th"] .step p { line-height: 2; }
html[lang="th"] .section-title { line-height: 1.5; }
html[lang="th"] .section-subtitle { line-height: 2; }
html[lang="th"] .docs-content p { line-height: 2.1; }
html[lang="th"] .docs-content li { line-height: 2; }
html[lang="th"] .docs-content h1,
html[lang="th"] .docs-content h2,
html[lang="th"] .docs-content h3 { line-height: 1.5; }
html[lang="th"] .nav-links a { line-height: 1.8; }
html[lang="th"] .btn { padding: 16px 32px; line-height: 1.8; }
html[lang="th"] .cta-section p { line-height: 2; }
html[lang="th"] .footer-brand p { line-height: 2; }
