/* CSS Custom Properties for Theme Support */
:root {
  /* Light theme (default) */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --text-primary: #212529;
  --text-secondary: #6c757d;
  --accent-primary: #0d6efd;
  --accent-secondary: #6c757d;
  --accent-hover: #0b5ed7;
  --border-color: #dee2e6;
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Dark theme */
[data-theme="dark"] {
  --bg-primary: #1a1a1a;
  --bg-secondary: #2d2d2d;
  --text-primary: #ffffff;
  --text-secondary: #cccccc;
  --accent-primary: #4a90e2;
  --accent-secondary: #888888;
  --accent-hover: #357abd;
  --border-color: #404040;
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 4px 8px rgba(0, 0, 0, 0.4);
}

/* Colorblind-friendly theme */
[data-theme="colorblind"] {
  --bg-primary: #fefefe;
  --bg-secondary: #f0f0f0;
  --text-primary: #2c2c2c;
  --text-secondary: #666666;
  --accent-primary: #1f4e79;
  --accent-secondary: #7a7a7a;
  --accent-hover: #15365a;
  --border-color: #cccccc;
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* 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-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header and Navigation */
header {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

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

.logo h1 {
  font-size: 1.5rem;
  color: var(--accent-primary);
  transition: color 0.3s ease;
}

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

.nav-menu a {
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
  background-color: var(--accent-primary);
  color: white;
}

.theme-switcher {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#theme-toggle {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

#theme-toggle:hover {
  border-color: var(--accent-primary);
}

#theme-select {
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

#theme-select:hover {
  border-color: var(--accent-primary);
}

/* Main content */
main {
  min-height: calc(100vh - 120px);
}

/* Hero section */
.hero {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  padding: 4rem 0;
  text-align: center;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

.hero h2 {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Page header */
.page-header {
  background-color: var(--bg-secondary);
  padding: 3rem 0;
  text-align: center;
}

.page-header h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.page-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background-color: var(--accent-primary);
  color: white;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

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

.btn-secondary:hover {
  background-color: var(--accent-primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

/* Content sections */
.content-section,
.book-info,
.authors,
.book-background,
.contact-info,
.privacy-content {
  padding: 4rem 0;
}

.content-section:nth-child(even),
.book-background:nth-child(even) {
  background-color: var(--bg-secondary);
}

.content-section h3,
.book-info h3,
.authors h3,
.book-background h3,
.contact-info h3 {
  font-size: 2rem;
  margin-bottom: 2rem;
  text-align: center;
  color: var(--text-primary);
}

.content-section p,
.book-info p,
.authors p,
.book-background p,
.contact-info p {
  font-size: 1.125rem;
  margin-bottom: 1.5rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

/* Features grid */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.feature {
  text-align: center;
  padding: 2rem;
  border-radius: 8px;
  background-color: var(--bg-primary);
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.feature:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.feature h4 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--accent-primary);
}

.feature p {
  color: var(--text-secondary);
  margin-bottom: 0;
  text-align: left;
}

/* Author grid */
.author-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 3rem;
  margin-top: 2rem;
}

.author {
  background-color: var(--bg-primary);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.author:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.author h3 {
  color: var(--accent-primary);
  margin-bottom: 0.5rem;
  text-align: left;
}

.author-title {
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 1rem;
  text-align: left !important;
}

.author p {
  text-align: left;
  margin-left: 0;
  margin-right: 0;
  max-width: none;
}

/* Motivations grid */
.motivations {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.motivation {
  background-color: var(--bg-primary);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.motivation:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.motivation h4 {
  color: var(--accent-primary);
  margin-bottom: 1rem;
}

.motivation p {
  text-align: left;
  margin: 0;
  max-width: none;
}

/* Contact grid */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.contact {
  background-color: var(--bg-primary);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: var(--shadow);
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.contact:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.contact h4 {
  color: var(--accent-primary);
  margin-bottom: 1rem;
}

.contact p {
  margin: 0;
  max-width: none;
}

/* Book links */
.book-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2rem;
}

/* Privacy policy styles */
.privacy-section {
  margin-bottom: 3rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.privacy-section h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--accent-primary);
  text-align: left;
}

.privacy-section p {
  text-align: left;
  margin-left: 0;
  margin-right: 0;
  max-width: none;
  margin-bottom: 1rem;
}

.privacy-section ul {
  margin-left: 2rem;
  margin-bottom: 1rem;
}

.privacy-section li {
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.privacy-section strong {
  color: var(--accent-primary);
}

/* Footer */
footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
  text-align: center;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

footer p {
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

footer a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

footer a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* Responsive design */
@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    gap: 1rem;
  }

  .nav-menu {
    flex-direction: column;
    gap: 1rem;
    width: 100%;
  }

  .theme-switcher {
    justify-content: center;
  }

  .hero h2 {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1.125rem;
  }

  .page-header h2 {
    font-size: 2rem;
  }

  .cta-buttons {
    flex-direction: column;
    align-items: center;
  }

  .features {
    grid-template-columns: 1fr;
  }

  .author-grid {
    grid-template-columns: 1fr;
  }

  .motivations {
    grid-template-columns: 1fr;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .book-links {
    flex-direction: column;
    align-items: center;
  }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus styles for keyboard navigation */
button:focus,
select:focus,
a:focus {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 4px 8px rgba(0, 0, 0, 0.4);
  }
  
  [data-theme="dark"] {
    --bg-primary: #000000;
    --bg-secondary: #1a1a1a;
    --text-primary: #ffffff;
    --border-color: #666666;
  }
}