/*
 * GameJS Main Stylesheet
 * Premium Dark Neon Space Theme
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Inter:wght@300;400;500;700&display=swap');

:root {
  /* Color Palette */
  --bg-color: #0b0816;
  --bg-darker: #05030b;
  --panel-bg: rgba(20, 16, 35, 0.6);
  --panel-border: rgba(138, 43, 226, 0.15);
  
  --primary: #8a2be2;
  --primary-glow: rgba(138, 43, 226, 0.4);
  --primary-hover: #a04ef6;
  
  --secondary: #00f5ff;
  --secondary-glow: rgba(0, 245, 255, 0.3);
  --secondary-hover: #33f7ff;
  
  --text-primary: #ffffff;
  --text-secondary: #a5a1b8;
  --text-muted: #64607a;
  
  --accent-green: #39ff14;
  --accent-red: #ff3131;
  
  /* Fonts */
  --font-title: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  /* Transitions */
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-card: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease, border-color 0.3s ease;
}

/* Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(138, 43, 226, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(0, 245, 255, 0.05) 0%, transparent 50%);
  background-attachment: fixed;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Header & Navigation */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 8, 22, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--panel-border);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.8rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 1.8rem;
  background: linear-gradient(45deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: -0.5px;
  position: relative;
}

.logo::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(45deg, var(--primary), var(--secondary));
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

.logo:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 1.5rem;
  align-items: center;
}

.nav-links a {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-secondary);
  transition: var(--transition-smooth);
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  position: relative;
}

.nav-links a:hover,
.nav-links li.active a {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10%;
  width: 80%;
  height: 2px;
  background: var(--secondary);
  transform: scaleX(0);
  transition: var(--transition-smooth);
}

.nav-links li.active a::after {
  transform: scaleX(1);
}

.nav-links a:hover::after {
  transform: scaleX(1);
}

.lang-switcher {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--panel-border);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition-smooth);
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.9rem;
}

.lang-switcher:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--secondary);
  box-shadow: 0 0 10px var(--secondary-glow);
}

/* Mobile Nav Toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Main Container */
.main-container {
  max-width: 1200px;
  margin: 2rem auto 4rem auto;
  padding: 0 1.5rem;
}

/* Hero Section */
.hero {
  text-align: center;
  margin-bottom: 3rem;
  padding: 3rem 1.5rem;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(138, 43, 226, 0.15) 0%, transparent 60%);
  pointer-events: none;
}

.hero h1 {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 3.5rem;
  margin-bottom: 1rem;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #ffffff 30%, #a5a1b8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* Grid Layout for Games */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.5rem;
  margin-bottom: 4rem;
}

/* Game Card */
.game-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  overflow: hidden;
  transition: var(--transition-card);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  position: relative;
  aspect-ratio: 1/1;
}

.game-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 18px;
  padding: 1.5px;
  background: linear-gradient(to bottom right, var(--primary), var(--secondary));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: var(--transition-smooth);
}

.game-card:hover {
  transform: translateY(-8px) scale(1.03);
  border-color: transparent;
  box-shadow: 
    0 15px 30px rgba(138, 43, 226, 0.25),
    0 0 15px var(--secondary-glow);
}

.game-card:hover::before {
  opacity: 1;
}

.card-img-wrapper {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.card-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.game-card:hover .card-img-wrapper img {
  transform: scale(1.1);
}

.card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 2.5rem 1rem 0.8rem 1rem;
  background: linear-gradient(to top, rgba(5, 3, 11, 0.95) 0%, rgba(5, 3, 11, 0.7) 50%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
  opacity: 0.9;
  transition: var(--transition-smooth);
}

.game-card:hover .card-overlay {
  background: linear-gradient(to top, rgba(5, 3, 11, 0.98) 0%, rgba(5, 3, 11, 0.8) 60%, transparent 100%);
}

.game-card .play-btn {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.6);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px var(--secondary-glow);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.game-card:hover .play-btn {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.play-btn svg {
  fill: var(--bg-darker);
  width: 20px;
  height: 20px;
  margin-left: 3px;
}

.game-title {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* SEO Description Area */
.seo-description {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  padding: 2.5rem;
  margin-top: 3rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.seo-description h2, 
.seo-description h3 {
  font-family: var(--font-title);
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.seo-description h2 {
  font-size: 1.8rem;
  background: linear-gradient(45deg, #ffffff, var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  border-left: 4px solid var(--primary);
  padding-left: 0.8rem;
}

.seo-description h3 {
  font-size: 1.3rem;
  margin-top: 1.8rem;
}

.seo-description p, 
.seo-description span {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1rem;
  display: block;
}

/* Play Page Game Frame */
.game-play-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.game-frame-wrapper {
  width: 100%;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--panel-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(138, 43, 226, 0.1);
  background: #000;
  position: relative;
}

.game-frame-wrapper iframe {
  width: 100%;
  height: 600px;
  display: block;
}

.game-play-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
}

.game-play-title {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 2rem;
  background: linear-gradient(to right, #fff, var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.back-to-home-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  padding: 0.6rem 1.2rem;
  border-radius: 12px;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.back-to-home-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary);
  color: var(--secondary);
  box-shadow: 0 0 15px rgba(138, 43, 226, 0.2);
}

.back-to-home-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Footer */
footer {
  background: var(--bg-darker);
  border-top: 1px solid var(--panel-border);
  padding: 3rem 1.5rem;
  margin-top: auto;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  text-align: center;
}

.footer-logo {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 1.6rem;
  background: linear-gradient(45deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.footer-nav {
  display: flex;
  gap: 2rem;
  list-style: none;
  font-family: var(--font-title);
  font-weight: 600;
  color: var(--text-secondary);
}

.footer-nav a:hover {
  color: var(--text-primary);
}

.footer-copyright {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-copyright a {
  color: var(--text-secondary);
}

.footer-copyright a:hover {
  color: var(--secondary);
  text-decoration: underline;
}

/* Responsive Styles */
@media (max-width: 900px) {
  .hero h1 {
    font-size: 2.8rem;
  }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }
  
  nav {
    display: none; /* Can toggle with JS */
  }
  
  .header-container {
    flex-wrap: wrap;
  }
  
  .nav-active nav {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-top: 1rem;
    gap: 1rem;
    padding-bottom: 1rem;
  }
  
  .nav-active .nav-links {
    flex-direction: column;
    width: 100%;
    gap: 0.8rem;
  }
  
  .nav-active .nav-links li,
  .nav-active .nav-links a {
    width: 100%;
    text-align: center;
  }
  
  .nav-active .lang-switcher {
    width: fit-content;
    margin: 0.5rem auto 0 auto;
  }
  
  .hero h1 {
    font-size: 2.2rem;
  }
  
  .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1rem;
  }
  
  .seo-description {
    padding: 1.5rem;
  }
  
  .game-frame-wrapper iframe {
    height: 400px;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.8rem;
  }
  
  .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  }
  
  .game-play-title {
    font-size: 1.5rem;
  }
}
