:root {
  --main-bg-color: #f4f7f6;
  --header-bg-color: #fff;
  --main-text-color: #333;
  --secondary-text-color: #777;
  --link-color: #007bff;
  --link-hover-color: #0056b3;
  --border-color: #ddd;
  --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --sidebar-bg-color: #fff;
  --sidebar-border: #ccc;
  --tab-btn-active-bg: #e9ecef;
  --tab-btn-hover-bg: #f8f9fa;
  --view-options-btn-bg: #007bff;
  --view-options-btn-border: #007bff;
  --view-options-btn-color: #fff;
  --view-options-btn-hover-bg: #0056b3;
  --filter-tag-bg: #e9ecef;
  --filter-tag-color: #495057;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--main-text-color);
  background-color: var(--main-bg-color);
}
/* Styling for the "None" filter tag */
.filter-tag.no-filter-tag {
  background-color: var(--secondary-text-color);
  color: #fff;
}
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}
.filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px; /* Adds space between the buttons */
}
h1, h2, h3 {
  color: #333;
}

/* --- BUTTON STYLES --- */
#open-filter-sidebar,
#clear-filters-btn,
.generate-btn {
  padding: 10px 20px;
  font-size: 16px;
  border: 1px solid var(--view-options-btn-border);
  border-radius: 5px;
  background-color: var(--view-options-btn-bg);
  color: var(--view-options-btn-color);
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

#open-filter-sidebar:hover,
#clear-filters-btn:hover {
  background-color: var(--view-options-btn-hover-bg);
}

.main-buttons {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}

.main-btn {
  padding: 10px 20px;
  font-size: 16px;
  border: 1px solid var(--view-options-btn-border);
  border-radius: 5px;
  background-color: var(--view-options-btn-bg);
  color: var(--view-options-btn-color);
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.main-btn:hover {
  background-color: var(--view-options-btn-hover-bg);
}

/* --- FILTER TOKEN STYLES --- */
#filter-tokens {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  padding: 10px;
  border-radius: 8px;
}

.filter-tag {
  background-color: var(--filter-tag-bg);
  color: var(--filter-tag-color);
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 0.9em;
  transition: background-color 0.3s ease, color 0.3s ease;
  white-space: nowrap;
}

/* This is the key rule that applies to the active filters */
.filter-tag.dynamic-filter-tag {
    /* Styles will be inherited from .filter-tag, you can add more here if needed */
}

/* --- SIDEBAR AND TAB STYLES --- */
.sidebar {
  position: fixed;
  top: 0;
  right: -300px;
  width: 300px;
  height: 100%;
  background-color: var(--sidebar-bg-color);
  border-left: 1px solid var(--sidebar-border);
  box-shadow: -2px 0 5px rgba(0,0,0,0.1);
  transition: right 0.3s ease;
  z-index: 1000;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.sidebar.open {
  right: 0;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  align-self: flex-end;
}

.tab-headers {
  display: flex;
  justify-content: space-around;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
}

.tab-btn {
  background: none;
  border: none;
  padding: 10px 20px;
  cursor: pointer;
  font-size: 16px;
  color: var(--secondary-text-color);
  transition: color 0.3s;
}

.tab-btn.active {
  color: var(--link-color);
  border-bottom: 2px solid var(--link-color);
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* --- TABLE STYLES --- */
.game-table-container {
  background-color: var(--header-bg-color);
  border-radius: 8px;
  box-shadow: var(--box-shadow);
  overflow: hidden;
  padding: 20px;
}

.game-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.game-table th,
.game-table td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.game-table th {
  background-color: #f8f9fa;
  font-weight: 600;
  color: #555;
  cursor: pointer;
}

.game-table th:hover {
  background-color: #e9ecef;
}

.game-table tbody tr:hover {
  background-color: #f5f5f5;
}

.game-table .sort-icon {
  margin-left: 5px;
  font-size: 0.8em;
  color: #888;
}

.rom-count-container {
  text-align: center;
  margin: 10px 0;
  font-size: 1.1em;
  font-weight: bold;
  color: var(--main-text-color);
}