/* Austin Nguyen Author Site - Multi-Theme Support */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Theme Variables */
:root {
  /* Dark Theme (Default) */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a24;
  --text-primary: #e8e8ed;
  --text-secondary: #a0a0b0;
  --accent: #4a9eff;
  --accent-hover: #6bb3ff;
  --border: #2a2a3a;
  --success: #4ade80;
  --warning: #fbbf24;
  --oracle-bg: #12121a;
  --oracle-text: #4ade80;
}

[data-theme="light"] {
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f7;
  --bg-card: #ffffff;
  --text-primary: #1a1a1a;
  --text-secondary: #666666;
  --accent: #0066cc;
  --accent-hover: #0052a3;
  --border: #e0e0e0;
  --success: #22c55e;
  --warning: #f59e0b;
  --oracle-bg: #f0f7ff;
  --oracle-text: #0066cc;
}

[data-theme="paper"] {
  --bg-primary: #f4ecd8;
  --bg-secondary: #ebe3d0;
  --bg-card: #f9f3e3;
  --text-primary: #3d3929;
  --text-secondary: #6b6452;
  --accent: #8b4513;
  --accent-hover: #a0522d;
  --border: #d4c9b0;
  --success: #2d5a27;
  --warning: #b8860b;
  --oracle-bg: #ebe3d0;
  --oracle-text: #2d5a27;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Theme Switcher */
.theme-switcher {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1rem;
  padding: 0.5rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.theme-btn {
  padding: 0.5rem 1rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
  font-family: inherit;
}

.theme-btn:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.theme-btn.active {
  background: var(--accent);
  color: #fff;
}

/* Header */
header {
  text-align: center;
  padding: 3rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

header .subtitle {
  font-size: 1.1rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

header .author {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* Navigation */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

nav a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

nav a:hover {
  color: var(--accent-hover);
}

/* Article Content */
article {
  margin-bottom: 3rem;
}

article p {
  margin-bottom: 1.5rem;
  text-align: left;
  color: var(--text-primary);
}

article h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

article h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 2.5rem 0 1rem;
  color: var(--text-primary);
}

.chapter-subtitle {
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

.part-title {
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

/* Oracle Text */
.oracle-text {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  background: var(--oracle-bg);
  border-left: 3px solid var(--accent);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  display: block;
  color: var(--oracle-text);
  font-size: 0.9rem;
  border-radius: 0 8px 8px 0;
}

/* Scene Break */
.scene-break {
  text-align: center;
  margin: 2.5rem 0;
  color: var(--text-secondary);
  font-size: 1.2rem;
  letter-spacing: 0.5em;
}

/* Timestamp */
.timestamp {
  text-align: center;
  font-weight: 700;
  color: var(--warning);
  margin: 2rem 0;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}

/* Table of Contents */
.toc {
  list-style: none;
  margin: 2rem 0;
}

.toc li {
  margin-bottom: 0;
}

.toc a {
  display: flex;
  align-items: center;
  padding: 1rem;
  color: var(--text-primary);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s;
  gap: 1rem;
}

.toc a:hover {
  background: var(--bg-card);
}

.toc a.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.toc .chapter-number {
  color: var(--accent);
  font-weight: 600;
  min-width: 90px;
}

.toc .chapter-title {
  flex: 1;
}

.toc .coming-soon {
  font-size: 0.75rem;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-weight: 500;
}

.toc .part-header {
  font-weight: 700;
  color: var(--accent);
  padding: 1.5rem 1rem 0.5rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-top: 1px solid var(--border);
  margin-top: 1rem;
}

.toc .part-header:first-child {
  border-top: none;
  margin-top: 0;
}

/* Chapter Navigation */
.chapter-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}

.chapter-nav a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  transition: all 0.2s;
}

.chapter-nav a:hover {
  background: var(--bg-card);
  color: var(--accent-hover);
}

.chapter-nav .coming-soon {
  color: var(--text-secondary);
  font-style: italic;
}

/* Buy Box */
.buy-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  margin: 2rem 0;
}

.buy-box h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.buy-box p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

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

.buy-btn {
  display: inline-block;
  padding: 0.875rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s;
}

.buy-btn.amazon {
  background: #ff9900;
  color: #000;
}

.buy-btn.amazon:hover {
  background: #ffad33;
}

.buy-btn.paperback {
  background: var(--accent);
  color: #fff;
}

.buy-btn.paperback:hover {
  background: var(--accent-hover);
}

/* Contact Button */
.contact-btn {
  display: inline-block;
  padding: 0.875rem 2rem;
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s;
  margin-top: 1rem;
}

.contact-btn:hover {
  background: var(--accent);
  color: #fff;
}

/* Book Card */
.book-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  margin: 1.5rem 0;
  transition: all 0.2s;
}

.book-card:hover {
  border-color: var(--accent);
}

.book-card h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.book-card .genre {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.book-card p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.book-card a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.book-card a:hover {
  color: var(--accent-hover);
}

/* Ad Containers */
.ad-container {
  background: var(--bg-secondary);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  margin: 1.5rem 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

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

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

/* Footer */
footer {
  text-align: center;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

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

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

/* Author Bio */
.author-bio {
  text-align: center;
  padding: 2rem 0;
}

.author-bio h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.author-bio .tagline {
  color: var(--accent);
  font-size: 1.2rem;
  font-weight: 500;
  margin-bottom: 2rem;
}

.author-bio .bio-text {
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2rem;
  line-height: 1.8;
}

/* CTA Button - Orange Gradient */
.cta-button {
  display: inline-block;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #ff6b35 0%, #ff9500 50%, #ffb347 100%);
  color: #fff !important;
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 53, 0.5);
  background: linear-gradient(135deg, #ff7f50 0%, #ffa500 50%, #ffc966 100%);
  color: #fff !important;
}

.cta-button:active {
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 640px) {
  body {
    font-size: 16px;
  }
  
  header h1, .author-bio h1 {
    font-size: 2rem;
  }
  
  article h1 {
    font-size: 1.75rem;
  }
  
  .container {
    padding: 1.5rem 1rem;
  }
  
  .buy-buttons {
    flex-direction: column;
  }
  
  .buy-btn {
    width: 100%;
  }
  
  .chapter-nav {
    flex-direction: column;
    gap: 1rem;
  }
  
  .theme-switcher {
    flex-wrap: wrap;
  }
  
  .theme-btn {
    flex: 1;
    min-width: 80px;
  }
}
