/* ========================================
   SUMWORDS LANDING PAGE STYLES
   Modern, clean design with responsive layout
   ======================================== */

/* CSS Variables for Theming */
:root {
  /* Primary Colors */
  --color-primary-orange: #ff8c42;
  --color-primary-orange-dark: #ff6b35;
  --color-primary-orange-light: #ff9d5c;
  --color-primary-orange-lighter: #ff7b45;

  --color-primary-blue: #4a90e2;
  --color-primary-blue-dark: #357abd;

  /* Backgrounds */
  --bg-hero: #ffffff;
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-card: #f8f9fa;
  --bg-card-alt: #ffffff;

  /* Text Colors */
  --text-primary: #333333;
  --text-secondary: #666666;
  --text-light: #cbd5e0;
  --text-on-dark: #ffffff;

  /* Borders & Dividers */
  --border-light: #f0f0f0;
  --border-color: #e0e0e0;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 2px 10px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 6px 20px rgba(255, 107, 53, 0.4);
  --shadow-orange: 0 4px 15px rgba(255, 107, 53, 0.3);
  --shadow-orange-hover: 0 4px 12px rgba(255, 107, 53, 0.3);

  /* Footer */
  --bg-footer: #2d3748;
}

/* ========================================
   DARK THEME OVERRIDES
   Applied when [data-theme="dark"] is set on <html>
   ======================================== */
[data-theme='dark'] {
  /* Primary Colors - Keep brand colors vibrant */
  --color-primary-orange: #ff9d5c;
  --color-primary-orange-dark: #ff8c42;
  --color-primary-orange-light: #ffae7a;
  --color-primary-orange-lighter: #ff7b45;

  --color-primary-blue: #5ca4ff;
  --color-primary-blue-dark: #4a90e2;

  /* Backgrounds - Dark grays */
  --bg-hero: #1a1a1a;
  --bg-primary: #1a1a1a;
  --bg-secondary: #0f0f0f;
  --bg-card: #2d2d2d;
  --bg-card-alt: #252525;

  /* Text Colors - Light grays for readability */
  --text-primary: #e0e0e0;
  --text-secondary: #b0b0b0;
  --text-light: #808080;
  --text-on-dark: #ffffff;

  /* Borders & Dividers - Subtle contrast */
  --border-light: #404040;
  --border-color: #3a3a3a;

  /* Shadows - Lighter and more subtle */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 2px 10px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 6px 20px rgba(255, 157, 92, 0.3);
  --shadow-orange: 0 4px 15px rgba(255, 157, 92, 0.25);
  --shadow-orange-hover: 0 4px 12px rgba(255, 157, 92, 0.35);

  /* Footer - Slightly lighter than body */
  --bg-footer: #1f1f1f;
}

/* Smooth transitions when switching themes */
body,
.hero,
.stats,
.how-to-play,
.features,
.categories,
.cta,
footer,
.stat-card,
.step,
.feature-card,
.category-tag,
.btn-primary,
.btn-secondary {
  transition: background-color 0.3s ease, color 0.3s ease,
    border-color 0.3s ease;
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-secondary);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Hero Section */
.hero {
  background: var(--bg-hero);
  color: var(--text-primary);
  padding: 100px 20px;
  text-align: center;
  border-bottom: 3px solid var(--border-light);
}

.logo-image {
  max-width: 600px;
  width: 90%;
  height: auto;
  margin-bottom: 30px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.tagline {
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 15px;
  opacity: 0.95;
}

.subtitle {
  font-size: 1.1rem;
  margin-bottom: 40px;
  color: var(--text-secondary);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.cta-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 15px 40px;
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(
    135deg,
    var(--color-primary-orange) 0%,
    var(--color-primary-orange-dark) 100%
  );
  color: var(--text-on-dark);
  box-shadow: var(--shadow-orange);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
  background: linear-gradient(
    135deg,
    var(--color-primary-orange-light) 0%,
    var(--color-primary-orange-lighter) 100%
  );
}

.btn-secondary {
  background-color: var(--bg-primary);
  color: var(--color-primary-blue);
  border: 2px solid var(--color-primary-blue);
}

.btn-secondary:hover {
  background-color: var(--color-primary-blue);
  color: var(--text-on-dark);
  transform: translateY(-2px);
}

.btn-large {
  padding: 18px 50px;
  font-size: 1.2rem;
}

/* Stats Section */
.stats {
  background-color: var(--bg-primary);
  padding: 60px 20px;
  box-shadow: var(--shadow-md);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  text-align: center;
}

.stat-number {
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--color-primary-orange-dark);
  margin-bottom: 10px;
}

.stat-label {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.stats-figure {
  margin: 2rem auto 0;
  text-align: center;
}

.stats-figure img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.stats-figure figcaption {
  font-size: 0.9rem;
  opacity: 0.8;
  margin-top: 0.5rem;
}

/* How to Play Section */
.how-to-play {
  padding: 80px 20px;
  background-color: var(--bg-secondary);
}

.how-to-play h2 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 50px;
  color: var(--text-primary);
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
}

.step {
  background-color: var(--bg-card-alt);
  padding: 30px;
  border-radius: 12px;
  text-align: center;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.step:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.step-number {
  width: 50px;
  height: 50px;
  background: linear-gradient(
    135deg,
    var(--color-primary-blue) 0%,
    var(--color-primary-blue-dark) 100%
  );
  color: var(--text-on-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 auto 20px;
}

.step h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.step p {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* Tips Section (within How to Play) */
.tips-section {
  margin-top: 60px;
  padding-top: 60px;
  border-top: 2px solid var(--border-light);
}

.tips-section h3 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 40px;
  color: var(--text-primary);
}

.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  max-width: 1200px;
  margin: 0 auto;
}

.tip-card {
  background-color: var(--bg-card);
  padding: 25px;
  border-radius: 10px;
  border-left: 4px solid var(--color-primary-orange);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tip-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.tip-card strong {
  display: block;
  color: var(--color-primary-orange);
  font-size: 1.1rem;
  margin-bottom: 8px;
  font-weight: 600;
}

/* Features Section */
/* Features Section */
.features {
  padding: 80px 20px;
  background-color: var(--bg-primary);
}

.features h2 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 50px;
  color: var(--text-primary);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.feature-card {
  background-color: var(--bg-card);
  padding: 30px;
  border-radius: 12px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 15px;
}

.feature-card h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* Categories Section */
.categories {
  padding: 80px 20px;
  background-color: var(--bg-secondary);
}

.categories h2 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 40px;
  color: var(--text-primary);
}

.category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
}

.category-tag {
  background-color: var(--border-light);
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: 25px;
  font-weight: 500;
  font-size: 1rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.category-tag:hover {
  background: linear-gradient(
    135deg,
    var(--color-primary-orange) 0%,
    var(--color-primary-orange-dark) 100%
  );
  color: var(--text-on-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-orange-hover);
}

.everything-tag {
  background: linear-gradient(
    135deg,
    var(--color-primary-orange) 0%,
    var(--color-primary-orange-dark) 100%
  );
  color: var(--text-on-dark);
  font-weight: 600;
}

.everything-tag:hover {
  background: var(--border-light);
  color: var(--text-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* CTA Section */
.cta {
  background: linear-gradient(
    135deg,
    var(--color-primary-blue) 0%,
    var(--color-primary-blue-dark) 100%
  );
  color: var(--text-on-dark);
  padding: 80px 20px;
  text-align: center;
}

.cta h2 {
  font-size: 2.5rem;
  margin-bottom: 15px;
}

.cta p {
  font-size: 1.2rem;
  margin-bottom: 30px;
  opacity: 0.9;
}

/* Footer */
footer {
  background-color: var(--bg-footer);
  color: var(--text-light);
  padding: 40px 20px;
  text-align: center;
}

footer p {
  margin-bottom: 10px;
}

footer a {
  color: var(--color-primary-orange);
  text-decoration: none;
  transition: color 0.3s ease;
}

footer a:hover {
  color: var(--color-primary-orange-dark);
}

/* ========================================
   THEME TOGGLE BUTTON
   Fixed position button for switching themes
   ======================================== */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  z-index: 1000;
  padding: 0;
}

.theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary-orange);
}

.theme-toggle:active {
  transform: scale(0.95);
}

/* Icon visibility based on theme */
.theme-toggle .sun-icon,
.theme-toggle .moon-icon {
  position: absolute;
  transition: opacity 0.3s ease, transform 0.3s ease;
  color: var(--text-primary);
}

/* Light mode: show moon icon (to switch to dark) */
.theme-toggle .sun-icon {
  opacity: 0;
  transform: rotate(-90deg);
}

.theme-toggle .moon-icon {
  opacity: 1;
  transform: rotate(0deg);
}

/* Dark mode: show sun icon (to switch to light) */
[data-theme='dark'] .theme-toggle .sun-icon {
  opacity: 1;
  transform: rotate(0deg);
}

[data-theme='dark'] .theme-toggle .moon-icon {
  opacity: 0;
  transform: rotate(90deg);
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .theme-toggle {
    width: 45px;
    height: 45px;
    top: 15px;
    right: 15px;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .logo-image {
    max-width: 400px;
  }

  .tagline {
    font-size: 1.2rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  .hero {
    padding: 60px 20px;
  }

  .how-to-play h2,
  .features h2,
  .categories h2,
  .cta h2 {
    font-size: 2rem;
  }

  .stat-number {
    font-size: 2.5rem;
  }

  .btn {
    padding: 12px 30px;
    font-size: 1rem;
  }

  .btn-large {
    padding: 15px 40px;
    font-size: 1.1rem;
  }

  .steps {
    grid-template-columns: 1fr;
  }

  .tips-section h3 {
    font-size: 1.5rem;
  }

  .tips-grid {
    grid-template-columns: 1fr;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .logo-image {
    max-width: 280px;
  }

  .cta-buttons {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    max-width: 300px;
  }
}
