/* ---------- Design tokens ---------- */
:root {
  --accent: #e60012;
  --accent-dark: #b8000e;
  --ink: #1b1c1e;
  --ink-soft: #5f6368;
  --surface: #ffffff;
  --page-bg: #f2f3f6;
  --border: #e6e7eb;
  --radius: 0.9rem;
  --radius-sm: 0.6rem;
  --shadow: 0 1px 2px rgba(20, 20, 25, 0.04), 0 6px 16px rgba(20, 20, 25, 0.06);
  --shadow-hover: 0 2px 4px rgba(20, 20, 25, 0.06), 0 10px 24px rgba(20, 20, 25, 0.09);
}

* { -webkit-tap-highlight-color: transparent; }

body {
  background-color: var(--page-bg);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.94rem;
}

h1, h2, h3, h4, h5, .fw-bold, .fw-semibold {
  letter-spacing: -0.01em;
}

/* ---------- Navbar ---------- */
.app-navbar {
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  box-shadow: 0 2px 12px rgba(230, 0, 18, 0.18);
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}

.app-navbar .navbar-brand {
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: #fff;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  background: #fff;
  color: var(--accent);
  border-radius: 0.5rem;
  font-weight: 800;
  font-size: 0.95rem;
}

.app-navbar .nav-link {
  color: rgba(255, 255, 255, 0.82);
  font-weight: 500;
  padding: 0.5rem 0.9rem;
  border-radius: 0.5rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.app-navbar .nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.app-navbar .nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.22);
}

.app-main {
  padding-top: 1.25rem;
  padding-bottom: 3rem;
  max-width: 1600px;
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card.stat-card .card-body {
  padding: 1.1rem 1rem;
}

.stat-value {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.15;
}

.stat-label {
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.15rem;
}

.stat-sub {
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-weight: 500;
}

.stat-value-price {
  font-size: 1.15rem;
  white-space: nowrap;
}

@media (max-width: 767.98px) {
  .stat-value-price { font-size: 1rem; }
}

/* ---------- Store status badges ---------- */
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: #eef7ee;
  color: #1e7a34;
  border: 1px solid #d4ecd8;
}

.store-badge .dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #2ea043;
  flex: none;
}

.store-badge.is-error { background: #fdecec; color: #b42318; border-color: #f6d0ce; }
.store-badge.is-error .dot { background: #d92d20; }
.store-badge.is-pending { background: #f1f2f4; color: #5f6368; border-color: var(--border); }
.store-badge.is-pending .dot { background: #9aa0a6; }

/* ---------- Filters panel ---------- */
.filters-card .card-body { padding: 1rem 1.1rem; }
.filters-card label { color: var(--ink-soft); font-weight: 600; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.03em; }
.filters-toggle { display: none; }

@media (max-width: 767.98px) {
  .filters-toggle { display: inline-flex; }
}

/* ---------- Tables ---------- */
.table-responsive-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.1rem 0.25rem;
}

@media (max-width: 767.98px) {
  .table-responsive-card { padding: 0.75rem 0.6rem 0.1rem; border-radius: var(--radius-sm); }
}

table.dataTable {
  font-size: 0.88rem;
}

table.dataTable thead th {
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 2px solid var(--border) !important;
}

table.dataTable tbody td {
  vertical-align: middle;
}

#games-table img, #ranking-table img {
  border-radius: 0.5rem;
  object-fit: cover;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

/* Discount / score pill badges */
.pill {
  display: inline-block;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.8rem;
  white-space: nowrap;
}
.pill-hot { background: #fde8e8; color: #b42318; }
.pill-warm { background: #fff2d9; color: #92400e; }
.pill-mild { background: #eef2ff; color: #3730a3; }
/* Score semantics (Metacritic-like): high=good=green, not "hot"/red */
.pill-good { background: #e6f6ea; color: #1e7a34; }
.pill-fair { background: #fff2d9; color: #92400e; }
.pill-poor { background: #f1f2f4; color: #5f6368; }

.eur-hint { color: var(--ink-soft); font-size: 0.82rem; }

a.eshop-link {
  font-weight: 600;
  text-decoration: none;
}
a.eshop-link:hover { text-decoration: underline; }

/* DataTables Responsive: child row detail styling */
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control {
  position: relative;
  padding-left: 1.8rem;
  cursor: pointer;
}
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control::before {
  top: 50%;
  left: 0.5rem;
  transform: translateY(-50%);
  height: 1.15rem;
  width: 1.15rem;
  line-height: 1.15rem;
  border-radius: 50%;
  background-color: var(--accent);
  box-shadow: none;
  font-size: 0.8rem;
}
ul.dtr-details { list-style: none; margin: 0; padding: 0.25rem 0; }
ul.dtr-details > li { padding: 0.3rem 0; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
ul.dtr-details > li:last-child { border-bottom: none; }
ul.dtr-details .dtr-title { font-weight: 600; color: var(--ink-soft); margin-right: 0.5rem; }

/* ---------- Responsive tweaks ---------- */
@media (max-width: 767.98px) {
  .app-main { padding-left: 0.6rem; padding-right: 0.6rem; }
  .stat-value { font-size: 1.25rem; }
  table.dataTable { font-size: 0.82rem; }
  .dataTables_wrapper .dataTables_length,
  .dataTables_wrapper .dataTables_filter {
    float: none !important;
    text-align: left !important;
    margin-bottom: 0.5rem;
  }
  .dataTables_wrapper .dataTables_filter input { width: 100%; margin-left: 0 !important; margin-top: 0.25rem; }
}
