:root{
  --bg:#1a1a1a;         /* darker charcoal for more contrast */
  --card:#232323;
  --card-light:#2a2a2a;
  --muted:#a8b2c8;
  --accent:#4a86e8;     /* brighter blue */
  --accent-2:#6ba4f8;
  --accent-3:#8fc1ff;
  --glass: rgba(255,255,255,0.05);
  --gradient-1: linear-gradient(135deg, #4a86e8 0%, #6ba4f8 50%, #8fc1ff 100%);
  --gradient-2: linear-gradient(135deg, rgba(74,134,232,0.15) 0%, rgba(107,164,248,0.15) 100%);
  --gradient-3: linear-gradient(135deg, rgba(143,193,255,0.1) 0%, rgba(74,134,232,0.1) 100%);
}

/* Import fonts from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&family=Luckiest+Guy&family=Sigmar+One&display=swap');

*{box-sizing:border-box}
html,body{height:100%;margin:0;font-family:Inter,system-ui,Segoe UI,Roboto,"Helvetica Neue",Arial;color:var(--muted);background:var(--bg);}

/* Subtle background pattern without checkerboard */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(74,134,232,0.05) 0%, transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(107,164,248,0.05) 0%, transparent 40%);
  background-size: 60% 60%, 60% 60%;
  background-position: 0 0, 100% 100%;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: -1;
  opacity: 0.4;
}

/* Unique header with cube-inspired design */
header{
  background: linear-gradient(135deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.5) 100%),
              url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%234a86e8' fill-opacity='0.08'%3E%3Cpath d='M0,0 L40,0 L40,40 L0,40 Z M8,8 L32,8 L32,32 L8,32 Z'/%3E%3C/g%3E%3C/svg%3E");
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(12px);
  position: relative;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

header h1{
  color: white;
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: 0.8px;
  font-weight: 700;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

header nav{
  display: flex;
  gap: 1rem;
}

header nav a{
  color: var(--muted);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-weight: 500;
}

header nav a:hover{
  background: var(--gradient-2);
  color: white;
  transform: translateY(-1px);
}

/* page spacing */
main{padding:2rem;max-width:1200px;margin:0 auto}

/* Homepage specific styles */
.home {
  padding: 2rem 0;
}

.hero-section {
  text-align: center;
  margin-bottom: 3rem;
}

.hero-section h2 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

/* Vertical courses layout with square images and text below */
.courses-vertical {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.course-card {
  background: linear-gradient(135deg, var(--card) 0%, var(--card-light) 100%);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.3s ease;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
}

.course-card:hover {
  transform: translateY(-8px) rotate(1deg);
  box-shadow: 0 16px 48px rgba(74,134,232,0.25);
  border-color: rgba(107,164,248,0.4);
}

.course-image-container {
  width: 100%;
  min-height: 200px;
  background: var(--gradient-3);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.course-image {
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.course-card:hover .course-image {
  transform: scale(1.05);
}

.course-icon-fallback {
  font-size: 4rem;
  opacity: 0.3;
}

.course-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.course-card h3 {
  font-size: 1.4rem;
  margin: 0 0 0.8rem 0;
  color: white;
  font-weight: 700;
  font-family: 'Luckiest Guy', sans-serif;
}

.course-card p {
  color: var(--muted);
  margin: 0 0 1.5rem 0;
  line-height: 1.6;
  flex: 1;
  font-family: 'JetBrains Mono', monospace;
}

.course-actions {
  margin-top: auto;
}

/* Why choose section */
.why-choose-section {
  margin-bottom: 3rem;
}

.why-choose-section h3 {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 2rem;
  color: white;
  font-family: 'Luckiest Guy', sans-serif;
}

.why-choose-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.why-choose-card {
  background: var(--gradient-2);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid rgba(63,142,245,0.1);
  text-align: center;
}

.why-choose-card h4 {
  color: var(--accent-2);
  margin: 0 0 1rem 0;
  font-size: 1.2rem;
  font-family: 'Luckiest Guy', sans-serif;
}

.why-choose-card p {
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
  font-family: 'JetBrains Mono', monospace;
}

/* All courses button at bottom with cube-inspired design */
.all-courses-btn {
  text-align: center;
  margin-top: 3rem;
  padding: 2rem 0;
}

.all-courses-btn .btn {
  background: var(--gradient-1);
  padding: 1.2rem 2.5rem;
  border-radius: 12px;
  font-size: 1.1rem;
  position: relative;
  overflow: hidden;
}

.all-courses-btn .btn::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: shimmer 3s infinite;
  z-index: -1;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Buttons */
.btn {
  background: var(--gradient-1);
  color: white;
  padding: 1rem 2rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-block;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(43,102,217,0.3);
}

.btn-secondary {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
}

.btn-secondary:hover {
  background: var(--accent);
  color: white;
  box-shadow: 0 8px 20px rgba(43,102,217,0.2);
}

/* Favorites */
.favorites{margin-bottom:1rem}
.favorites h2{color:var(--accent);margin:0 0 0.5rem 0; font-family: 'Luckiest Guy', sans-serif;}
.favorites-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:1rem;padding-bottom:1rem}

/* Search */
.search-bar{display:flex;flex-direction:column;gap:0.5rem;padding:1rem 0}
#search-input{background:var(--card);border:1px solid rgba(255,255,255,0.04);padding:0.8rem 1rem;border-radius:8px;color:var(--muted);outline:none}
#search-input:focus{box-shadow:0 0 0 3px rgba(63,142,245,0.12);border-color:var(--accent-2)}
.search-hint{font-size:0.85rem;color:#9aa6c2}

#search-results {
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* category sections */
.category-section{margin:1.25rem 0;padding:1rem;border-radius:10px;background:linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));border:1px solid rgba(255,255,255,0.02)}
.category-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:0.75rem}
.category-header h2{color:var(--accent);margin:0; font-family: 'Luckiest Guy', sans-serif;}
.show-more{background:none;border:1px solid rgba(255,255,255,0.04);color:var(--muted);padding:0.4rem 0.6rem;border-radius:8px;cursor:pointer}

/* games grid inside categories */
.games-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:1rem}
@media (max-width:900px){
  .games-grid{grid-template-columns:repeat(2,1fr)}
}
@media (max-width:560px){
  .games-grid{grid-template-columns:repeat(1,1fr)}
}

/* Game cards with improved layout */
.game-card {
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

.game-card:hover {
  transform: translateY(-8px) rotate(1deg);
  box-shadow: 0 20px 40px rgba(0,0,0,0.6);
  border-color: rgba(107,164,248,0.3);
}

.thumb-wrap {
  position: relative;
  aspect-ratio: 1 / 1; /* keep square thumbnails */
  width: 100%;
  overflow: hidden;
  background: var(--gradient-3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* show full image, don’t crop */
  transition: transform 0.3s ease;
}

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

.thumb-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  background: linear-gradient(135deg, rgba(74,134,232,0.7) 0%, rgba(107,164,248,0.5) 100%);
}

.game-card:hover .thumb-overlay {
  opacity: 1;
}

.play-label {
  background: rgba(255,255,255,0.9);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
}

.info {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  flex: 1;
}

.game-title {
  margin: 0;
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  font-family: 'Luckiest Guy', sans-serif;
}

.game-desc {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
  flex: 1;
  font-family: 'JetBrains Mono', monospace;
}

.card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.fav-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--muted);
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s ease;
  min-width: 36px;
  text-align: center;
}

.fav-btn:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(107,164,248,0.3);
}

.fav-btn.added {
  background: var(--gradient-1);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(74,134,232,0.3);
}

.category-tag {
  font-size: 0.8rem;
  color: var(--accent-2);
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  background: rgba(74,134,232,0.1);
  font-weight: 500;
  font-family: 'JetBrains Mono', monospace;
}

/* hidden utility class */
.hidden{display:none !important}
.game-card.filtered-out{display:none !important}
.no-results{color:#9aa6c2;padding:0.5rem 0}

/* Responsive design */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }
  
  .hero-section h2 {
    font-size: 2rem;
  }
  
  .course-card {
    text-align: center;
  }
  
  .courses-vertical {
    grid-template-columns: 1fr;
  }
  
  .why-choose-grid {
    grid-template-columns: 1fr;
  }
  
  .games-grid {
    grid-template-columns: repeat(2,1fr);
  }
}

@media (max-width: 480px) {
  .games-grid {
    grid-template-columns: 1fr;
  }
  
  .hero-section h2 {
    font-size: 1.8rem;
  }
}

/* 🔹 Code snippet display */
.code-snippet-section {
  background: #0e0e0e;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  margin: 3rem auto;
  max-width: 800px;
  font-family: 'JetBrains Mono', monospace;
}

.snippet-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #1b1b1b;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.snippet-header .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.snippet-header .dot.red { background: #ff5f56; }
.snippet-header .dot.yellow { background: #ffbd2e; }
.snippet-header .dot.green { background: #27c93f; }

.snippet-title {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.9rem;
}

.code-snippet-section pre {
  margin: 0;
  padding: 1.5rem;
  color: #b8d4ff;
  font-size: 0.85rem;
  line-height: 1.4;
  white-space: pre;
  overflow-x: auto;
}

.code-snippet-section code {
  display: block;
  background: none;
}
