@import url("https://fonts.googleapis.com/css2?family=Barlow:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Barlow", sans-serif;
}

html,
body {
  width: 100%;
  height: 100%;
  background-color: #1d1d1d;
  color: #fff;
}

body {
  display: flex;
  flex-direction: column;
}

img {
  width: 100%;
  border-radius: 5px;
}

header {
  display: flex;
  align-items: center;
  gap: 60px;
  padding: 0 10px;
  margin: 0 20px 0 20px;
}

header img {
  width: auto;
  height: 110px !important;
  max-height: 128px;
  border-radius: 4px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  margin-left: 40px;
}

header nav {
  flex: 1;
  max-width: calc(100% - 130px - 20px);
}

nav {
  background-color: #272727;
  padding: 15px 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  display: flex;
  gap: 10px;
  align-items: center;
  border-radius: 5px;
}

#searchArea {
  flex: 1;
  padding: 10px 15px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.3s;
  background-color: rgba(16, 16, 16, 0.4);
  color: #fff;
}

#searchArea::placeholder {
  color: #a8a8a8;
  opacity: 0.7;
}

#searchArea:focus,
#searchArea:hover {
  outline: none;
  border-color: #ff8c00;
}

#searchArea:focus {
  box-shadow: 0 0 5px rgba(0, 0, 255, 0.3);
}

#searchButton {
  padding: 10px 25px;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

#searchButton:hover {
  background-color: #ff8c006e;
  border-color: #ffd700;
  transform: translateY(-2px);
}

.content-wrapper {
  display: flex;
  gap: 20px;
  padding: 0 20px 10px 20px;
  flex: 1;
}

aside {
  width: 200px;
  background-color: #272727;
  padding: 20px;
  border-radius: 5px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  height: fit-content;
}

aside form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

#reset {
  padding: 10px 15px;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

#reset:hover {
  background-color: #ff8c006e;
  border-color: #ffd700;
  transform: translateY(-2px);
}

details {
  border: 1px solid #3d3d3d;
  border-radius: 4px;
  padding: 10px;
  background-color: rgba(16, 16, 16, 0.4);
  max-height: 300px;
  overflow-y: auto;
}

details::-webkit-scrollbar,
.games-grid::-webkit-scrollbar,
.modal-content::-webkit-scrollbar {
  width: 8px;
}

.games-grid::-webkit-scrollbar {
  width: 10px;
}

details::-webkit-scrollbar-track,
.games-grid::-webkit-scrollbar-track,
.modal-content::-webkit-scrollbar-track {
  background: #1d1d1d;
  border-radius: 4px;
}

.modal-content::-webkit-scrollbar-track {
  border-radius: 0 10px 10px 0;
}

details::-webkit-scrollbar-thumb,
.games-grid::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb {
  background: #ff8c00;
  border-radius: 4px;
}

.games-grid::-webkit-scrollbar-thumb {
  border-radius: 5px;
}

details::-webkit-scrollbar-thumb:hover,
.games-grid::-webkit-scrollbar-thumb:hover,
.modal-content::-webkit-scrollbar-thumb:hover {
  background: #e07c01;
}

details summary {
  font-weight: 600;
  cursor: pointer;
  color: #fff;
  user-select: none;
  padding: 5px;
  transition: color 0.3s;
}

details summary:hover,
details[open] summary {
  color: #ff8c00;
}

details[open] summary {
  margin-bottom: 10px;
}

details > :not(summary) {
  margin-top: 10px;
  padding: 5px;
}

details input[type="checkbox"],
details input[type="radio"] {
  width: 18px;
  height: 18px;
  margin-right: 10px;
  cursor: pointer;
  accent-color: #ff8c00;
  flex-shrink: 0;
  vertical-align: middle;
}

details label {
  display: flex;
  align-items: center;
  margin: 10px 0;
  cursor: pointer;
  font-size: 14px;
  color: #b7b7b7;
}

details label:hover {
  color: #ff8c00;
}

.games-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  max-height: 600px;
  overflow-y: auto;
  padding: 20px;
  background-color: #272727;
  border-radius: 5px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.game-card {
  background-color: #323232;
  border: 1px solid #3d3d3d;
  border-radius: 5px;
  padding: 15px;
  transition:
    transform 0.3s,
    box-shadow 0.3s;
  cursor: pointer;
}

.game-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px #e27c00;
  border-color: #ff8c00;
}

.game-card h3 {
  font-size: 16px;
  margin-bottom: 10px;
  color: #fff;
}

.game-card p {
  font-size: 13px;
  color: #a8a8a8;
  line-height: 1.5;
}

footer {
  background-color: #272727;
  color: #fff;
  padding: 15px 20px;
  margin: 20px;
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  border-radius: 5px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

footer button {
  padding: 10px 20px;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.3s;
  font-family: "Barlow", sans-serif;
  justify-self: start;
}

footer button:hover {
  background-color: #ff8c006e;
  border-color: #ffd700;
  transform: translateY(-2px);
}

footer h4 {
  justify-self: center;
}

section {
  margin: 20px;
  padding: 20px;
  background-color: #272727;
  border-radius: 5px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
}

.modal-content {
  background: linear-gradient(135deg, #272727, #323232);
  margin: 3% auto;
  border: 1px solid #ff8c00;
  border-radius: 10px;
  width: 90%;
  max-width: 550px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px #e27c00;
  animation: slideIn 0.3s ease-out;
  color: #fff;
  position: relative;
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-game-details {
  padding: 20px;
}

.modal-game-details img {
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  margin-bottom: 15px;
}

.modal-game-details h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(90deg, #ff8c00, #ffd700);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.modal-game-details h3 {
  font-size: 14px;
  font-weight: 500;
  color: #ffd700;
  margin-bottom: 15px;
  padding: 8px 12px;
  background: #f9961c81;
  border-left: 3px solid #ffd700;
  border-radius: 4px;
}

.modal-game-details p {
  font-size: 14px;
  line-height: 1.5;
  color: #b7b7b7;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-game-details p:last-child {
  border-bottom: none;
}

.modal-game-details p strong {
  color: #ffd700;
  font-weight: 600;
  margin-right: 10px;
  display: inline-block;
  min-width: 120px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-game-details p:first-of-type {
  line-height: 1.6;
  color: #d4d4d4;
  margin-bottom: 12px;
  padding: 10px 0 12px 0;
  border-bottom: 2px solid rgba(0, 102, 255, 0.2);
}

.modal-game-details p:first-of-type strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
}

.modal-game-details .pill-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 8px;
}

.modal-game-details .pill {
  display: inline-block;
  padding: 4px 10px;
  background: #ff8c006e;
  border: 1px solid #fc99217b;
  border-radius: 16px;
  font-size: 12px;
  color: #ffd700;
  font-weight: 500;
  transition: all 0.2s;
}

.modal-game-details .pill:hover {
  background: #fc992185;
  border-color: #ffd700;
  transform: translateY(-1px);
}

.modal-game-details .pill.platform {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #b7b7b7;
}

.modal-game-details .pill.platform:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
}

.modal-game-details .pill.common,
.modal-game-details .pill.platform.common {
  background: rgba(0, 255, 100, 0.15);
  border-color: rgba(0, 255, 100, 0.3);
  color: #5cff8d;
}

.modal-game-details .pill.common:hover,
.modal-game-details .pill.platform.common:hover {
  background: rgba(0, 255, 100, 0.25);
  border-color: #00ff64;
}

.close {
  color: #fff;
  position: absolute;
  right: 20px;
  top: 15px;
  font-size: 32px;
  font-weight: bold;
  transition: all 0.3s;
  cursor: pointer;
  z-index: 1;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  line-height: 1;
}

.close:hover,
.close:focus {
  color: #ff8c00;
  background-color: #ff8c006e;
  transform: rotate(90deg);
}

.goog-te-gadget {
  color: transparent !important;
  font-size: 0px !important;
  display: flex !important;
  align-items: center !important;
}

.goog-te-gadget *,
#google_translate_element select {
  font-size: 14px !important;
  font-family: "Barlow", sans-serif;
}

.goog-te-gadget span,
.goog-te-gadget a,
.goog-te-gadget img,
div.skiptranslate:nth-child(1) > span:nth-child(2) {
  display: none !important;
}

.goog-te-combo option {
  background-color: #1d1d1d;
}

#google_translate_element select {
  font-weight: 600;
  text-align: center;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 4px;
  padding: 10px 12px;
  max-width: 100%;
  cursor: pointer;
  transition: all 0.3s;
  color: white;
}

#google_translate_element {
  justify-self: end;
  min-width: 0;
  overflow: hidden;
}

@media (max-width: 768px) {
  .content-wrapper,
  header {
    flex-direction: column;
  }

  header {
    align-items: center;
    padding: 10px 0;
    gap: 10px !important;
  }

  header img {
    height: auto !important;
    max-height: 100px;
    flex-shrink: 0 !important;
  }

  aside,
  header nav,
  #searchArea,
  #google_translate_element select,
  .goog-te-gadget select {
    width: 100%;
  }

  header nav {
    max-width: none;
  }
  nav {
    flex-direction: column;
    width: 100%;
  }

  #searchButton {
    width: 100%;
  }

  .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    max-height: 400px;
  }

  .modal-content {
    width: 95%;
    margin: 5% auto;
    max-height: 85vh;
  }

  .modal-game-details {
    padding: 15px;
  }

  .modal-game-details h2 {
    font-size: 20px;
  }
  .modal-game-details h3 {
    font-size: 13px;
    padding: 6px 10px;
  }
  .modal-game-details p {
    font-size: 13px;
    padding: 5px 0;
  }
  .modal-game-details p strong {
    min-width: 100px;
    font-size: 11px;
  }
  .modal-game-details .pill {
    font-size: 11px;
    padding: 3px 8px;
  }

  .close {
    right: 10px;
    top: 10px;
    width: 28px;
    height: 28px;
    font-size: 24px;
  }

  footer {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 8px;
  }

  footer button,
  #google_translate_element {
    justify-self: center;
  }

  #google_translate_element select,
  .goog-te-gadget select {
    max-width: 200px;
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 20px;
  }
  .games-grid {
    grid-template-columns: 1fr;
    max-height: 300px;
  }
  nav {
    padding: 10px;
    margin: 0 10px 10px 10px;
  }
}
