/* GameNet - Modern Gaming Guide Website Styles */

/* =====================
   CSS Variables & Theme
   ===================== */
:root {
  /* Primary Colors */
  --bg-primary: #0f0f14;
  --bg-secondary: #1a1a24;
  --bg-card: #22222e;
  --bg-hover: #2a2a38;
  
  /* Accent Colors */
  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  
  /* Text Colors */
  --text-primary: #f1f1f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  
  /* Semantic Colors */
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 350ms ease;
  
  /* Layout */
  --sidebar-width: 320px;
  --content-max-width: 900px;
  --header-height: 64px;
}

/* =====================
   Base Reset & Typography
   ===================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* =====================
   Layout Structure
   ===================== */
.layout-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
#sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid rgba(255,255,255,0.05);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow: hidden;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  background: var(--bg-primary);
}

/* =====================
   Sidebar Components
   ===================== */
.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
}

.logo-icon {
  font-size: 1.75rem;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

/* Search Box */
.search-box {
  padding: 1rem 1.5rem;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition-fast);
}

.search-box input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-results {
  position: absolute;
  top: 100%;
  left: 1rem;
  right: 1rem;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  display: none;
  max-height: 400px;
  overflow-y: auto;
  z-index: 100;
}

.search-results.active {
  display: block;
}

.search-result-item {
  display: block;
  padding: 0.875rem 1rem;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: var(--transition-fast);
}

.search-result-item:hover {
  background: var(--bg-hover);
}

.search-result-item:last-child {
  border-bottom: none;
}

.result-game {
  display: block;
  font-size: 0.75rem;
  color: var(--accent-primary);
  margin-bottom: 0.25rem;
}

.result-title {
  display: block;
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.result-title mark {
  background: var(--accent-primary);
  color: white;
  padding: 0 2px;
  border-radius: 2px;
}

.result-snippet {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.no-results {
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
}

/* Navigation */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0;
}

.sidebar-nav::-webkit-scrollbar {
  width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
}

/* Category */
.nav-category {
  margin-bottom: 0.25rem;
}

.category-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: left;
}

.category-toggle:hover {
  background: var(--bg-hover);
}

.category-toggle.no-games {
  opacity: 0.5;
  cursor: default;
}

.toggle-icon {
  font-size: 0.65rem;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}

.category-toggle.collapsed .toggle-icon {
  transform: rotate(0deg);
}

.category-toggle:not(.collapsed) .toggle-icon {
  transform: rotate(90deg);
}

.category-icon {
  font-size: 1.1rem;
}

.category-name {
  flex: 1;
}

.game-count {
  font-size: 0.7rem;
  background: var(--bg-card);
  color: var(--text-muted);
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
}

.category-content {
  display: none;
  padding-left: 1rem;
}

/* Subcategory */
.subcategory-list {
  list-style: none;
}

.subcategory-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.85rem;
  transition: var(--transition-fast);
}

.subcategory-header:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.sub-toggle-icon {
  font-size: 0.6rem;
  transition: transform var(--transition-fast);
}

.subcategory-header.collapsed .sub-toggle-icon {
  transform: rotate(0deg);
}

.subcategory-header:not(.collapsed) .sub-toggle-icon {
  transform: rotate(90deg);
}

.subcategory-icon {
  font-size: 0.9rem;
}

.subcategory-name {
  flex: 1;
}

/* Game List */
.game-list {
  list-style: none;
  padding-left: 1.25rem;
  margin-bottom: 0.5rem;
}

.game-item {
  margin: 0.25rem 0;
}

.game-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  text-decoration: none;
  color: var(--text-secondary);
  border-radius: 6px;
  transition: var(--transition-fast);
}

.game-link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.game-icon {
  font-size: 1.1rem;
}

.game-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.game-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.05);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

.sidebar-footer .stats {
  margin-top: 0.25rem;
  font-size: 0.7rem;
}

/* =====================
   Main Content Area
   ===================== */
.content-wrapper {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 2rem;
}

.page-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.page-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-header .subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition-fast);
}

.breadcrumb a:hover {
  color: var(--accent-primary);
}

.breadcrumb span {
  color: var(--text-muted);
}

/* Article Cards */
.article-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(255,255,255,0.05);
  transition: var(--transition-normal);
}

.article-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.article-card h2 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.article-card h2 a {
  color: var(--text-primary);
  text-decoration: none;
}

.article-card h2 a:hover {
  color: var(--accent-primary);
}

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

.article-meta .game-tag {
  background: var(--accent-primary);
  color: white;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
}

.article-excerpt {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* Tables */
.content-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.content-table th,
.content-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border: 1px solid rgba(255,255,255,0.1);
}

.content-table th {
  background: var(--bg-card);
  font-weight: 600;
  color: var(--text-primary);
}

.content-table td {
  color: var(--text-secondary);
}

.content-table tr:hover td {
  background: var(--bg-hover);
}

/* =====================
   Mobile Responsive
   ===================== */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 999;
  width: 44px;
  height: 44px;
  background: var(--accent-gradient);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
  box-shadow: var(--shadow-md);
}

@media (max-width: 1024px) {
  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
  }

  #sidebar.mobile-open {
    transform: translateX(0);
  }

  .mobile-close-btn {
    display: block;
  }

  .main-content {
    margin-left: 0;
  }

  .content-wrapper {
    padding: 1.5rem;
    padding-top: 5rem;
  }
}

@media (max-width: 640px) {
  :root {
    --sidebar-width: 100%;
  }

  .content-wrapper {
    padding: 1rem;
    padding-top: 4.5rem;
  }

  .page-header h1 {
    font-size: 1.5rem;
  }

  .article-card {
    padding: 1rem;
  }

  .content-table {
    font-size: 0.8rem;
  }

  .content-table th,
  .content-table td {
    padding: 0.5rem;
  }
}

/* =====================
   Utility Classes
   ===================== */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* Loading Animation */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.loading {
  animation: pulse 1.5s infinite;
}

/* =====================
   Language Switcher (Global)
   ===================== */
.lang-switch-global {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1001;
  display: flex;
  gap: 0.25rem;
  background: var(--bg-card);
  padding: 0.25rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
}

.lang-switch-global .lang-btn {
  padding: 0.4rem 0.75rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  transition: var(--transition-fast);
}

.lang-switch-global .lang-btn:hover {
  color: var(--text-primary);
}

.lang-switch-global .lang-btn.active {
  background: var(--accent-gradient);
  color: white;
}

/* Sidebar Language Switcher */
.lang-switcher {
  display: flex;
  gap: 0.25rem;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.lang-switcher .lang-btn {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid rgba(255,255,255,0.1);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  transition: var(--transition-fast);
}

.lang-switcher .lang-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.lang-switcher .lang-btn.active {
  background: var(--accent-gradient);
  border-color: transparent;
  color: white;
}

/* Badge */
.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 500;
}

.badge-rpg { background: #8b5cf6; }
.badge-action { background: #ef4444; }
.badge-shooter { background: #f59e0b; }
.badge-strategy { background: #22c55e; }