/*
Theme Name: TechBet TH
Theme URI: https://example.com/techbet-th
Author: ThemeDev
Description: A tech/startup style WordPress theme with slate gray and electric blue design for Thai gaming sites.
Version: 1.0
License: GNU General Public License v2 or later
Text Domain: techbet-th
*/

:root {
  --bg: #1e293b;
  --bg-light: #334155;
  --bg-card: #1e293b;
  --primary: #3b82f6;
  --primary-light: #60a5fa;
  --text: #ffffff;
  --text-muted: #94a3b8;
  --border: #475569;
}

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

body {
  font-family: 'Prompt', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  background-image: radial-gradient(rgba(59,130,246,0.05) 1px, transparent 1px);
  background-size: 30px 30px;
}

a { color: var(--primary-light); text-decoration: none; transition: all 0.3s; }
a:hover { color: var(--primary); }

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

.site-header {
  background: rgba(30,41,59,0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 15px 0;
}

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

.site-logo { font-size: 1.6rem; font-weight: 700; color: var(--primary-light); letter-spacing: 1px; }
.site-logo span { color: var(--text); font-weight: 400; }

.main-nav ul { display: flex; list-style: none; gap: 20px; }
.main-nav a { color: var(--text-muted); font-weight: 500; font-size: 0.9rem; padding: 8px 14px; border-radius: 6px; transition: all 0.3s; }
.main-nav a:hover { color: var(--primary-light); background: rgba(59,130,246,0.1); }

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

.hero {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 120px 20px 80px;
  position: relative;
}

.hero::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse at center, rgba(59,130,246,0.08) 0%, transparent 70%);
}

.hero-content { position: relative; z-index: 2; }
.hero h1 { font-size: 3.2rem; font-weight: 800; margin-bottom: 20px; line-height: 1.2; letter-spacing: -1px; }
.hero h1 span { color: var(--primary-light); display: block; }
.hero p { font-size: 1.1rem; color: var(--text-muted); max-width: 550px; margin: 0 auto 30px; }

.btn-primary {
  display: inline-block; background: var(--primary); color: #fff;
  padding: 14px 36px; font-size: 1rem; font-weight: 600;
  border-radius: 8px; transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(59,130,246,0.3);
}
.btn-primary:hover { background: var(--primary-light); color: #fff; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(59,130,246,0.4); }

.features { padding: 80px 20px; background: var(--bg-light); }
.section-title { text-align: center; font-size: 2.2rem; font-weight: 700; margin-bottom: 50px; letter-spacing: -0.5px; }
.section-title span { color: var(--primary-light); }

.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; max-width: 1200px; margin: 0 auto; }

.feature-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 28px; transition: all 0.3s;
}
.feature-card:hover { border-color: var(--primary); transform: translateY(-3px); box-shadow: 0 4px 20px rgba(59,130,246,0.15); }
.feature-icon { font-size: 2.5rem; margin-bottom: 15px; }
.feature-card h3 { font-size: 1.1rem; margin-bottom: 8px; color: var(--primary-light); }
.feature-card p { color: var(--text-muted); font-size: 0.9rem; }

.games { padding: 80px 20px; background: var(--bg); }
.games-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; max-width: 1200px; margin: 0 auto; }

.game-card {
  background: var(--bg-light); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden; transition: all 0.3s;
}
.game-card:hover { border-color: var(--primary); transform: translateY(-3px); }
.game-card-img { height: 160px; background: linear-gradient(135deg, var(--bg), var(--bg-light)); display: flex; align-items: center; justify-content: center; font-size: 3rem; border-bottom: 1px solid var(--border); }
.game-card-body { padding: 20px; }
.game-card h3 { font-size: 1.1rem; margin-bottom: 6px; }
.game-card p { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 15px; }

.btn-secondary {
  display: inline-block; border: 1px solid var(--primary); color: var(--primary-light);
  padding: 7px 18px; border-radius: 6px; font-weight: 500; font-size: 0.85rem; transition: all 0.3s;
}
.btn-secondary:hover { background: var(--primary); color: #fff; }

.promotions { padding: 80px 20px; background: var(--bg-light); }
.promo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; max-width: 1200px; margin: 0 auto; }
.promo-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 28px; transition: all 0.3s;
}
.promo-card:hover { border-color: var(--primary); }
.promo-badge { display: inline-block; background: rgba(59,130,246,0.15); color: var(--primary-light); padding: 4px 12px; font-size: 0.75rem; font-weight: 600; border-radius: 4px; margin-bottom: 12px; border: 1px solid rgba(59,130,246,0.3); }
.promo-card h3 { font-size: 1.2rem; margin-bottom: 8px; }
.promo-card p { color: var(--text-muted); font-size: 0.9rem; }

.why-us { padding: 80px 20px; background: var(--bg); }
.why-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; max-width: 1200px; margin: 0 auto; }
.why-item { text-align: center; padding: 24px; border: 1px solid var(--border); border-radius: 12px; transition: all 0.3s; }
.why-item:hover { border-color: var(--primary); }
.why-number { font-size: 2.5rem; font-weight: 800; color: var(--primary-light); display: block; margin-bottom: 8px; }
.why-item h3 { font-size: 1rem; margin-bottom: 6px; }
.why-item p { color: var(--text-muted); font-size: 0.85rem; }

.site-footer { background: var(--bg-light); border-top: 1px solid var(--border); padding: 60px 20px 30px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 30px; max-width: 1200px; margin: 0 auto; }
.footer-col h4 { color: var(--primary-light); font-size: 1rem; margin-bottom: 15px; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: var(--text-muted); font-size: 0.85rem; }
.footer-col a:hover { color: var(--primary-light); }
.footer-bottom { text-align: center; padding-top: 30px; margin-top: 30px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 0.8rem; }

@media (max-width: 768px) {
  .main-nav ul { display: none; position: absolute; top: 100%; left: 0; right: 0; background: rgba(30,41,59,0.98); flex-direction: column; padding: 20px; border-bottom: 1px solid var(--border); }
  .main-nav ul.active { display: flex; }
  .mobile-toggle { display: block; }
  .hero h1 { font-size: 2rem; }
  .section-title { font-size: 1.7rem; }
}

/* === Category/Archive Page Styles === */
.page-hero {
  padding: 140px 20px 60px;
  text-align: center;
  background: var(--bg);
  position: relative;
}
.page-hero::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse at center, rgba(59,130,246,0.06) 0%, transparent 70%);
}
.page-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--primary-light);
  position: relative;
  letter-spacing: -0.5px;
}
.page-desc { color: var(--text-muted); font-size: 1rem; max-width: 600px; margin: 0 auto; position: relative; }

.archive-content { padding: 60px 20px; background: var(--bg); }
.posts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 24px; max-width: 1200px; margin: 0 auto; }

.post-card {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s;
}
.post-card:hover { border-color: var(--primary); transform: translateY(-3px); box-shadow: 0 4px 20px rgba(59,130,246,0.15); }

.post-card-img { display: block; height: 200px; overflow: hidden; }
.post-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.post-card:hover .post-card-img img { transform: scale(1.05); }
.post-card-img-placeholder { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--bg), var(--bg-light)); font-size: 3rem; border-bottom: 1px solid var(--border); }

.post-card-body { padding: 24px; }
.post-date { color: var(--primary-light); font-size: 0.8rem; font-weight: 500; }
.post-card-title { font-size: 1.2rem; margin: 10px 0; font-weight: 600; }
.post-card-title a { color: var(--text); }
.post-card-title a:hover { color: var(--primary-light); }
.post-excerpt { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 15px; line-height: 1.7; }
.read-more { color: var(--primary-light); font-weight: 600; font-size: 0.88rem; }
.read-more:hover { color: var(--primary); }

.pagination { text-align: center; margin-top: 50px; }
.pagination .nav-links { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.pagination .page-numbers { display: inline-block; padding: 10px 16px; border-radius: 6px; background: var(--bg-light); border: 1px solid var(--border); color: var(--text-muted); font-weight: 500; transition: all 0.3s; }
.pagination .page-numbers.current, .pagination .page-numbers:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.no-posts { text-align: center; padding: 60px 20px; color: var(--text-muted); font-size: 1.1rem; }

/* === Single Post Styles === */
.single-content { padding: 0 20px 80px; background: var(--bg); }
.featured-image { max-width: 900px; margin: 0 auto 40px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }
.featured-image img { width: 100%; height: auto; display: block; }

.article-body {
  max-width: 800px; margin: 0 auto;
  font-size: 1.02rem; line-height: 1.8; color: var(--text-muted);
}
.article-body h2, .article-body h3, .article-body h4 { color: var(--text); margin: 30px 0 15px; }
.article-body p { margin-bottom: 20px; }
.article-body img { max-width: 100%; height: auto; border-radius: 8px; margin: 20px 0; }
.article-body a { color: var(--primary-light); text-decoration: underline; }

.post-meta { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; margin-top: 15px; }
.post-meta span { color: var(--text-muted); font-size: 0.88rem; }

.post-navigation {
  max-width: 800px; margin: 50px auto;
  display: flex; justify-content: space-between; gap: 20px;
  padding: 30px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.nav-prev, .nav-next { max-width: 45%; }
.nav-next { text-align: right; }
.nav-label { display: block; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 5px; }
.post-navigation a { color: var(--primary-light); font-weight: 600; }
.post-navigation a:hover { color: var(--primary); }

.related-posts { max-width: 1000px; margin: 60px auto 0; }
.related-title { font-size: 1.6rem; font-weight: 700; margin-bottom: 30px; text-align: center; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.related-card {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s;
}
.related-card:hover { border-color: var(--primary); transform: translateY(-3px); }
.related-card-img { display: block; height: 150px; overflow: hidden; }
.related-card-img img { width: 100%; height: 100%; object-fit: cover; }
.related-card-img-placeholder { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--bg), var(--bg-light)); font-size: 2.5rem; border-bottom: 1px solid var(--border); }
.related-card-body { padding: 18px; }
.related-card-body h4 { font-size: 1rem; margin-top: 8px; }
.related-card-body h4 a { color: var(--text); }
.related-card-body h4 a:hover { color: var(--primary-light); }

/* === Latest News Section (Index) === */
.latest-news { padding: 80px 20px; background: var(--bg-light); }
.section-header { display: flex; justify-content: space-between; align-items: center; max-width: 1200px; margin: 0 auto 40px; }
.section-header .section-title { margin-bottom: 0; text-align: left; }
.view-all { color: var(--primary-light); font-weight: 600; font-size: 0.9rem; border: 1px solid var(--primary); padding: 8px 20px; border-radius: 6px; transition: all 0.3s; }
.view-all:hover { background: var(--primary); color: #fff; }

.news-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; max-width: 1200px; margin: 0 auto; }
.news-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s;
}
.news-card:hover { border-color: var(--primary); transform: translateY(-3px); }
.news-card-img { display: block; height: 150px; overflow: hidden; }
.news-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.news-card:hover .news-card-img img { transform: scale(1.05); }
.news-card-img-placeholder { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--bg), var(--bg-light)); font-size: 2.5rem; border-bottom: 1px solid var(--border); }
.news-card-body { padding: 16px; }
.news-date { color: var(--primary-light); font-size: 0.78rem; font-weight: 500; }
.news-title { font-size: 0.95rem; margin: 8px 0; font-weight: 600; }
.news-title a { color: var(--text); }
.news-title a:hover { color: var(--primary-light); }
.news-excerpt { color: var(--text-muted); font-size: 0.82rem; line-height: 1.6; }

@media (max-width: 768px) {
  .page-title { font-size: 1.8rem; }
  .posts-grid { grid-template-columns: 1fr; }
  .news-grid { grid-template-columns: 1fr; }
  .section-header { flex-direction: column; gap: 15px; text-align: center; }
  .post-navigation { flex-direction: column; }
  .nav-prev, .nav-next { max-width: 100%; text-align: left; }
  .related-grid { grid-template-columns: 1fr; }
}
