/* ============================================================
   ENGINE GUILD — dashboard.css
   Sidebar layout + all dashboard component styles
   ============================================================ */

/* ── Layout ─────────────────────────────────────────────────── */
.dash-body {
  display: flex;
  min-height: 100vh;
  background: var(--bg-deep);
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
  width: 240px;
  min-width: 240px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.25s;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.2rem 1rem;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo img {
  height: 36px;
  width: auto;
}
.sidebar-product {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  color: var(--gold);
  letter-spacing: 0.08em;
  line-height: 1.2;
}
.sidebar-role {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 0.8rem 0;
  display: flex;
  flex-direction: column;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: all 0.15s;
  cursor: pointer;
}
.nav-item:hover {
  color: var(--text);
  background: rgba(197,160,89,0.05);
}
.nav-item.active {
  color: var(--gold);
  border-left-color: var(--gold);
  background: rgba(197,160,89,0.08);
}
.nav-icon { font-size: 1rem; width: 1.2rem; text-align: center; }

.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 0.6rem 1rem;
}

.sidebar-footer {
  padding: 0.8rem 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.sidebar-username {
  display: block;
  font-size: 0.82rem;
  color: var(--text);
  font-weight: 600;
}
.sidebar-studio {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
}

/* ── Main content ────────────────────────────────────────────── */
.dash-main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 0 0 4rem;
}

/* ── Mobile header ───────────────────────────────────────────── */
.dash-mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  position: sticky;
  top: 0;
  z-index: 50;
}

/* ── Sections ────────────────────────────────────────────────── */
.dash-section { display: none; padding: 1.8rem 2rem; }
.dash-section.active { display: block; }

.section-header { margin-bottom: 1.6rem; }
.section-header h2 { margin-bottom: 0.2rem; }
.section-sub { color: var(--muted); font-size: 0.88rem; }

/* ── Stat grid ───────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.6rem;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  text-align: center;
}
.stat-value {
  font-family: 'Cinzel', serif;
  font-size: 2rem;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 0.3rem;
}
.stat-label {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Panel ───────────────────────────────────────────────────── */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 1.4rem;
  overflow: hidden;
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.4rem;
  border-bottom: 1px solid var(--border);
}
.panel-header h3 { color: var(--gold); font-size: 0.88rem; letter-spacing: 0.06em; }
.panel > form,
.panel > .form-grid { padding: 1.4rem; }

/* ── Form grid ───────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.2rem;
  padding: 1.4rem;
}
.form-full { grid-column: 1 / -1; }
.form-hint { color: var(--muted); font-size: 0.78rem; margin-top: 0.25rem; display: block; }
.form-hint-inline { color: var(--muted); font-size: 0.75rem; font-weight: 400; }

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.18rem 0.55rem;
  border-radius: 20px;
}
.badge-green  { background: rgba(39,174,96,0.15);  color: var(--eg-green); border: 1px solid rgba(39,174,96,0.3);  }
.badge-gold   { background: rgba(197,160,89,0.15); color: var(--gold); border: 1px solid var(--border); }
.badge-gray   { background: rgba(var(--eg-ink-rgb),0.05); color: var(--muted); border: 1px solid var(--border); }
.badge-blue   { background: rgba(52,152,219,0.15); color: #3498db; border: 1px solid rgba(52,152,219,0.3); }

/* ── Game list rows ──────────────────────────────────────────── */
.game-list { padding: 0 1.4rem 1.4rem; }
.game-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.game-row:last-child { border-bottom: none; }
.game-row-logo { width: 40px; height: 40px; flex-shrink: 0; }
.game-row-logo img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; }
.game-logo-placeholder {
  width: 40px; height: 40px; border-radius: 6px;
  background: var(--bg-panel); display: flex; align-items: center;
  justify-content: center; font-size: 1.2rem;
}
.game-row-info { flex: 1; min-width: 140px; }
.game-row-info strong { display: block; color: var(--text); font-size: 0.92rem; }
.game-slug { font-size: 0.72rem; color: var(--muted); }
.game-row-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.game-row-badges { display: flex; gap: 0.4rem; }
.game-row-actions { margin-left: auto; }

/* ── Quick links ─────────────────────────────────────────────── */
.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 0.4rem;
}
.quick-link {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.quick-link:hover {
  border-color: var(--gold-dim);
  background: rgba(197,160,89,0.05);
}
.quick-link span { font-size: 1.4rem; }
.quick-link strong { color: var(--gold); font-family: 'Cinzel', serif; font-size: 0.82rem; }
.quick-link small { color: var(--muted); font-size: 0.75rem; }

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 2.4rem 1rem;
  color: var(--muted);
}
.empty-icon { font-size: 2.5rem; margin-bottom: 0.8rem; }
.empty-state p { margin-bottom: 1rem; font-size: 0.88rem; }

/* ── Rarity table ────────────────────────────────────────────── */
.rarity-table { display: flex; flex-direction: column; gap: 0.6rem; }
.rarity-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.rarity-name {
  width: 90px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.rarity-hint { font-size: 0.7rem; color: var(--muted); white-space: nowrap; }
.rarity-common     { color: #adb5bd; }
.rarity-uncommon   { color: var(--eg-green); }
.rarity-rare       { color: #3498db; }
.rarity-epic       { color: #9b59b6; }
.rarity-legendary  { color: var(--gold); }
.rarity-special    { color: var(--eg-red); }

/* ── VPS upload section ──────────────────────────────────────── */
.vps-meta {
  display: flex;
  gap: 1.5rem;
  font-size: 0.85rem;
  color: var(--muted);
  flex-wrap: wrap;
}
.vps-meta strong { color: var(--text); }

.upload-drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin: 1.4rem;
}
.upload-drop-zone:hover,
.upload-drop-zone.drag-over {
  border-color: var(--gold-dim);
  background: rgba(197,160,89,0.04);
}
.upload-drop-icon { font-size: 2.5rem; margin-bottom: 0.8rem; }
.upload-drop-zone p { color: var(--muted); font-size: 0.88rem; }

/* ── Toast ───────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.8rem 1.2rem;
  font-size: 0.88rem;
  color: var(--text);
  box-shadow: var(--shadow);
  transform: translateY(120%);
  transition: transform 0.3s;
  z-index: 999;
  max-width: 320px;
}
.toast.show { transform: translateY(0); }
.toast.toast-success { border-color: rgba(39,174,96,0.5); color: var(--eg-green); }
.toast.toast-error   { border-color: rgba(192,57,43,0.5); color: var(--eg-red); }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0;
    transform: translateX(-100%);
    height: 100%;
    z-index: 200;
  }
  .sidebar.open { transform: translateX(0); }
  .dash-mobile-header { display: flex; }
  .dash-section { padding: 1.2rem 1rem; }
  .form-grid { grid-template-columns: 1fr; }
  .game-row { flex-wrap: wrap; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .quick-links { grid-template-columns: 1fr; }
  .rarity-row { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
.toast {
    position: fixed;
    bottom: -100px; /* Hides it below the screen */
    right: 20px;
    background: var(--eg-surface);
    border: 1px solid #c5a059;
    color: var(--eg-text);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    transition: bottom 0.3s ease-in-out;
    z-index: 9999;
}
.toast.show {
    bottom: 20px; /* Pulls it up into view */
}
.toast-success { border-color: var(--eg-green); color: var(--eg-green); }
.toast-error { border-color: var(--eg-red); color: var(--eg-red); }