/* ==========================================================================
   Snake Games CMS — Public Pages Stylesheet (pages.css)
   ========================================================================== */

/* Site Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
  display: flex;
  align-items: center;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.brand-link svg {
  width: 34px;
  height: 34px;
}

/* Nav Menu */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-menu a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 6px 0;
  position: relative;
  transition: color var(--transition-fast);
}

.nav-menu a:hover, .nav-menu li.active > a {
  color: var(--primary);
}

.nav-menu li.active > a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}

/* Dropdown Menus */
.has-dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 8px 0;
  min-width: 180px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all var(--transition-fast);
  z-index: 105;
}

.has-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu li a {
  display: block;
  padding: 8px 16px;
  color: var(--text-main);
}

.dropdown-menu li a:hover {
  background: var(--bg-subtle);
  color: var(--primary);
}

/* Header Action Controls */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Theme Toggle Button (Sun / Moon) */
.theme-toggle-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  background: var(--bg-subtle);
  border-color: var(--text-subtle);
}

/* Hero Section */
.hero-section {
  padding-top: 40px;
  padding-bottom: 20px;
  text-align: center;
}

.hero-headline {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  color: var(--text-main);
}

.hero-tagline {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 36px;
  line-height: 1.5;
}

/* Features Grid */
.feature-card {
  padding: 28px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.feature-icon-box {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: rgba(var(--primary-rgb), 0.12);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 16px;
}

/* Leaderboard Table */
.leaderboard-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
  margin-top: 16px;
}

.leaderboard-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.leaderboard-table tr.lb-row {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-md);
  transition: transform var(--transition-fast);
}

.leaderboard-table tr.lb-row:hover {
  transform: scale(1.01);
  box-shadow: var(--shadow-md);
}

.leaderboard-table td {
  padding: 16px;
}

.leaderboard-table td:first-child {
  border-top-left-radius: var(--radius-md);
  border-bottom-left-radius: var(--radius-md);
}

.leaderboard-table td:last-child {
  border-top-right-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.9rem;
}

.rank-1 { background: #FEF3C7; color: #D97706; }
.rank-2 { background: #E2E8F0; color: #475569; }
.rank-3 { background: #FFEDD5; color: #C2410C; }

/* FAQ Accordion */
.faq-item {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  padding: 18px 24px;
  text-align: left;
  background: transparent;
  border: none;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-answer {
  padding: 0 24px 20px;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  display: none;
}

.faq-item.open .faq-answer {
  display: block;
}

/* Blog Cards */
.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.blog-card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--bg-subtle);
}

.blog-card-body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Footer & Widget Regions */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 64px 0 32px;
  margin-top: 64px;
}

.footer-widgets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 36px;
  margin-bottom: 48px;
}

.widget-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 18px;
  color: var(--text-main);
}

.widget-content p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

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

/* ==========================================================================
   Comprehensive Mobile Ergonomics & Responsive Breakpoints
   ========================================================================== */
@media (max-width: 768px) {
  .site-header {
    height: auto;
    padding: 10px 0 6px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(16, 185, 129, 0.15);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  }

  [data-theme="dark"] .site-header {
    background: rgba(15, 23, 42, 0.94);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .header-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
  }

  .brand-link {
    font-size: 1.18rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .brand-link svg {
    width: 30px;
    height: 30px;
    filter: drop-shadow(0 2px 4px rgba(16, 185, 129, 0.3));
  }

  .header-play-cta {
    padding: 6px 14px !important;
    font-size: 0.85rem !important;
    font-weight: 800 !important;
    border-radius: 20px !important;
    background: linear-gradient(135deg, #10B981, #059669) !important;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.35) !important;
  }

  .main-navigation {
    order: 3;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px 0 2px;
    scrollbar-width: none;
  }

  .main-navigation::-webkit-scrollbar {
    display: none;
  }

  .nav-menu {
    gap: 8px;
    white-space: nowrap;
    display: inline-flex;
    padding: 2px 0;
  }

  .nav-menu a {
    font-size: 0.84rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 16px;
    background: rgba(16, 185, 129, 0.06);
    color: var(--text-main);
    display: inline-block;
    transition: all 0.2s ease;
  }

  .nav-menu a:hover, .nav-menu li.active > a {
    background: #10B981;
    color: #FFFFFF !important;
  }

  .hero-section {
    padding-top: 14px;
    padding-bottom: 12px;
  }

  .hero-headline {
    font-size: 1.7rem;
    margin-bottom: 6px;
    line-height: 1.2;
  }

  .hero-tagline {
    font-size: 0.92rem;
    margin-bottom: 14px;
    padding: 0 6px;
    line-height: 1.45;
  }

  .section {
    padding-top: 36px;
    padding-bottom: 36px;
  }

  .container {
    padding-left: 14px;
    padding-right: 14px;
  }

  .section-title {
    margin-bottom: 28px;
  }

  .section-title h1, .section-title h2 {
    font-size: 1.6rem;
  }

  .section-title p {
    font-size: 0.95rem;
  }

  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  /* Responsive tables with touch momentum scrolling */
  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  th, td {
    padding: 10px 12px !important;
    font-size: 0.88rem !important;
  }

  /* Accordion mobile ergonomics */
  .faq-question {
    padding: 14px 18px;
    font-size: 0.98rem;
  }

  .faq-answer {
    padding: 0 18px 16px;
    font-size: 0.9rem;
  }

  /* Footer on mobile - Sleek & professional */
  .site-footer {
    padding: 44px 0 24px;
    margin-top: 48px;
    background: #F8FAFC;
    border-top: 1px solid rgba(16, 185, 129, 0.12);
  }

  [data-theme="dark"] .site-footer {
    background: #0B1120;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .footer-widgets-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
    margin-bottom: 32px !important;
  }

  .footer-widget-col {
    background: #FFFFFF;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  }

  [data-theme="dark"] .footer-widget-col {
    background: #111827;
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow: none;
  }

  .footer-widget-col .widget-title {
    font-size: 0.95rem;
    font-weight: 800;
    margin-bottom: 12px;
    color: #10B981;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .footer-widget-col .widget-content {
    font-size: 0.88rem;
    line-height: 1.6;
  }

  .footer-widget-col .widget-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
  }

  .footer-widget-col .widget-content ul li a {
    display: block;
    padding: 6px 0;
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.15s ease;
  }

  .footer-widget-col .widget-content ul li a:hover {
    color: #10B981;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 14px;
    padding-top: 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
  }

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

  .footer-copyright {
    font-size: 0.82rem;
    color: var(--text-muted);
  }

  .footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
  }

  .footer-nav a {
    font-size: 0.82rem;
    color: var(--text-muted);
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.15s ease;
  }

  .footer-nav a:hover {
    color: #10B981;
  }
}
