/* 🌗 Theme: Dark Only */
:root {
  --bg: #ffffff;
  --text: #000000;
  --primary: #0077cc;
  --link-hover: #005fa3;
  --border: #ddd;
  --box: #f9f9f9;
}
.dark {
  --bg: #121212;
  --text: #f0f0f0;
  --primary: #1e90ff;
  --link-hover: #66bfff;
  --border: #333;
  --box: #1f1f1f;
}

/* 🔤 Global */
html, body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  transition: background-color 0.3s, color 0.3s;
}
a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}
h1, h2, h3 {
  color: var(--text);
}
ul {
  padding-left: 1.2rem;
}
code {
  background: var(--box);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
}

/* 🧱 Layout */
.container {
  max-width: 960px;
  margin: auto;
  padding: 2rem 1rem;
}

/* 🌐 Navbar */
nav.navbar {
  position: sticky;
  top: 0;
  z-index: 999;
  background-color: rgba(18, 18, 18, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 0.8rem 1rem;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}
.navbar-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  max-width: 1080px;
  margin: 0 auto;
}
.logo {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.nav-links {
  list-style: none;
  display: flex;
  gap: 1rem;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
  align-items: center;
}
.nav-links li {
  display: flex;
  align-items: center;
}
.nav-links a, .lang-toggle {
  color: var(--text);
  background: none;
  border: none;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0.4rem 0.6rem;
}
.nav-links a:hover, .lang-toggle:hover {
  color: var(--primary);
}
.menu-toggle {
  display: none;
  font-size: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
}
@media (max-width: 768px) {
  .nav-links {
    flex-direction: column;
    display: none;
    width: 100%;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    margin-top: 1rem;
  }
  .nav-links.active {
    display: flex;
  }
  .menu-toggle {
    display: block;
  }
}

/* 🦶 Footer */
.footer {
  background-color: var(--bg);
  color: var(--text);
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}
.footer a {
  color: var(--text);
  text-decoration: none;
}
.footer a:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* 🧰 Hero Section */
.blog-hero {
  text-align: center;
  padding: 4rem 1.5rem 2.5rem;
  background-color: var(--box);
  border-bottom: 1px solid var(--border);
}
.blog-hero h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.blog-hero p {
  font-size: 1rem;
  opacity: 0.85;
}

/* 📚 Blog List */
.blog-list {
  padding: 2rem 1.5rem;
}
.blog-card {
  background: var(--box);
  border: 1px solid var(--border);
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
  transition: transform 0.2s, box-shadow 0.2s;
}
.blog-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.blog-card h2 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}
.blog-card p {
  font-size: 0.95rem;
  line-height: 1.6;
  opacity: 0.9;
}

/* 📄 Blog Post */
.blog-post {
  max-width: 760px;
  margin: auto;
  padding: 2rem 1rem;
  line-height: 1.7;
}
.blog-post h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.blog-post h2 {
  font-size: 1.3rem;
  margin-top: 2rem;
}
.blog-post .text-muted {
  font-size: 0.9rem;
  opacity: 0.6;
  margin-bottom: 1rem;
}
.features-list li {
  margin-bottom: 0.6rem;
  line-height: 1.6;
}

/* 🔙 Back Button */
.back-to-blog {
  text-align: center;
  margin: 2rem auto 3rem;
}
.btn-back {
  display: inline-block;
  background-color: var(--primary);
  color: white;
  padding: 0.6rem 1.4rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.95rem;
  transition: background-color 0.2s;
}
.btn-back:hover {
  background-color: var(--link-hover);
}

/* 📊 ตาราง */
.table-wrapper {
  margin-top: 2rem;
  overflow-x: auto;
}
.table-wrapper table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg);
}
.table-wrapper th, .table-wrapper td {
  border: 1px solid var(--border);
  padding: 0.75rem;
  text-align: center;
}
.table-wrapper th {
  background: rgba(255,255,255,0.05);
  font-weight: bold;
}
.tab-buttons {
  display: flex;
  gap: 1rem;
  margin: 1.5rem 0;
}
.tab-btn {
  padding: 0.5rem 1.2rem;
  border: 1px solid var(--border);
  background: var(--box);
  color: var(--text);
  cursor: pointer;
  border-radius: 8px;
  transition: 0.2s;
}
.tab-btn.active {
  background: var(--primary);
  color: #fff;
}
.tab-content {
  margin-top: 1rem;
}
.category-buttons {
  margin: 2rem 0 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}
.cat-btn {
  padding: 0.5rem 1.2rem;
  background: var(--box);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: 0.2s;
}
.cat-btn.active {
  background: var(--primary);
  color: #fff;
}

/* 📱 Responsive */
@media (max-width: 768px) {
  .blog-hero {
    padding: 3rem 1rem 2rem;
  }
  .blog-hero h1 {
    font-size: 1.6rem;
  }
  .blog-card {
    padding: 1.2rem;
  }
  .blog-card h2 {
    font-size: 1.2rem;
  }
  .blog-post h1 {
    font-size: 1.6rem;
  }
  .blog-post h2 {
    font-size: 1.2rem;
  }
}
