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

/* CSS variables for Dark theme (default) and Light theme */
:root {
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-tertiary: #1f2937;
  --bg-glass: rgba(17, 24, 39, 0.75);
  --border-color: rgba(255, 255, 255, 0.06);
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --accent-primary: #6366f1; /* Indigo */
  --accent-secondary: #0d9488; /* Teal */
  --accent-violet: #8b5cf6; /* Violet */
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #0d9488 100%);
  --accent-glow: rgba(99, 102, 241, 0.15);
  
  --card-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
  --font-sans: 'Inter', sans-serif;
  --font-display: 'Outfit', sans-serif;
  --nav-height: 80px;
}

body.light-theme {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.8);
  --border-color: rgba(15, 23, 42, 0.08);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent-glow: rgba(99, 102, 241, 0.08);
  --card-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.08);
}

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

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
}

a {
  color: inherit;
  text-decoration: none;
  transition: all 0.2s ease;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 5px;
  border: 2px solid var(--bg-primary);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: 8rem 0 4rem;
}

.text-gradient {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Premium Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 2rem;
  font-family: var(--font-display);
  font-weight: 600;
  border-radius: 12px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  gap: 0.75rem;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--bg-glass);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

.btn-icon img {
  width: 20px;
  height: 20px;
}

/* Navigation Bar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  background-color: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  transition: background-color 0.3s, border-color 0.3s;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
}

.brand-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: var(--accent-gradient);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

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

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
}

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

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Language Toggle Button */
.lang-toggle-btn {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.5rem 0.85rem;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.3s;
}

.lang-toggle-btn:hover {
  border-color: var(--accent-primary);
  background-color: var(--bg-tertiary);
}

/* Theme Toggle Button */
.theme-toggle-btn {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.theme-toggle-btn:hover {
  border-color: var(--accent-primary);
  background-color: var(--bg-tertiary);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Hero Section */
.hero {
  position: relative;
  padding: 10rem 0 6rem;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 4rem;
  align-items: center;
}

.hero-title {
  font-size: 4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
  line-height: 1.15;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  max-width: 550px;
}

.hero-buttons {
  display: flex;
  gap: 1.5rem;
}

.hero-mockup {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.mockup-wrapper {
  position: relative;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1200 / 2510;
  background: #000;
  border: 10px solid #1e293b;
  border-radius: 40px;
  box-shadow: var(--card-shadow), 0 0 0 1px rgba(255,255,255,0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.mockup-screen {
  position: relative;
  flex: 1;
  background-color: #0b0f19;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  font-size: 0.8rem;
  font-family: var(--font-sans);
  overflow: hidden;
}

.mockup-header {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.75rem;
}

.mockup-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
  padding: 1rem 0;
}

.mockup-book-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  color: #fff;
}

.mockup-paragraph {
  color: #94a3b8;
  font-size: 0.75rem;
  line-height: 1.5;
  text-align: justify;
}

.mockup-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 0.5rem;
  font-size: 0.7rem;
  color: #64748b;
}

.mockup-glow {
  position: absolute;
  width: 120%;
  height: 120%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, transparent 60%);
  z-index: -1;
  pointer-events: none;
}

/* Feature Cards Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2.5rem;
  margin-top: 4rem;
}

.feature-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 3rem 2.5rem;
  border-radius: 24px;
  box-shadow: var(--card-shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, var(--accent-glow) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-primary);
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-icon {
  width: 56px;
  height: 56px;
  background: var(--bg-tertiary);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--accent-primary);
  margin-bottom: 2rem;
  border: 1px solid var(--border-color);
  position: relative;
  z-index: 1;
}

.feature-card h3 {
  font-size: 1.35rem;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  position: relative;
  z-index: 1;
}

/* Sections Styling */
.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 4rem;
}

.section-tag {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-primary);
  margin-bottom: 1rem;
  display: block;
}

.section-title {
  font-size: 2.75rem;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
}

/* Accordion FAQ */
.faq-list {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.faq-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color 0.3s;
}

.faq-question {
  width: 100%;
  padding: 1.5rem 2rem;
  background: none;
  border: none;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out, padding 0.3s ease-out;
  padding: 0 2rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  border-top: 1px solid transparent;
}

.faq-item.active {
  border-color: var(--accent-primary);
}

.faq-item.active .faq-answer {
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border-color);
}

.faq-icon {
  transition: transform 0.3s;
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
}

/* Blog Styles */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2.5rem;
}

.blog-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
}

.blog-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-primary);
}

.blog-img {
  width: 100%;
  height: 200px;
  background: var(--accent-gradient);
  opacity: 0.8;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
}

.blog-content {
  padding: 2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  display: flex;
  gap: 1rem;
}

.blog-title {
  font-size: 1.35rem;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.blog-excerpt {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  flex: 1;
}

.blog-readmore {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--accent-primary);
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.blog-readmore:hover {
  gap: 0.75rem;
}

/* Post view styling */
.post-layout {
  max-width: 800px;
  margin: 10rem auto 4rem;
  padding: 0 2rem;
}

.post-header {
  margin-bottom: 3rem;
  text-align: center;
}

.post-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

.post-title {
  font-size: 3rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 1.5rem;
}

.post-hero-image {
  width: 100%;
  height: 400px;
  background: var(--accent-gradient);
  border-radius: 24px;
  margin-bottom: 3rem;
  opacity: 0.9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
}

.post-body {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.post-body p {
  margin-bottom: 1.5rem;
}

.post-body h2 {
  font-size: 1.75rem;
  margin: 2.5rem 0 1.25rem;
  color: var(--text-primary);
}

.post-body ul, .post-body ol {
  margin-bottom: 1.5rem;
  padding-left: 2rem;
}

.post-body li {
  margin-bottom: 0.5rem;
}

/* Support Form */
.support-wrapper {
  max-width: 650px;
  margin: 0 auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 3.5rem 3rem;
  box-shadow: var(--card-shadow);
}

.form-group {
  margin-bottom: 1.75rem;
}

.form-label {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.form-control {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  padding: 1rem 1.25rem;
  border-radius: 12px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1rem;
  transition: all 0.3s;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-primary);
  background-color: var(--bg-secondary);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

textarea.form-control {
  min-height: 150px;
  resize: vertical;
}

/* Static Docs (Privacy / Terms) Page Styling */
.doc-layout {
  max-width: 900px;
  margin: 10rem auto 4rem;
  padding: 0 2rem;
}

.doc-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 2rem;
  margin-bottom: 3rem;
}

.doc-title {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.doc-date {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.doc-content {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.75;
}

.doc-content h2 {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin: 2.5rem 0 1rem;
}

.doc-content h3 {
  font-size: 1.2rem;
  color: var(--text-primary);
  margin: 1.75rem 0 0.75rem;
}

.doc-content p {
  margin-bottom: 1.25rem;
}

.doc-content ul {
  margin-bottom: 1.25rem;
  padding-left: 2rem;
}

.doc-content li {
  margin-bottom: 0.5rem;
}

/* Footer */
.footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 5rem 0 3rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(2, 1fr);
  gap: 4rem;
  margin-bottom: 4rem;
}

.footer-logo {
  margin-bottom: 1.5rem;
}

.footer-desc {
  max-width: 280px;
  font-size: 0.85rem;
  line-height: 1.6;
}

.footer-heading {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-link {
  font-size: 0.9rem;
}

.footer-link:hover {
  color: var(--accent-primary);
  padding-left: 4px;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Download Page Specifics */
.download-hero {
  text-align: center;
  padding: 10rem 0 6rem;
}

.download-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  max-width: 900px;
  margin: 3rem auto 0;
}

.download-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 3rem 2rem;
  text-align: center;
  box-shadow: var(--card-shadow);
  transition: all 0.3s ease;
}

.download-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-5px);
}

.download-card-icon {
  font-size: 3rem;
  margin-bottom: 1.5rem;
}

.download-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.download-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }

/* Responsive Design */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
  }
  
  .hero-subtitle {
    margin-left: auto;
    margin-right: auto;
  }
  
  .hero-buttons {
    justify-content: center;
  }
  
  .hero-title {
    font-size: 3.25rem;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none; /* Can be toggled active via JS */
  }
  
  .nav-links.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    width: 100%;
    background-color: var(--bg-secondary);
    padding: 2rem;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
  }
  
  .mobile-menu-btn {
    display: block;
  }
  
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }
  
  .section-title {
    font-size: 2.25rem;
  }
  
  .post-title {
    font-size: 2.25rem;
  }
}

@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .hero-buttons {
    flex-direction: column;
  }
}

/* Multi-language display styling */
.lang-th {
  display: none;
}
