/* ============================================
   Quake Live Pro Settings - Dark Gaming Theme
   ============================================ */

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a24;
  --bg-hover: #252530;
  --text-primary: #e8e8f0;
  --text-secondary: #b0b0c0;
  --text-muted: #9090a0;
  --accent-primary: #ff6b35;
  --accent-secondary: #4ecdc4; /* Teal - for backward compat with inline styles */
  --link-internal: #4ecdc4;
  --link-external: #38bdf8;
  --border-color: #2a2a35;
  --success: #4ade80;
  --error: #f87171;
}

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

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

/* ============================================
   Links - Color Hierarchy for Clarity

   🩵 Teal (#4ecdc4) = Internal links (stays on site)
   🔵 Sky Blue (#38bdf8) = External links (leaves site) + ↗ icon
   🟠 Orange (#ff6b35) = Active states, hover effects, buttons ONLY
   ⚪ White (#e8e8f0) = Headers/titles
   ============================================ */

/* Default: Internal links - Teal */
a {
  color: var(--link-internal);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #6ee7de;
  text-decoration: underline;
}

/* External links - Sky Blue */
a[href^="http"]:not([href*="stripyq.github.io"]):not([href*="localhost"]),
a.external-link {
  color: var(--link-external);
}

a.external-link::after {
  content: " ↗";
  font-size: 0.75em;
  opacity: 0.7;
}

a[href^="http"]:not([href*="stripyq.github.io"]):not([href*="localhost"]):hover,
a.external-link:hover {
  color: #7dd3fc;
}

/* Table cell links - context-aware */
td a {
  color: var(--link-external);
}

td a:hover {
  color: #7dd3fc;
}

/* Player name links (clickable player names in lists) - Teal (internal) */
.player-name a,
a.player-link,
td.player a,
td:first-child a {
  color: var(--link-internal);
}

.player-name a::after,
a.player-link::after,
td.player a::after,
td:first-child a::after {
  content: none;
}

.player-name a:hover,
a.player-link:hover,
td.player a:hover,
td:first-child a:hover {
  color: #6ee7de;
}

/* Headers - White (NOT orange) */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 600;
}

/* Player name headers in comparison table - White */
.player-header,
.compare-player-name,
th[class*="player"] {
  color: var(--text-primary) !important;
  font-weight: 600;
}

/* ============================================
   Navigation
   ============================================ */

.main-nav {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-primary);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-links a.active {
  color: var(--accent-primary);
}

.nav-links a.active:hover {
  color: var(--accent-primary);
}

.search-box input {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.5rem 1rem;
  color: var(--text-primary);
  width: 250px;
}

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

.search-box input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

/* ============================================
   Main Content
   ============================================ */

.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

.page-header {
  text-align: center;
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

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

/* ============================================
   Filters
   ============================================ */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-group label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.filter-group select {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  color: var(--text-primary);
  cursor: pointer;
}

.filter-group select:focus {
  outline: none;
  border-color: var(--accent-primary);
}

/* ============================================
   Player Grid
   ============================================ */

.player-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.player-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  display: block;
}

.player-card:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.15);
}

.player-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.player-name {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.player-country {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.player-card-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.stat {
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.player-card-hardware {
  margin-bottom: 0.75rem;
}

.hardware-tag {
  display: inline-block;
  background: var(--bg-secondary);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.player-rating {
  font-size: 0.85rem;
  color: var(--accent-primary);
  font-weight: 500;
}

/* ============================================
   Player Page
   ============================================ */

.player-page {
  max-width: 1000px;
  margin: 0 auto;
}

.player-header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.player-header h1 {
  font-size: 3rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.real-name {
  color: var(--text-secondary);
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.player-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.player-meta span {
  color: var(--text-secondary);
  padding: 0.25rem 0.75rem;
  background: var(--bg-card);
  border-radius: 4px;
}

.player-meta .rating {
  color: var(--accent-primary);
  font-weight: 600;
}

.player-meta .category {
  color: var(--link-internal);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.settings-section {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 1.5rem;
  border: 1px solid var(--border-color);
}

.settings-section h2 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.settings-table {
  width: 100%;
  border-collapse: collapse;
}

.settings-table td {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.settings-table tr:last-child td {
  border-bottom: none;
}

.settings-table td:first-child {
  color: var(--text-secondary);
  width: 50%;
}

.settings-table td:last-child {
  font-weight: 500;
  text-align: right;
}

.hardware-section {
  grid-column: 1 / -1;
}

.hardware-section .hardware-item {
  background: var(--bg-secondary);
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.hardware-section .hardware-item:last-child {
  margin-bottom: 0;
}

.hardware-item h3 {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 0.25rem;
  letter-spacing: 0.05em;
}

.hardware-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.hardware-specs {
  width: 100%;
  font-size: 0.9rem;
}

.hardware-specs td {
  padding: 0.25rem 0;
}

.hardware-specs td:first-child {
  color: var(--text-secondary);
  width: 40%;
}

.config-section {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 2rem;
  border: 1px solid var(--border-color);
}

.config-section h2 {
  margin-bottom: 1rem;
  color: var(--accent-primary);
}

.download-btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent-primary), #ff8c5a);
  color: white;
  padding: 0.75rem 2rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s;
}

.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.back-link {
  color: var(--link-internal);
  text-decoration: none;
  display: inline-block;
  margin-top: 1rem;
}

.back-link:hover {
  color: #6ee7de;
  text-decoration: underline;
}

/* ============================================
   Hardware Page
   ============================================ */

.hardware-category {
  margin-bottom: 3rem;
}

.hardware-category h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--accent-primary);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-primary);
}

.hardware-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.hardware-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.25rem;
}

.hardware-card h3 {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.hardware-brand {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.hardware-mini-specs {
  width: 100%;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.hardware-mini-specs td {
  padding: 0.2rem 0;
}

.hardware-mini-specs td:first-child {
  color: var(--text-secondary);
  width: 45%;
}

.usage-count {
  font-size: 0.85rem;
  color: var(--accent-primary);
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-color);
}

/* ============================================
   Statistics Page
   ============================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
}

.stat-card h2 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.big-stat {
  text-align: center;
  margin-bottom: 1rem;
}

.big-stat .stat-number {
  display: block;
  font-size: 3rem;
  font-weight: 700;
  color: var(--link-internal);
}

.big-stat .stat-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.stat-details {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.stat-details div {
  margin-bottom: 0.25rem;
}

.distribution {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dist-bar {
  position: relative;
}

.dist-bar span {
  position: relative;
  z-index: 1;
  font-size: 0.85rem;
}

.dist-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 4px;
  opacity: 0.3;
}

.dist-fill.low { background: var(--link-internal); }
.dist-fill.mid { background: var(--success); }
.dist-fill.high { background: var(--accent-primary); }

.popularity-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.popularity-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  background: var(--bg-secondary);
  border-radius: 4px;
}

.popularity-item .rank {
  font-weight: 700;
  color: var(--accent-primary);
  min-width: 2rem;
}

.popularity-item .name {
  flex: 1;
}

.popularity-item .count {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* ============================================
   Footer
   ============================================ */

.main-footer {
  text-align: center;
  padding: 2rem;
  margin-top: 3rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.main-footer a {
  color: var(--link-internal);
  text-decoration: none;
}

.main-footer a:hover {
  text-decoration: underline;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    gap: 1rem;
  }

  .nav-links {
    gap: 1rem;
  }

  .search-box input {
    width: 100%;
  }

  .player-card-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .player-header h1 {
    font-size: 2rem;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .filters {
    flex-direction: column;
  }

  .filter-group {
    width: 100%;
    justify-content: space-between;
  }

  .filter-group select {
    flex: 1;
  }
}

/* ============================================
   Mobile Menu - Hidden by Default
   ============================================ */

/* Mobile overlay - completely hidden until opened */
.mobile-overlay {
  display: none !important;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 200;
}

.mobile-overlay.open {
  display: block !important;
}

/* Mobile menu - completely hidden until opened */
.mobile-menu {
  display: none !important;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  max-width: 85vw;
  background: var(--bg-secondary, #12121a);
  border-left: 1px solid var(--border-color, #2a2a35);
  z-index: 201;
  flex-direction: column;
  overflow-y: auto;
}

.mobile-menu.open {
  display: flex !important;
}

/* Mobile menu header */
.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color, #2a2a35);
}

.mobile-menu-title {
  font-weight: 600;
  color: var(--text-primary, #e8e8f0);
}

.mobile-close-btn {
  background: transparent;
  border: 1px solid var(--border-color, #2a2a35);
  border-radius: 4px;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--text-secondary, #9090a0);
}

.mobile-close-btn:hover {
  background: var(--bg-hover, #252530);
  color: var(--text-primary, #e8e8f0);
}

.mobile-close-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* Mobile menu links */
.mobile-menu-links {
  padding: 0.5rem 0;
}

.mobile-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  color: var(--text-secondary, #9090a0);
  text-decoration: none;
  transition: all 0.2s;
}

.mobile-link:hover {
  background: var(--bg-hover, #252530);
  color: var(--text-primary, #e8e8f0);
  text-decoration: none;
}

.mobile-link.active {
  color: var(--accent-primary, #ff6b35);
  background: rgba(255, 107, 53, 0.1);
}

.mobile-link svg,
.mobile-link .nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Mobile menu button - hidden on desktop */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--border-color, #2a2a35);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-primary, #e8e8f0);
}

.mobile-menu-btn:hover {
  background: var(--bg-hover, #252530);
}

.mobile-menu-btn svg {
  width: 22px;
  height: 22px;
}

/* Nav icons */
.nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Desktop: show nav links, hide mobile menu */
@media (min-width: 769px) {
  .mobile-overlay,
  .mobile-menu,
  .mobile-menu-btn {
    display: none !important;
  }
}

/* Mobile: hide nav links, show hamburger */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .mobile-menu-btn {
    display: flex;
  }
}
