/* ============================================
   YORK GAME LAB — LISTING PAGE STYLES
   Modern compact list, premium aesthetic
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Colors */
  --c-bg-app: #f8f9fb;
  --c-bg-sidebar: #ffffff;
  --c-bg-card: #ffffff;
  --c-bg-card-hover: #fafbff;

  --c-text-primary: #111827;
  --c-text-secondary: #4b5563;
  --c-text-tertiary: #9ca3af;

  --c-accent: #4f46e5;
  --c-accent-hover: #4338ca;
  --c-accent-surface: #eef2ff;
  --c-accent-muted: rgba(79, 70, 229, 0.08);

  --c-border: #eaecf0;
  --c-border-hover: #d1d5db;

  --c-tag-bg: #f3f4f6;
  --c-tag-text: #4b5563;
  --c-tag-border: transparent;

  --c-star: #f59e0b;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;

  /* Layout */
  --sidebar-w: 260px;
  --cover-size: 52px;

  /* Effects */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-card-hover: 0 4px 16px rgba(79,70,229,0.10), 0 1px 4px rgba(0,0,0,0.04);
  --trans-base: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  --radius-card: 10px;
  --radius-sm: 6px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font-sans);
  background: var(--c-bg-app);
  color: var(--c-text-primary);
  margin: 0;
  height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ── */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--c-bg-sidebar);
  border-right: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex-shrink: 0;
  z-index: 20;
}

/* Brand header in sidebar */
.brand {
  padding: var(--space-5) var(--space-5) var(--space-4);
  border-bottom: 1px solid var(--c-border);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
  letter-spacing: -0.5px;
}

.brand-text h1 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--c-text-primary);
  line-height: 1.2;
}

.brand-text .subtitle {
  margin: 0;
  color: var(--c-text-tertiary);
  font-size: 0.75rem;
  font-weight: 500;
}

/* Search */
.search-container {
  padding: 0 var(--space-4) var(--space-4);
}

input[type="search"] {
  width: 100%;
  padding: 9px 12px 9px 36px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-family: var(--font-sans);
  background:
    var(--c-bg-app)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'%3E%3C/path%3E%3C/svg%3E")
    no-repeat 10px center / 16px;
  transition: var(--trans-base);
  color: var(--c-text-primary);
}

input[type="search"]:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px var(--c-accent-surface);
  background-color: #fff;
}

/* Filters */
.filters-container {
  padding: 0 var(--space-4) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.filter-group h3 {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--c-text-tertiary);
  margin: 0 0 var(--space-2) 0;
  font-weight: 700;
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.83rem;
  color: var(--c-text-secondary);
  cursor: pointer;
  padding: 4px 6px;
  margin: 0 -6px;
  border-radius: var(--radius-sm);
  transition: var(--trans-base);
}

.checkbox-label:hover {
  background: var(--c-accent-muted);
  color: var(--c-accent);
}

.checkbox-label input {
  margin: 0;
  width: 14px;
  height: 14px;
  accent-color: var(--c-accent);
  border-radius: 3px;
  flex-shrink: 0;
}

/* ── Main Content ── */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--c-bg-app);
  min-width: 0;
}

.top-bar {
  height: 56px;
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
  background: white;
}

.results-count {
  font-size: 0.83rem;
  color: var(--c-text-tertiary);
  font-weight: 500;
}

/* ── Game List ── */
.game-grid {
  flex: 1;
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}

/* ── Card (Compact Row) ── */
.card {
  background: var(--c-bg-card);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-card);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-3);
  padding: 12px 16px;
  transition: var(--trans-base);
  position: relative;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  flex-shrink: 0 !important;
  height: 100px !important;
}

.card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, var(--c-accent), #8b5cf6);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform 0.2s ease;
  border-radius: 0 0 0 0;
}

.card:hover {
  transform: translateX(2px);
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(99, 102, 241, 0.25);
  background: var(--c-bg-card-hover);
}

.card:hover::before {
  transform: scaleY(1);
}

/* ── Card Cover Thumbnail (50px) ── */
.card-cover {
  width: var(--cover-size);
  height: var(--cover-size);
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--c-tag-bg);
  box-shadow: 0 1px 4px rgba(0,0,0,0.10);
}

.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Color block fallback (no image) */
.card-cover-color {
  width: 100%;
  height: 100%;
}

/* ── Card Content ── */
.card-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-title-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.card h2 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--c-text-primary);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Rating stars */
.card-rating {
  font-size: 0.65rem;
  color: var(--c-star);
  letter-spacing: -1px;
  flex-shrink: 0;
  opacity: 0.85;
}

/* Card Meta row */
.card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.card-year {
  font-size: 0.75rem;
  color: var(--c-text-tertiary);
  font-weight: 500;
}

.meta-divider {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--c-text-tertiary);
  opacity: 0.5;
  flex-shrink: 0;
}

/* Platform chips */
.platform-chip {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--c-accent-surface);
  color: var(--c-accent);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.platform-chip.muted {
  background: var(--c-tag-bg);
  color: var(--c-text-tertiary);
}

/* Tags */
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tag {
  background: var(--c-tag-bg);
  color: var(--c-tag-text);
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
  transition: all 0.15s;
}

.card:hover .tag {
  background: #eef2ff;
  color: var(--c-accent);
}

.tag.more {
  background: transparent;
  color: var(--c-text-tertiary);
  border: 1px dashed var(--c-border-hover);
}

/* Arrow chevron */
.card-arrow {
  font-size: 1.1rem;
  color: var(--c-text-tertiary);
  flex-shrink: 0;
  opacity: 0;
  transform: translateX(-4px);
  transition: var(--trans-base);
  font-weight: 300;
  line-height: 1;
}

.card:hover .card-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* ── Empty State ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  color: var(--c-text-tertiary);
  font-size: 0.9rem;
  border: 2px dashed var(--c-border);
  border-radius: 12px;
  margin-top: var(--space-4);
}

/* ── Loading ── */
.loading-filters {
  font-size: 0.82rem;
  color: var(--c-text-tertiary);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50%       { opacity: 1; }
}

/* ── Mobile ── */
@media (max-width: 768px) {
  .app-layout {
    flex-direction: column;
    overflow: visible;
  }

  .sidebar {
    width: 100%;
    height: auto;
    max-height: 42vh;
    border-right: none;
    border-bottom: 1px solid var(--c-border);
  }

  .main-content { overflow: visible; }

  .game-grid {
    padding: var(--space-3);
  }
}

/* ── Detail Page legacy styles (keep for fallback) ── */
.detail-container {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--space-8);
  min-height: 100vh;
}