/* WAW.asia — Vietnamese Tech Review */
:root {
  --c-bg: #ffffff;
  --c-surface: #f7f8fa;
  --c-surface-alt: #eef0f4;
  --c-border: #dde1e8;
  --c-text: #1a1d23;
  --c-text-muted: #5f6672;
  --c-primary: #1e56e0;
  --c-primary-hover: #1745b8;
  --c-primary-light: #eef2ff;
  --c-accent: #e63946;
  --c-accent-light: #fff0f1;
  --c-green: #0a8a50;
  --c-green-light: #ecfdf5;
  --font-body: 'Noto Sans', 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Inter', 'Noto Sans', system-ui, -apple-system, sans-serif;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.1);
  --radius: 8px;
  --radius-lg: 12px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --c-bg: #0f1117;
    --c-surface: #1a1d27;
    --c-surface-alt: #242834;
    --c-border: #2e3340;
    --c-text: #e8eaf0;
    --c-text-muted: #9ba3b2;
    --c-primary: #5b8def;
    --c-primary-hover: #7ba3ff;
    --c-primary-light: #1a2544;
    --c-accent: #ff6b7a;
    --c-accent-light: #2a1520;
    --c-green: #34d399;
    --c-green-light: #0d2e20;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.4);
  }
}

:root[data-theme="dark"] {
  --c-bg: #0f1117;
  --c-surface: #1a1d27;
  --c-surface-alt: #242834;
  --c-border: #2e3340;
  --c-text: #e8eaf0;
  --c-text-muted: #9ba3b2;
  --c-primary: #5b8def;
  --c-primary-hover: #7ba3ff;
  --c-primary-light: #1a2544;
  --c-accent: #ff6b7a;
  --c-accent-light: #2a1520;
  --c-green: #34d399;
  --c-green-light: #0d2e20;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.4);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--c-primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--c-primary-hover); }

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

/* Header */
.site-header {
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .container {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 60px;
}
.logo {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  color: var(--c-text);
  letter-spacing: -0.5px;
}
.logo span { color: var(--c-primary); }
.logo:hover { color: var(--c-text); }
.main-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.main-nav a {
  color: var(--c-text-muted);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.2s;
}
.main-nav a:hover,
.main-nav a.active {
  color: var(--c-primary);
  background: var(--c-primary-light);
}
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 18px;
  color: var(--c-text);
  cursor: pointer;
  margin-left: auto;
}

/* Breadcrumb */
.breadcrumb {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  padding-block: 10px;
  font-size: 13px;
  color: var(--c-text-muted);
}
.breadcrumb a { color: var(--c-text-muted); }
.breadcrumb a:hover { color: var(--c-primary); }

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--c-primary), #4338ca);
  color: #fff;
  padding-block: 56px 48px;
  text-align: center;
}
.hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}
.hero-sub {
  font-size: 17px;
  opacity: 0.9;
  max-width: 560px;
  margin: 0 auto 32px;
}
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
}
.stat strong {
  display: block;
  font-size: 32px;
  font-weight: 700;
}
.stat span {
  font-size: 14px;
  opacity: 0.8;
}

/* Categories */
.categories-section,
.popular-section,
.recent-section,
.seo-section {
  padding-block: 48px;
}
.categories-section h2,
.popular-section h2,
.recent-section h2,
.seo-section h2 {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 24px;
  letter-spacing: -0.3px;
}
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 12px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  transition: all 0.2s;
  text-align: center;
}
.cat-card:hover {
  border-color: var(--c-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  color: var(--c-text);
}
.cat-icon { font-size: 28px; }
.cat-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--c-text);
}
.cat-count {
  font-size: 12px;
  color: var(--c-text-muted);
}

/* Product cards */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.product-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  transition: all 0.2s;
  color: var(--c-text);
}
.product-card:hover {
  border-color: var(--c-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  color: var(--c-text);
}
.product-card h3 {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.4;
}
.product-card p {
  font-size: 14px;
  color: var(--c-text-muted);
  line-height: 1.5;
  flex: 1;
}
.card-badge {
  font-size: 12px;
  color: var(--c-primary);
  font-weight: 500;
  margin-bottom: 8px;
}
.card-footer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--c-border);
}
.card-views {
  font-size: 12px;
  color: var(--c-text-muted);
}

/* Category header */
.category-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-block: 32px;
}
.cat-header-icon { font-size: 40px; }
.category-header h1 {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.category-header p {
  color: var(--c-text-muted);
  font-size: 15px;
  margin-top: 4px;
}

/* Features */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.feature {
  padding: 24px;
  background: var(--c-surface);
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
}
.feature h3 {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
}
.feature p {
  font-size: 14px;
  color: var(--c-text-muted);
  line-height: 1.6;
}

/* Article page */
.article-page {
  padding-block: 32px 48px;
}
.article-page article {
  max-width: 800px;
}
.article-page h1 {
  font-family: var(--font-heading);
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 24px;
  letter-spacing: -0.3px;
}
.article-page h2 {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  margin-top: 40px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--c-primary-light);
  letter-spacing: -0.2px;
}
.article-page h3 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 600;
  margin-top: 28px;
  margin-bottom: 12px;
}
.article-page p {
  margin-bottom: 16px;
  line-height: 1.8;
}
.article-page ul, .article-page ol {
  margin-bottom: 16px;
  padding-left: 24px;
}
.article-page li {
  margin-bottom: 6px;
  line-height: 1.7;
}
.article-page table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  font-size: 14px;
  overflow-x: auto;
  display: block;
}
.article-page thead {
  background: var(--c-primary);
  color: #fff;
}
.article-page th {
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}
.article-page td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--c-border);
}
.article-page tbody tr:nth-child(even) {
  background: var(--c-surface);
}
.article-page strong {
  font-weight: 600;
  color: var(--c-text);
}
.article-page blockquote {
  border-left: 3px solid var(--c-primary);
  padding: 12px 16px;
  background: var(--c-primary-light);
  margin-bottom: 16px;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
}

.article-meta {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--c-border);
  font-size: 13px;
  color: var(--c-text-muted);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 64px 20px;
  color: var(--c-text-muted);
}
.empty-state code {
  background: var(--c-surface);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 14px;
}

/* Generating page */
.generating-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}
.generating-box {
  text-align: center;
  padding: 48px;
}
.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--c-border);
  border-top-color: var(--c-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 24px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.generating-box h1 {
  font-size: 20px;
  margin-bottom: 8px;
}
.generating-box h2 {
  font-size: 24px;
  color: var(--c-primary);
  margin-bottom: 16px;
}
.generating-hint {
  font-size: 14px;
  color: var(--c-text-muted);
  margin-top: 8px;
}

/* Error page */
.error-page {
  text-align: center;
  padding: 80px 20px;
}
.error-page h1 {
  font-size: 72px;
  font-weight: 700;
  color: var(--c-primary);
  margin-bottom: 16px;
}
.error-page p {
  color: var(--c-text-muted);
  margin-bottom: 24px;
}
.btn {
  display: inline-block;
  padding: 10px 24px;
  background: var(--c-primary);
  color: #fff;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 14px;
  transition: background 0.2s;
}
.btn:hover {
  background: var(--c-primary-hover);
  color: #fff;
}

/* Footer */
.site-footer {
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  padding-block: 40px;
  margin-top: 48px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 24px;
}
.footer-col h4 {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
}
.footer-col p {
  font-size: 14px;
  color: var(--c-text-muted);
  line-height: 1.6;
}
.footer-col ul {
  list-style: none;
}
.footer-col li { margin-bottom: 6px; }
.footer-col a {
  color: var(--c-text-muted);
  font-size: 14px;
}
.footer-col a:hover { color: var(--c-primary); }
.footer-bottom {
  padding-top: 16px;
  border-top: 1px solid var(--c-border);
  text-align: center;
  font-size: 13px;
  color: var(--c-text-muted);
}

/* Author byline */
.article-author {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--c-border);
  font-size: 14px;
  color: var(--c-text-muted);
  flex-wrap: wrap;
}
.article-author .author-name {
  font-weight: 600;
  color: var(--c-text);
}
.article-author .author-role {
  color: var(--c-primary);
  font-size: 13px;
}
.article-author time {
  margin-left: auto;
  font-size: 13px;
}

/* Related articles */
.related-articles {
  margin-top: 40px;
  padding: 24px;
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--c-border);
}
.related-articles h2 {
  font-size: 18px;
  margin-bottom: 16px;
  color: var(--c-text);
}
.related-articles ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.related-articles li a {
  color: var(--c-primary);
  text-decoration: none;
  font-size: 15px;
  line-height: 1.5;
  display: block;
  padding: 6px 0;
  border-bottom: 1px solid var(--c-border);
  transition: color 0.15s;
}
.related-articles li:last-child a {
  border-bottom: none;
}
.related-articles li a:hover {
  color: var(--c-primary-hover);
}

/* FAQ section */
.faq-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 2px solid var(--c-border);
}
.faq-section h3 {
  color: var(--c-primary);
  font-size: 16px;
  margin: 16px 0 8px;
}

/* Responsive */
@media (max-width: 768px) {
  .main-nav { display: none; }
  .nav-toggle { display: block; }
  .hero { padding-block: 40px 36px; }
  .hero-stats { gap: 24px; }
  .stat strong { font-size: 24px; }
  .cat-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  .product-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .category-header { flex-direction: column; text-align: center; }
  .article-page h1 { font-size: 22px; }
  .article-page h2 { font-size: 19px; }
  .article-page table { font-size: 13px; }
}

@media (max-width: 480px) {
  .container { padding-inline: 16px; }
  .hero-stats { flex-direction: column; gap: 12px; }
}
