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

:root {
  --primary-color: #0066cc;
  --primary-dark: #004499;
  --secondary-color: #6c757d;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #17a2b8;

  --text-primary: #212529;
  --text-secondary: #6c757d;
  --text-muted: #adb5bd;

  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #e9ecef;
  --bg-dark: #212529;

  --border-color: #dee2e6;
  --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);

  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;

  --container-width: 1200px;
  --sidebar-width: 250px;

  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
}

/* Container */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Navigation */
.navbar {
  background-color: var(--bg-dark);
  color: white;
  padding: 1rem 0;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand h1 {
  font-size: 1.5rem;
  margin: 0;
  color: white;
}

.nav-brand .tagline {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-left: 1rem;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: white;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 4rem 0;
  text-align: center;
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.hero .subtitle {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  opacity: 0.95;
}

.hero .description {
  font-size: 1.125rem;
  margin-bottom: 2rem;
  opacity: 0.9;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.hero code {
  background-color: rgba(0, 0, 0, 0.2);
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
}

.code-example {
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin: 2rem auto;
  max-width: 700px;
  text-align: left;
  box-shadow: var(--shadow-lg);
}

.code-example pre {
  margin: 0;
  overflow-x: auto;
}

.code-example code {
  background: none;
  padding: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #f8f8f2;
}

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

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s;
  border: 2px solid transparent;
  cursor: pointer;
  font-size: 1rem;
}

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

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

.btn-secondary {
  background-color: transparent;
  color: white;
  border-color: white;
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* Features Section */
.features {
  padding: 4rem 0;
  background-color: var(--bg-primary);
}

.features h2 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 3rem;
  color: var(--text-primary);
}

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

.feature {
  padding: 2rem;
  background-color: var(--bg-secondary);
  border-radius: var(--radius-lg);
  transition: transform 0.2s, box-shadow 0.2s;
}

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

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

.feature p {
  color: var(--text-secondary);
  line-height: 1.6;
}

.feature code {
  background-color: var(--bg-tertiary);
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

/* Quick Start Section */
.quick-start,
.core-concepts,
.examples-preview {
  padding: 4rem 0;
}

.quick-start {
  background-color: var(--bg-secondary);
}

.quick-start h2,
.core-concepts h2,
.examples-preview h2 {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  color: var(--text-primary);
}

.quick-start h3,
.core-concepts h3 {
  font-size: 1.5rem;
  margin: 2rem 0 1rem;
  color: var(--text-primary);
}

.quick-start pre,
.core-concepts pre {
  background-color: var(--bg-dark);
  color: #f8f8f2;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 1rem 0;
}

.quick-start code,
.core-concepts code {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.5;
}

.quick-start p code,
.core-concepts p code {
  background-color: var(--bg-tertiary);
  color: var(--danger-color);
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

/* Core Concepts */
.concept {
  margin-bottom: 3rem;
}

.concept-benefits {
  background-color: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  margin-top: 1rem;
  border-left: 4px solid var(--primary-color);
}

.concept-benefits h4 {
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.concept-benefits ul {
  margin-left: 1.5rem;
  color: var(--text-secondary);
}

.concept-benefits li {
  margin: 0.5rem 0;
}

/* Examples Preview */
.examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.example-card {
  background-color: var(--bg-secondary);
  padding: 2rem;
  border-radius: var(--radius-lg);
  transition: transform 0.2s, box-shadow 0.2s;
}

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

.example-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

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

/* Docs Content */
.docs-content {
  padding: 2rem 0 4rem;
}

.docs-content .container {
  display: flex;
  gap: 3rem;
}

/* Sidebar */
.sidebar {
  flex-shrink: 0;
  width: var(--sidebar-width);
  position: sticky;
  top: 5rem;
  align-self: flex-start;
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
}

.docs-nav h3 {
  font-size: 1.125rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.docs-nav ul {
  list-style: none;
}

.docs-nav li {
  margin: 0.5rem 0;
}

.docs-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
  display: block;
  padding: 0.25rem 0;
}

.docs-nav a:hover,
.docs-nav a.active {
  color: var(--primary-color);
}

/* Docs Main Content */
.docs-main {
  flex: 1;
  min-width: 0;
}

.docs-main h1 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.docs-main h2 {
  font-size: 2rem;
  margin: 2.5rem 0 1rem;
  color: var(--text-primary);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-color);
}

.docs-main h3 {
  font-size: 1.5rem;
  margin: 2rem 0 1rem;
  color: var(--text-primary);
}

.docs-main h4 {
  font-size: 1.25rem;
  margin: 1.5rem 0 0.75rem;
  color: var(--text-primary);
}

.docs-main p {
  margin: 1rem 0;
  line-height: 1.7;
  color: var(--text-secondary);
}

.docs-main ul,
.docs-main ol {
  margin: 1rem 0 1rem 2rem;
  color: var(--text-secondary);
}

.docs-main li {
  margin: 0.5rem 0;
  line-height: 1.7;
}

.docs-main pre {
  background-color: var(--bg-dark);
  color: #f8f8f2;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 1.5rem 0;
  line-height: 1.5;
}

.docs-main code {
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

.docs-main p code,
.docs-main li code {
  background-color: var(--bg-tertiary);
  color: var(--danger-color);
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

.docs-main a {
  color: var(--primary-color);
  text-decoration: none;
}

.docs-main a:hover {
  text-decoration: underline;
}

/* API Sections */
.api-section {
  margin: 3rem 0;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.signature {
  background-color: var(--bg-secondary);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  border-left: 4px solid var(--primary-color);
  margin: 1rem 0;
}

.signature code {
  color: var(--text-primary);
  font-size: 0.9rem;
}

/* Info Boxes */
.info-box,
.warning-box {
  padding: 1.5rem;
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
  border-left: 4px solid;
}

.info-box {
  background-color: rgba(23, 162, 184, 0.1);
  border-color: var(--info-color);
}

.warning-box {
  background-color: rgba(255, 193, 7, 0.1);
  border-color: var(--warning-color);
}

.info-box h4,
.warning-box h4 {
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

/* Example Sections */
.example-section {
  margin: 3rem 0;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

/* Card Grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.card {
  display: block;
  background-color: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
}

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

.card h3 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.card p {
  color: var(--text-secondary);
}

/* Next Steps */
.next-steps {
  margin-top: 4rem;
}

/* Footer */
footer {
  background-color: var(--bg-dark);
  color: white;
  padding: 2rem 0;
  text-align: center;
  margin-top: 4rem;
}

footer p {
  margin: 0.5rem 0;
}

footer a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
}

footer a:hover {
  color: white;
  text-decoration: underline;
}

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

  .nav-links {
    gap: 1rem;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

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

  .docs-content .container {
    flex-direction: column;
  }

  .sidebar {
    position: static;
    width: 100%;
    margin-bottom: 2rem;
  }

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

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Print Styles */
@media print {
  .navbar,
  .sidebar,
  footer,
  .cta-buttons {
    display: none;
  }

  .docs-main {
    max-width: 100%;
  }
}
