/* Global Variables for Color Scheme */
:root {
  --primary-color: #007bff;
  --primary-dark-color: #0056b3;
  --secondary-color: #121212;
  --border-color: #444;
  --card-bg-color: #1e1e1e;
  --card-border-color: #ddd;
  --text-color: #e0e0e0;
  --highlight-color: #ffbf00;
  --focus-shadow-color: rgba(0, 123, 255, 0.8);
  --link-color: #1e90ff;

  /* Light Mode Colors */
  --light-bg-color: #f4f4f4;
  --light-card-bg-color: white;
  --light-border-color: #ccc;
  --light-text-color: #333;
  --light-highlight-color: #ff9900;
}

/* Dark Mode */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--secondary-color);
  color: var(--text-color);
}

body a {
  color: var(--link-color);
  text-decoration: none;
}

body a:hover {
  color: var(--primary-color);
}

body .game-card {
  border: 1px solid var(--border-color);
}

header {
  text-align: center;
  margin-bottom: 20px;
}

/* Light Mode Styles */
body.light-mode {
  background-color: var(--light-bg-color);
  color: var(--light-text-color);
}

body.light-mode .game-card {
  background: var(--light-card-bg-color);
  border: 1px solid var(--light-border-color);
}

body.light-mode .rating {
  color: var(--light-highlight-color);
}

/* Other */
.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  align-items: center;
}

#toggle-button {
  padding: 10px 20px;
  font-size: 1rem;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#toggle-button:hover {
  background-color: var(--primary-dark-color);
}

#search-bar,
#tag-search-bar {
  padding: 10px;
  font-size: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  width: 200px;
  transition: box-shadow 0.3s ease;
}

#search-bar:focus,
#tag-search-bar:focus {
  outline: none;
  box-shadow: 0 0 5px var(--focus-shadow-color);
}

#games-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  padding: 1rem;
}

.game-card {
  background: var(--card-bg-color);
  border: 1px solid var(--card-border-color);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.game-card img {
  max-width: 100px;
  border-radius: 8px;
}

.game-card h2 {
  font-size: 1.2rem;
}

.game-card p {
  font-size: 0.9rem;
}

.rating {
  color: var(--highlight-color);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rating .half-star {
  position: relative;
}

.rating .half-star:after {
  content: '½';
  font-size: 1.2rem;
  color: var(--highlight-color);
  position: absolute;
  left: 0;
  top: 0;
}

#tag-list-container {
  position: absolute;
  background: white;
  border: 1px solid var(--border-color);
  max-height: 150px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  /* Hide by default */
}

.tag-suggestion {
  padding: 5px 10px;
  cursor: pointer;
  color: black
}

.tag-suggestion:hover {
  background: var(--primary-color);
  color: white;
}


#light-mode-toggle {
  position: absolute;
  padding: 10px 20px;
  top: 10px; /* Adjust the distance from the top */
  right: 10px; /* Adjust the distance from the right */
  font-size: 1.5rem; /* Optional: adjust the size of the button */
  border: none;
  cursor: pointer;
  background: transparent;
  color: var(--text-color);
}

#sort-button {
  font-size: 1.5rem;
  border: none;
  cursor: pointer;
  background: transparent;
  color: var(--text-color);
}