/* ════════════════════════════════════════════════════════════
   FREE AI GAMES  ·  home.css
   Homepage Styling - Games Directory
   ════════════════════════════════════════════════════════════ */

/* ── 1. CSS CUSTOM PROPERTIES ──────────────────────────────── */
:root {
  /* Primary Palette */
  --clr-primary:    #6366f1;
  --clr-primary-light: #818cf8;
  --clr-accent:     #ec4899;
  --clr-accent-light: #f472b6;
  --clr-success:    #10b981;
  --clr-warning:    #f59e0b;

  /* Dark theme (default) */
  --bg:             #0f172a;
  --bg-secondary:   #1e293b;
  --bg-tertiary:    #334155;
  --glass:          rgba(255, 255, 255, 0.045);
  --glass-border:   rgba(255, 255, 255, 0.09);
  --glass-shadow:   0 8px 40px rgba(0, 0, 0, 0.5);
  --txt:            #f1f5f9;
  --txt-dim:        rgba(241, 245, 249, 0.6);
  --txt-dimmer:     rgba(241, 245, 249, 0.4);

  /* Light theme */
  --bg-light:       #f8fafc;
  --bg-light-secondary: #e2e8f0;
  --txt-dark:       #1e293b;
  --txt-dark-dim:   rgba(30, 41, 59, 0.7);

  /* Spacing & shape */
  --radius:         16px;
  --radius-lg:      24px;
  --shadow-sm:      0 2px 8px rgba(0, 0, 0, 0.15);
  --shadow-md:      0 4px 16px rgba(0, 0, 0, 0.25);
  --shadow-lg:      0 8px 32px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] {
  --bg: var(--bg-light);
  --bg-secondary: var(--bg-light-secondary);
  --txt: var(--txt-dark);
  --txt-dim: var(--txt-dark-dim);
  --glass: rgba(0, 0, 0, 0.03);
  --glass-border: rgba(0, 0, 0, 0.08);
  --glass-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* ── 2. RESET & BASE STYLES ──────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--txt);
  line-height: 1.6;
}

/* ── 3. UTILITY CLASSES ──────────────────────────────────── */
.hidden {
  display: none !important;
}

.glass-card {
  background: var(--glass);
  backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius);
}

/* ── 4. HOME CONTAINER ────────────────────────────────────── */
.home-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-secondary) 100%);
}

/* ── 5. HEADER ────────────────────────────────────────────── */
.home-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 1.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(8px);
}

.header-content {
  flex: 1;
}

.site-title {
  font-size: 2rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--clr-primary) 0%, var(--clr-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.25rem;
}

.site-subtitle {
  font-size: 0.95rem;
  color: var(--txt-dim);
}

.header-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--txt);
  transition: all 0.3s ease;
}

.icon-btn:hover {
  background: var(--glass-border);
  transform: scale(1.05);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

/* ── 6. AD CONTAINERS ────────────────────────────────────── */
.ad-container {
  padding: 1rem;
  margin: 0 auto;
  width: 100%;
  max-width: 1200px;
}

.ad-top {
  margin-top: 1rem;
}

.ad-bottom {
  margin-bottom: 1rem;
  margin-top: 2rem;
}

.adsbygoogle {
  display: block;
  min-height: 250px;
}

/* ── 7. GAMES SECTION ────────────────────────────────────── */
.games-section {
  flex: 1;
  padding: 3rem 1.5rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 3rem;
  text-align: center;
  background: linear-gradient(135deg, var(--txt) 0%, var(--txt-dim) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── 8. GAMES GRID ────────────────────────────────────────  */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

/* ── 9. GAME CARD ────────────────────────────────────────── */
.game-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.320, 1);
  position: relative;
  text-decoration: none;
  color: inherit;
}

.game-card-1 {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(236, 72, 153, 0.1) 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  cursor: pointer;
}

.game-card-1:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(99, 102, 241, 0.3);
  border-color: rgba(99, 102, 241, 0.6);
}

.game-card-coming {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  opacity: 0.75;
}

.game-card-coming:hover {
  opacity: 0.85;
}

.game-card-header {
  position: relative;
  padding: 2rem 1.5rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(236, 72, 153, 0.15) 100%);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
}

.game-icon {
  font-size: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.coming-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: var(--clr-warning);
  color: #000;
  padding: 0.375rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.game-card-content {
  flex: 1;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.game-name {
  font-size: 1.5rem;
  font-weight: 700;
}

.game-description {
  font-size: 0.95rem;
  color: var(--txt-dim);
  margin: 0.5rem 0;
}

.game-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: auto;
}

.tag {
  display: inline-block;
  background: rgba(99, 102, 241, 0.2);
  color: var(--clr-primary-light);
  padding: 0.375rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.game-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--glass-border);
}

.play-btn {
  width: 100%;
  padding: 0.875rem 1.5rem;
  background: linear-gradient(135deg, var(--clr-primary) 0%, var(--clr-accent) 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.play-btn:hover:not(:disabled) {
  transform: scale(1.02);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.play-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── 10. FOOTER ──────────────────────────────────────────── */
.home-footer {
  padding: 2rem 1.5rem;
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid var(--glass-border);
  text-align: center;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-content p {
  color: var(--txt-dim);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--clr-primary);
  text-decoration: none;
  transition: color 0.3s ease;
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: var(--clr-accent);
}

/* ── 11. THEME TOGGLE ────────────────────────────────────── */
@media (prefers-color-scheme: light) {
  html:not([data-theme="dark"]) {
    --bg: var(--bg-light);
    --bg-secondary: var(--bg-light-secondary);
    --txt: var(--txt-dark);
    --txt-dim: var(--txt-dark-dim);
  }
}

/* ── 12. RESPONSIVE DESIGN ───────────────────────────────── */
@media (max-width: 768px) {
  .home-header {
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem 1rem;
  }

  .header-content {
    text-align: center;
  }

  .site-title {
    font-size: 1.75rem;
  }

  .section-title {
    font-size: 1.75rem;
    margin-bottom: 2rem;
  }

  .games-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1rem 0;
  }

  .games-section {
    padding: 2rem 1rem;
  }

  .game-card-header {
    padding: 1.5rem 1rem;
    min-height: 100px;
  }

  .game-icon {
    font-size: 2.5rem;
  }

  .footer-links {
    gap: 1rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .site-title {
    font-size: 1.5rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .game-name {
    font-size: 1.25rem;
  }

  .game-description {
    font-size: 0.85rem;
  }

  .home-header {
    padding: 1rem;
  }

  .games-section {
    padding: 1.5rem 1rem;
  }

  .game-card-content {
    padding: 1rem;
  }

  .ad-container {
    padding: 0.5rem;
  }
}
