/* Reset and base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* CSS variables matching BGrid theme */
:root {
  --color-background: #1a2332;
  --color-surface: #2c3e50;
  --color-surface-muted: #34495e;
  --color-accent: #3498db;
  --color-accent-dark: #2980b9;
  --color-text-primary: #ffffff;
  --color-text-secondary: #8b9dc3;
  --color-border: rgba(255, 255, 255, 0.1);
  --color-success: #27ae60;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--color-background);
  color: var(--color-text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

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

/* Header */
.header {
  background: var(--color-surface);
  padding: 20px 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.brand-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--color-text-primary);
}

/* Hero section */
.hero {
  background: linear-gradient(135deg, var(--color-surface), var(--color-surface-muted));
  padding: 60px 0;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
}

.hero-title {
  font-size: 42px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--color-text-primary);
}

.hero-subtitle {
  font-size: 20px;
  color: var(--color-text-secondary);
  max-width: 700px;
  margin: 0 auto;
}

/* Content sections */
.content-section {
  padding: 60px 0;
}

/* Table of Contents */
.toc-section {
  padding: 40px 0;
  background: var(--color-background);
}

.toc-card {
  background: var(--color-surface);
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border: 2px solid var(--color-accent);
}

.toc-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--color-text-primary);
}

.toc-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}

.toc-link {
  display: block;
  padding: 12px 16px;
  background: var(--color-surface-muted);
  color: var(--color-text-secondary);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s ease;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-left: 3px solid var(--color-accent);
}

.toc-link:hover {
  background: var(--color-surface);
  color: var(--color-text-primary);
  border-left-color: var(--color-accent);
  transform: translateX(4px);
}

/* Guide cards */
.guide-card {
  background: var(--color-surface);
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.guide-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.guide-card--highlight {
  background: linear-gradient(135deg, var(--color-surface), var(--color-surface-muted));
  border: 1px solid var(--color-accent);
}

.guide-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.guide-title {
  font-size: 26px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--color-text-primary);
}

.guide-text {
  font-size: 16px;
  color: var(--color-text-secondary);
  line-height: 1.8;
}

.guide-text p {
  margin-bottom: 16px;
}

.guide-text p:last-child {
  margin-bottom: 0;
}

.guide-text strong {
  color: var(--color-text-primary);
  font-weight: 600;
}

.guide-text code {
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
  font-size: 14px;
  color: var(--color-accent);
}

/* Lists */
.guide-list {
  margin-top: 12px;
  padding-left: 24px;
}

.guide-list li {
  margin-bottom: 12px;
  color: var(--color-text-secondary);
}

.guide-list li:last-child {
  margin-bottom: 0;
}

/* Subsection titles */
.subsection-title {
  font-size: 20px;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 12px;
  color: var(--color-accent);
}

.guide-card .subsection-title:first-child {
  margin-top: 0;
}

/* Info boxes */
.info-box {
  background: rgba(52, 152, 219, 0.1);
  border-left: 4px solid var(--color-accent);
  padding: 16px 20px;
  border-radius: 8px;
  margin: 16px 0;
}

.info-box p {
  margin-bottom: 8px;
  color: var(--color-text-secondary);
}

.info-box p:last-child {
  margin-bottom: 0;
}

/* Example boxes */
.example-box {
  background: rgba(0, 0, 0, 0.3);
  border-left: 4px solid var(--color-success);
  padding: 16px 20px;
  border-radius: 8px;
  margin: 16px 0;
}

.example-box p {
  margin-top: 8px;
  margin-bottom: 0;
  color: var(--color-text-secondary);
  font-size: 14px;
}

/* CTA section */
.cta-section {
  background: linear-gradient(135deg, var(--color-surface), var(--color-surface-muted));
  padding: 80px 0;
  text-align: center;
  border-top: 1px solid var(--color-border);
}

.cta-title {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--color-text-primary);
}

.cta-text {
  font-size: 18px;
  color: var(--color-text-secondary);
  margin-bottom: 32px;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
  color: white;
  padding: 14px 28px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.cta-button:hover {
  background: linear-gradient(135deg, var(--color-accent-dark), #21618c);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.cta-button:active {
  transform: scale(0.98);
}

.cta-button--large {
  padding: 18px 40px;
  font-size: 18px;
}

.cta-button--header {
  padding: 10px 20px;
  font-size: 14px;
}

/* Footer */
.footer {
  background: var(--color-surface);
  padding: 24px 0;
  border-top: 1px solid var(--color-border);
}

.footer-text {
  text-align: center;
  font-size: 14px;
  color: var(--color-text-secondary);
}

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

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

/* Responsive Design */

/* Tablets */
@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }

  .hero {
    padding: 40px 0;
  }

  .hero-title {
    font-size: 32px;
  }

  .hero-subtitle {
    font-size: 18px;
  }

  .toc-section {
    padding: 30px 0;
  }

  .toc-card {
    padding: 24px;
  }

  .toc-nav {
    grid-template-columns: 1fr;
  }

  .content-section {
    padding: 40px 0;
  }

  .guide-card {
    padding: 24px;
  }

  .guide-icon {
    font-size: 40px;
  }

  .guide-title {
    font-size: 22px;
  }

  .guide-text {
    font-size: 15px;
  }

  .subsection-title {
    font-size: 18px;
  }

  .cta-section {
    padding: 60px 0;
  }

  .cta-title {
    font-size: 28px;
  }

  .cta-text {
    font-size: 16px;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .brand-icon {
    width: 32px;
    height: 32px;
  }

  .brand-title {
    font-size: 20px;
  }

  .hero {
    padding: 32px 0;
  }

  .hero-title {
    font-size: 28px;
  }

  .hero-subtitle {
    font-size: 16px;
  }

  .toc-section {
    padding: 24px 0;
  }

  .toc-card {
    padding: 20px;
  }

  .toc-title {
    font-size: 20px;
  }

  .toc-nav {
    gap: 8px;
  }

  .toc-link {
    padding: 10px 14px;
    font-size: 14px;
  }

  .content-section {
    padding: 32px 0;
  }

  .guide-card {
    padding: 20px;
    margin-bottom: 20px;
  }

  .guide-icon {
    font-size: 36px;
    margin-bottom: 12px;
  }

  .guide-title {
    font-size: 20px;
    margin-bottom: 12px;
  }

  .guide-text {
    font-size: 14px;
  }

  .subsection-title {
    font-size: 17px;
    margin-top: 20px;
  }

  .guide-list {
    padding-left: 20px;
  }

  .info-box, .example-box {
    padding: 12px 16px;
    margin: 12px 0;
  }

  .cta-section {
    padding: 40px 0;
  }

  .cta-title {
    font-size: 24px;
  }

  .cta-text {
    font-size: 15px;
    margin-bottom: 24px;
  }

  .cta-button--large {
    padding: 14px 32px;
    font-size: 16px;
  }

  .header .container {
    justify-content: center;
  }

  .cta-button--header {
    width: 100%;
    margin-top: 8px;
  }

  .footer {
    padding: 20px 0;
  }

  .footer-text {
    font-size: 13px;
  }
}

/* Scroll to top button */
.scroll-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-to-top:hover {
  background: linear-gradient(135deg, var(--color-accent-dark), #21618c);
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(52, 152, 219, 0.5);
}

.scroll-to-top:active {
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  .scroll-to-top {
    width: 45px;
    height: 45px;
    bottom: 20px;
    right: 20px;
    font-size: 20px;
  }
}
