:root {
  --primary-color: #00e5ff;
  --secondary-color: #ff00e5;
  --background-color: #0a0a1e;
  --text-color: #e0e0e0;
  --nav-bg: rgba(10, 10, 30, 0.7);
  --glass-bg: rgba(255, 255, 255, 0.05);
  --border-glow: rgba(0, 229, 255, 0.5);
  --shadow-color: rgba(0, 0, 0, 0.5);
}

/* Base Styles */
body {
  margin: 0;
  font-family: 'Exo 2', sans-serif;
  color: var(--text-color);
  background-color: var(--background-color);
  overflow-x: hidden;
}

.font-orbitron {
  font-family: 'Orbitron', sans-serif;
}

.text-glow {
  text-shadow: 0 0 5px var(--primary-color), 0 0 10px var(--primary-color), 0 0 20px var(--primary-color);
}

/* General Layout */
.page {
  display: none;
  width: 100vw;
  min-height: 100vh;
  position: relative;
  box-sizing: border-box;
  padding-top: 60px; /* Space for the fixed navigation bar */
}

.page.active {
  display: block;
}

.particles-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

/* Navigation */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  box-shadow: 0 4px 30px var(--shadow-color);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 5%;
}

.nav-brand {
  font-size: 1.5em;
  font-weight: 700;
  padding: 0;
}

.nav-menu {
  display: flex;
  gap: 20px;
}

.nav-link {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease, text-shadow 0.3s ease;
  padding: 5px;
}

.nav-link:hover {
  color: var(--primary-color);
  text-shadow: 0 0 5px var(--primary-color);
}

.nav-toggle {
  display: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 25px;
  height: 3px;
  background: var(--primary-color);
  transition: all 0.3s ease;
}

@media (max-width: 768px) {
  .nav-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0;
    width: 100%;
    background: var(--nav-bg);
    padding: 10px 0;
    text-align: center;
  }

  .nav-menu.open {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }
}

/* Home Page */
.home-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 5%;
  height: 100vh;
}

.animated-lines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

.line {
  stroke: var(--primary-color);
  stroke-width: 1;
  stroke-linecap: round;
  opacity: 0.1;
  animation: draw-line 10s infinite ease-in-out;
}

.line-1 { animation-delay: 0s; }
.line-2 { animation-delay: 2s; }

@keyframes draw-line {
  0%, 100% { stroke-dasharray: 0 500; stroke-dashoffset: 0; }
  50% { stroke-dasharray: 500 500; stroke-dashoffset: 500; }
}

.home-content {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5%;
  width: 100%;
  max-width: 1200px;
  padding: 50px 0;
}

.home-left, .home-right {
  width: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.home-title {
  font-size: 5em;
  margin: 0;
  line-height: 1;
  font-family: 'Orbitron', sans-serif;
  text-shadow: 0 0 10px var(--primary-color), 0 0 20px var(--primary-color), 0 0 40px var(--primary-color);
}

.home-description {
  font-size: 1.2em;
  font-weight: 300;
  color: var(--text-color);
  margin: 20px 0;
}

.start-button {
  background: var(--primary-color);
  color: var(--background-color);
  border: none;
  padding: 15px 30px;
  font-size: 1.2em;
  font-weight: 700;
  border-radius: 50px;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-transform: uppercase;
}

.start-button:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 20px rgba(0, 229, 255, 0.4);
}

/* Trending Games */
.trending-container {
  position: relative;
  width: 100%;
  max-width: 400px;
}

.trending-border {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 2px solid var(--primary-color);
  box-shadow: 0 0 10px var(--primary-color), inset 0 0 10px var(--primary-color);
  animation: border-anim 5s infinite linear;
  pointer-events: none;
}

@keyframes border-anim {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.trending-content {
  background: var(--glass-bg);
  backdrop-filter: blur(5px);
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 0 20px var(--shadow-color);
  text-align: center;
}

.trending-header {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.trending-icon {
  width: 24px;
  height: 24px;
  fill: var(--primary-color);
  margin-right: 10px;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.game-card {
  background: var(--glass-bg);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.game-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 229, 255, 0.3);
}

.game-card-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary-color);
}

.game-card-title {
  font-size: 0.9em;
  margin-top: 10px;
  text-align: center;
  color: var(--text-color);
}

/* Games Page */
.games-container {
  padding: 50px 5%;
}

.games-header {
  text-align: center;
  margin-bottom: 40px;
}

.games-title {
  font-size: 3em;
}

.games-controls {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 40px;
}

.search-container {
  position: relative;
  width: 100%;
  max-width: 400px;
}

.search-input {
  width: 100%;
  padding: 10px 40px 10px 20px;
  border: 2px solid var(--primary-color);
  background: var(--glass-bg);
  color: var(--text-color);
  border-radius: 50px;
  font-size: 1em;
}

.search-icon {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary-color);
}

.category-filter {
  padding: 10px 20px;
  border: 2px solid var(--primary-color);
  background: var(--glass-bg);
  color: var(--text-color);
  border-radius: 50px;
  font-size: 1em;
  appearance: none;
}

.games-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 20px;
}

.games-list .game-card {
  padding: 15px;
}

.games-list .game-card-icon {
  width: 80px;
  height: 80px;
}

.games-list .game-card-title {
  font-size: 1em;
}

/* Game Page */
.game-container {
  padding: 20px 5%;
}

.game-header {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.back-button {
  background: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  padding: 8px 15px;
  font-size: 1em;
  cursor: pointer;
  border-radius: 5px;
  transition: background 0.3s ease;
}

.back-button:hover {
  background: var(--primary-color);
  color: var(--background-color);
}

.game-title {
  margin: 0;
  margin-left: 20px;
  font-size: 2em;
}

.game-content {
  display: flex;
  gap: 20px;
}

.game-player {
  flex: 3;
  position: relative;
}

.game-iframe {
  width: 100%;
  height: 600px;
  border: 2px solid var(--primary-color);
  background-color: #000;
}

.game-controls-overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 10px;
}

.game-control-btn {
  background: var(--glass-bg);
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
  padding: 10px;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
}

.game-control-btn:hover {
  background: var(--primary-color);
  color: var(--background-color);
  transform: scale(1.1);
}

.game-sidebar {
  flex: 1;
  background: var(--glass-bg);
  padding: 20px;
  border-radius: 10px;
}

.game-info {
  text-align: center;
  margin-bottom: 20px;
}

.game-icon {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid var(--primary-color);
  object-fit: cover;
}

.game-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  margin-top: 10px;
}

.game-tag {
  background: var(--primary-color);
  color: var(--background-color);
  font-size: 0.8em;
  padding: 5px 10px;
  border-radius: 20px;
}

/* Related Games */
.related-games h3 {
  border-bottom: 1px solid var(--primary-color);
  padding-bottom: 10px;
}

.related-games-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .home-content {
    flex-direction: column;
    text-align: center;
  }
  .home-left, .home-right {
    width: 100%;
    margin-bottom: 40px;
  }
  .game-content {
    flex-direction: column;
  }
}

@media (max-width: 600px) {
  .nav-menu {
    top: 50px;
  }
  .home-title {
    font-size: 3em;
  }
  .games-controls {
    flex-direction: column;
  }
  .games-list {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}
