/*
 * Main stylesheet for the Chicken Road Game website.
 * This stylesheet defines the colour palette, typography and layout.
 * Updated to include a modern Google Font (Inter), a top navigation
 * bar for internal pages and card‑style content blocks for improved
 * readability and visual separation.
 */

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

:root {
  /* Default (purple) theme variables */
  --primary-color: #6E3CB2;
  --secondary-color: #E84DC5;
  --background-color: #0f0e23;
  --text-color: #ffffff;
  --accent-color: #74F0ED;
}

/* Theme variations loaded via the class on the body element.
 * Each theme overrides the CSS custom properties defined above.
 * Colours are chosen based on 2025 design trends emphasising
 * vibrant palettes, chromatic gradients, nature‑inspired tones,
 * retro pastels and futuristic chrome finishes【477430118674739†L64-L102】. */
.theme-default {
  --primary-color: #6E3CB2;
  --secondary-color: #E84DC5;
  --background-color: #0f0e23;
  --text-color: #ffffff;
  --accent-color: #74F0ED;
}
.theme-vibrant {
  /* Bold palette: electric blue and vivid coral with golden accent【477430118674739†L64-L76】. */
  --primary-color: #007BFF;
  --secondary-color: #FF5A5F;
  --background-color: #071E3D;
  --text-color: #ffffff;
  --accent-color: #FFD700;
}
.theme-gradient {
  /* Chromatic gradient inspired palette: deep purple and magenta with cyan accent【477430118674739†L79-L89】. */
  --primary-color: #8A00D4;
  --secondary-color: #FF2D95;
  --background-color: #050014;
  --text-color: #ffffff;
  --accent-color: #00E6E6;
}
.theme-nature {
  /* Nature‑inspired colours: forest green, earthy brown and fresh mint【477430118674739†L117-L124】. */
  --primary-color: #2C6E49;
  --secondary-color: #BC6C25;
  --background-color: #0B3D2E;
  --text-color: #F1FAEE;
  --accent-color: #A7C957;
}
.theme-retro {
  /* Optimistic pastel palette: lavender, blush and pale blue【477430118674739†L131-L143】. */
  --primary-color: #8E7CC3;
  --secondary-color: #F7CAC9;
  --background-color: #1D1028;
  --text-color: #F7F7F7;
  --accent-color: #92B4EC;
}
.theme-chrome {
  /* Futuristic metallic palette: cool blues and silver accents【477430118674739†L104-L115】. */
  --primary-color: #AEB8FE;
  --secondary-color: #9FA8DA;
  --background-color: #101010;
  --text-color: #E0E0E0;
  --accent-color: #80CBC4;
}

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

body {
  /* Use a modern sans‑serif font from Google Fonts */
  font-family: 'Inter', Arial, Helvetica, sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.6;
}

/* Hero section */
/* Hero section styling. Background image is injected via inline
 * style on the element to support dynamic images loaded from content.json. */
.hero {
  background-size: cover;
  background-position: center;
  position: relative;
  /* Increased padding for a more spacious first screen, emphasising the hero content. */
  padding: 7rem 2rem;
  text-align: center;
}

.hero::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  /* Slightly reduce the overlay opacity to let background artwork shine through while preserving contrast. */
  background: linear-gradient(180deg, rgba(15,14,35,0.7) 0%, rgba(15,14,35,0.7) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  /* Larger heading for stronger impact on the first screen. */
  font-size: 3rem;
  margin-bottom: 1.25rem;
  color: var(--primary-color);
}

.hero p {
  /* Slightly larger paragraph text for readability and conversion focus. */
  font-size: 1.25rem;
  margin-bottom: 2.5rem;
  color: #dddddd;
}

.button {
  display: inline-block;
  padding: 0.9rem 1.8rem;
  margin: 0.3rem;
  border-radius: 40px;
  text-decoration: none;
  font-weight: bold;
  transition: background 0.3s, box-shadow 0.3s;
  /* Subtle shadow to give buttons a sense of depth, encouraging clicks. */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.button.primary {
  /* Use a gradient for the primary button to stand out and drive conversions. */
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: #fff;
}

.button.primary:hover {
  /* On hover, reverse the gradient for a dynamic feel. */
  background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
}

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

.button.secondary:hover {
  background: var(--primary-color);
  color: #fff;
}

/* Top navigation bar for internal pages */
.main-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: rgba(255, 255, 255, 0.05);
  position: relative;
  z-index: 10;
}
.main-nav .logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent-color);
}
.main-nav .logo img {
  /* Increase the default height of the logo to improve visibility. According to
     modern design guidelines, navigation bar logos often use sizes around
     250×100px (3:2) or 160×160px for square logos【495169937670638†L120-L127】. We set
     the height to 60px here to allow slightly larger logos while keeping
     proportions. Width remains automatic to preserve the aspect ratio. */
  height: 60px;
  width: auto;
  display: block;
}
.main-nav ul {
  list-style: none;
  display: flex;
  gap: 1rem;
}
.main-nav a {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  transition: background 0.3s;
  display: block;
}
.main-nav a:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Menu toggle button for mobile nav */
.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--accent-color);
  font-size: 1.8rem;
  cursor: pointer;
}

/* Card/block container for content sections */
.block {
  background: rgba(255, 255, 255, 0.05);
  padding: 2rem;
  border-radius: 12px;
  margin-bottom: 2rem;
}

/* Layout for sections with images */
.content-block {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.content-block.reverse {
  flex-direction: row-reverse;
}
.content-block .block-image {
  flex: 1 1 40%;
}
.content-block .block-image img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  object-fit: cover;
}
.content-block .block-text {
  flex: 1 1 60%;
}

@media (max-width: 768px) {
  .content-block {
    flex-direction: column;
  }
  .content-block.reverse {
    flex-direction: column;
  }
  .content-block .block-image,
  .content-block .block-text {
    flex: 1 1 100%;
  }
}

/* Table of contents navigation */
nav.toc {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.5rem;
  overflow-x: auto;
  white-space: nowrap;
}

nav.toc a {
  color: var(--accent-color);
  margin-right: 1rem;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  display: inline-block;
  transition: background 0.3s;
}

nav.toc a:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Containers and sections */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 0;
}

section {
  margin-top: 2rem;
}

section h2 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

section p {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: #cccccc;
}

/* Features section */
.features {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  margin-top: 2rem;
}

.feature {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 1.5rem;
  width: calc(33.33% - 1rem);
  margin: 0.5rem;
  text-align: center;
}

.feature .icon svg {
  width: 40px;
  height: 40px;
  fill: var(--primary-color);
  margin-bottom: 1rem;
}

/* When feature icons are images */
.feature .icon img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  margin-bottom: 1rem;
}

.feature h3 {
  margin-bottom: 0.5rem;
  color: var(--accent-color);
}

.feature p {
  font-size: 0.9rem;
  color: #cccccc;
}

/* Sticky call‑to‑action button displayed on mobile devices.
 * Placed near bottom of the viewport and styled with the current theme colours.
 * Hidden on desktop; visible on screens up to 768px【411734136862197†L67-L76】. */
.mobile-cta {
  display: none;
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 2rem);
  background: var(--primary-color);
  color: var(--text-color);
  padding: 1rem 1.2rem;
  border-radius: 50px;
  text-align: center;
  font-weight: 700;
  z-index: 1000;
  text-decoration: none;
  transition: background 0.3s, box-shadow 0.3s;
  font-size: 1.1rem;
  /* Add subtle shadow for prominence on mobile screens. */
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}
.mobile-cta:hover {
  background: var(--secondary-color);
}

/* Admin styles */
.admin-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
}

.admin-container h1 {
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.admin-container form {
  background: rgba(255, 255, 255, 0.05);
  padding: 1rem;
  border-radius: 10px;
  margin-bottom: 2rem;
}

.admin-container label {
  display: block;
  margin-top: 1rem;
}

.admin-container textarea,
.admin-container input[type="text"] {
  width: 100%;
  padding: 0.5rem;
  margin-top: 0.5rem;
  border: 1px solid #555;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.admin-container input[type="submit"] {
  background: var(--primary-color);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 5px;
  margin-top: 1rem;
  cursor: pointer;
  transition: background 0.3s;
}

.admin-container input[type="submit"]:hover {
  background: var(--secondary-color);
}

/* Responsive behaviour */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.4rem;
  }
  .hero p {
    font-size: 1.1rem;
  }
  .feature {
    width: 100%;
  }

  /* Responsive navigation: hide menu items and show toggle */
  .main-nav ul {
    flex-direction: column;
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(15, 14, 35, 0.95);
    width: 200px;
    padding: 1rem;
    display: none;
  }
  .main-nav ul.open {
    display: flex;
  }
  .menu-toggle {
    display: block;
  }
  .main-nav ul li {
    margin-bottom: 0.5rem;
  }
  .main-nav {
    flex-wrap: wrap;
  }

  /* Show sticky CTA button on mobile screens */
  .mobile-cta {
    display: block;
  }
}