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

:root {
  --primary-color: #667eea;
  --primary-dark: #5a67d8;
  --secondary-color: #f093fb;
  --accent-color: #f5576c;
  --text-primary: #1a202c;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --bg-primary: #ffffff;
  --bg-secondary: #f7fafc;
  --bg-tertiary: #edf2f7;
  --border-color: #e2e8f0;
  --code-bg: #1e293b;
  --code-text: #e2e8f0;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --error-color: #ef4444;
  --info-color: #3b82f6;
  --sidebar-width: 280px;
  --header-height: 60px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-secondary);
}

/* ===== Documentation Layout ===== */
.documentation {
  display: flex;
  min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-primary);
  border-right: 1px solid var(--border-color);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
}

.sidebar-header {
  padding: 25px 20px 20px;
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
}

.sidebar-header h1 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
}

.sidebar-header .version {
  font-size: 0.875rem;
  opacity: 0.9;
  font-weight: 500;
  margin: 0;
}

.sidebar-header img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: white;
  padding: 2px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.sidebar-nav {
  padding: 20px 0;
}

.nav-section {
  margin-bottom: 25px;
}

.nav-section h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0 20px 10px;
  font-weight: 600;
}

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

.nav-section li {
  margin: 0;
}

.nav-link {
  display: block;
  padding: 10px 20px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: 0.9375rem;
  border-left: 3px solid transparent;
}

.nav-link:hover {
  background: var(--bg-tertiary);
  color: var(--primary-color);
  border-left-color: var(--primary-color);
}

.nav-link.active {
  background: linear-gradient(90deg, rgba(102, 126, 234, 0.1) 0%, rgba(102, 126, 234, 0.05) 100%);
  color: var(--primary-color);
  font-weight: 600;
  border-left: 3px solid var(--primary-color);
  box-shadow: inset 0 0 0 1px rgba(102, 126, 234, 0.1);
  position: relative;
}

.nav-link.active::before {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 60%;
  background: var(--primary-color);
  border-radius: 4px 0 0 4px;
}

/* ===== Main Content ===== */
.content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

.content-wrapper {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 60px 100px;
}

/* ===== Typography ===== */
.doc-section {
  margin-bottom: 60px;
  scroll-margin-top: 20px;
}

.doc-section h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
  line-height: 1.2;
}

.doc-section h2 {
  font-size: 1.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 40px 0 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-color);
}

.doc-section h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 30px 0 15px;
}

.doc-section h4 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 25px 0 12px;
}

.doc-section p {
  margin-bottom: 15px;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.7;
}

.lead {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 30px;
  line-height: 1.6;
}

/* ===== Code Blocks ===== */
pre {
  background: var(--code-bg);
  border-radius: 8px;
  padding: 20px;
  overflow-x: auto;
  margin: 20px 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

code {
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 0.9em;
  color: var(--code-text);
  line-height: 1.6;
}

pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: 0.875rem;
}

p code, li code, td code, th code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 3px;
  color: #e11d48;
  font-size: 0.9em;
}

/* ===== Badges ===== */
.badge-new {
  display: inline-block;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-left: 10px;
  vertical-align: middle;
}

/* ===== Info Boxes ===== */
.info-box, .warning-box, .success-box {
  padding: 16px 20px;
  border-radius: 8px;
  margin: 20px 0;
  border-left: 4px solid;
}

.info-box {
  background: #eff6ff;
  border-left-color: var(--info-color);
}

.info-box strong {
  color: #1e40af;
}

.warning-box {
  background: #fffbeb;
  border-left-color: var(--warning-color);
}

.warning-box strong {
  color: #92400e;
}

.success-box {
  background: #f0fdf4;
  border-left-color: var(--success-color);
}

.success-box strong {
  color: #065f46;
}

/* ===== Quick Links Menu ===== */
.quick-links-container {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-radius: 16px;
  padding: 40px 30px;
  margin: 40px 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.quick-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.quick-link-card {
  background: white;
  border-radius: 12px;
  padding: 30px 25px;
  text-decoration: none;
  color: var(--text-primary);
  border: 2px solid transparent;
  transition: all 0.3s ease;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
}

.quick-link-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
  text-decoration: none;
}

.quick-link-icon {
  font-size: 3rem;
  margin-bottom: 15px;
  display: block;
}

.quick-link-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px 0;
}

.quick-link-card p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin: 0;
  line-height: 1.5;
  flex-grow: 1;
}

.quick-link-arrow {
  font-size: 1.5rem;
  color: var(--primary-color);
  position: absolute;
  bottom: 20px;
  right: 20px;
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.3s ease;
}

.quick-link-card:hover .quick-link-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* ===== Compact Features ===== */
.features-compact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.feature-compact-item {
  display: flex;
  gap: 15px;
  align-items: flex-start;
  padding: 20px;
  background: white;
  border-radius: 8px;
  border-left: 3px solid var(--primary-color);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.feature-compact-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.feature-compact-item strong {
  display: block;
  color: var(--text-primary);
  font-size: 1rem;
  margin-bottom: 5px;
}

.feature-compact-item p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin: 0;
  line-height: 1.5;
}

/* ===== Feature Grid ===== */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.feature-card {
  background: white;
  padding: 25px;
  border-radius: 12px;
  border: 2px solid var(--border-color);
  transition: all 0.3s ease;
}

.feature-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(102, 126, 234, 0.1);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 15px;
}

.feature-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 10px 0;
}

.feature-card p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

/* ===== Step Cards ===== */
.step-card {
  display: flex;
  gap: 20px;
  margin: 30px 0;
  padding: 25px;
  background: white;
  border-radius: 12px;
  border-left: 4px solid var(--primary-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.step-number {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
}

.step-content h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.25rem;
}

.step-content p {
  margin-bottom: 15px;
}

/* ===== Flow Diagram ===== */
.flow-diagram {
  margin: 30px 0;
  padding: 30px;
  background: white;
  border-radius: 12px;
  border: 2px solid var(--border-color);
}

.flow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.flow-box {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  padding: 20px 25px;
  border-radius: 8px;
  border: 2px solid var(--border-color);
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.flow-box strong {
  display: block;
  color: var(--primary-color);
  font-size: 1rem;
  margin-bottom: 5px;
}

.flow-box p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.flow-arrow {
  font-size: 2rem;
  color: var(--primary-color);
  font-weight: bold;
}

/* ===== Tables ===== */
.properties-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.properties-table thead {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
}

.properties-table th {
  padding: 15px;
  text-align: left;
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.025em;
}

.properties-table td {
  padding: 15px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.properties-table tbody tr:last-child td {
  border-bottom: none;
}

.properties-table tbody tr:hover {
  background: var(--bg-tertiary);
}

/* ===== Collapsible Sections (details/summary) ===== */
details {
  margin: 20px 0;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: white;
  overflow: hidden;
  transition: all 0.3s ease;
}

details[open] {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

details summary {
  padding: 15px 20px;
  cursor: pointer;
  user-select: none;
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
  list-style: none;
  position: relative;
  font-size: 1rem;
  color: var(--text-primary);
}

details summary::-webkit-details-marker {
  display: none;
}

details summary::before {
  content: '▶';
  position: absolute;
  left: 20px;
  transition: transform 0.2s ease;
  font-size: 0.8em;
  color: var(--primary-color);
}

details[open] summary::before {
  transform: rotate(90deg);
}

details summary:hover {
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
}

details[open] summary {
  border-bottom-color: var(--border-color);
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
}

details[open] summary strong {
  color: white;
}

details[open] summary::before {
  color: white;
}

details summary strong {
  margin-left: 25px;
  display: inline-block;
}

details .properties-table {
  margin: 0;
  box-shadow: none;
  border-radius: 0;
}

/* ===== Lists ===== */
.numbered-list {
  margin: 20px 0;
  padding-left: 25px;
  color: var(--text-secondary);
  line-height: 2;
}

.numbered-list li {
  margin-bottom: 10px;
}

ul {
  margin: 15px 0;
  padding-left: 25px;
}

li {
  margin-bottom: 8px;
  color: var(--text-secondary);
}

/* ===== Settings Grid ===== */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin: 25px 0;
}

.settings-category {
  background: white;
  padding: 20px;
  border-radius: 8px;
  border: 2px solid var(--border-color);
}

.settings-category h3 {
  font-size: 1.125rem;
  margin: 0 0 15px 0;
  color: var(--text-primary);
}

.settings-category ul {
  margin: 0;
  padding-left: 20px;
}

.settings-category li {
  font-size: 0.9375rem;
  margin-bottom: 8px;
  line-height: 1.6;
}

/* ===== Method Cards ===== */
.method-card {
  background: white;
  padding: 25px;
  border-radius: 8px;
  border-left: 4px solid var(--primary-color);
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.method-card h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.25rem;
  color: var(--primary-color);
}

.method-card p {
  margin-bottom: 10px;
}

.method-card pre {
  margin-top: 15px;
}

/* ===== Footer ===== */
.doc-footer {
  margin-top: 80px;
  padding: 30px 0;
  border-top: 2px solid var(--border-color);
  text-align: center;
  color: var(--text-muted);
}

.doc-footer p {
  margin-bottom: 10px;
}

.doc-footer a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  margin: 0 10px;
}

.doc-footer a:hover {
  text-decoration: underline;
}

/* ===== Responsive Design ===== */

/* ===== Tablet Styles ===== */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 260px;
  }
  
  .content-wrapper {
    padding: 40px 30px 80px;
  }
  
  .quick-links-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== Mobile Styles ===== */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 150;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  }

  .content {
    margin-left: 0;
    width: 100%;
  }

  .content-wrapper {
    padding: 20px 15px 60px;
  }

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

  .doc-section h1 {
    font-size: 1.75rem;
  }

  .doc-section h2 {
    font-size: 1.4rem;
  }

  .doc-section h3 {
    font-size: 1.2rem;
  }

  .feature-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .quick-links-container {
    padding: 20px 15px;
  }

  .quick-links-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .quick-link-card {
    padding: 20px 15px;
  }

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

  .step-card {
    flex-direction: column;
  }

  .flow-box {
    max-width: 100%;
    padding: 15px;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }
  
  .info-box, .warning-box {
    padding: 15px;
    font-size: 0.9rem;
  }
  
  pre {
    font-size: 0.8rem;
    padding: 15px;
  }
  
  .properties-table {
    font-size: 0.85rem;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .properties-table thead,
  .properties-table tbody,
  .properties-table tr {
    display: table;
    width: 100%;
    table-layout: fixed;
  }
  
  .properties-table th,
  .properties-table td {
    padding: 10px 8px;
    word-wrap: break-word;
  }
  
  /* Make code elements in tables wrap */
  .properties-table code {
    white-space: normal;
    word-break: break-word;
  }
  
  .scroll-to-top {
    bottom: 20px !important;
    right: 20px !important;
    width: 45px !important;
    height: 45px !important;
  }
  
  details summary {
    padding: 12px 15px;
    font-size: 0.95rem;
  }
  
  details summary strong {
    margin-left: 20px;
  }
  
  /* Better mobile navigation */
  .sidebar-nav {
    font-size: 0.95rem;
  }
  
  .nav-link {
    padding: 10px 15px;
  }
  
  /* Improve tap targets */
  a, button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

/* ===== Small Mobile Styles ===== */
@media (max-width: 480px) {
  .content-wrapper {
    padding: 15px 10px 60px;
  }
  
  .doc-section h1 {
    font-size: 1.5rem;
    line-height: 1.3;
  }

  .doc-section h2 {
    font-size: 1.25rem;
    line-height: 1.4;
  }
  
  .doc-section h3 {
    font-size: 1.1rem;
  }
  
  .quick-link-card h3 {
    font-size: 1.1rem;
  }
  
  .quick-link-card {
    padding: 15px 12px;
  }
  
  .feature-card h3 {
    font-size: 1rem;
  }
  
  pre {
    font-size: 0.75rem;
    padding: 12px;
    overflow-x: auto;
    max-width: 100%;
  }
  
  .properties-table {
    font-size: 0.8rem;
  }
  
  .properties-table th,
  .properties-table td {
    padding: 8px 6px;
    font-size: 0.75rem;
  }
  
  .sidebar-header h2 {
    font-size: 1.1rem;
  }
  
  .sidebar-header .version {
    font-size: 0.75rem;
  }
  
  .sidebar-header img {
    width: 32px !important;
    height: 32px !important;
  }
  
  .info-box, .warning-box {
    font-size: 0.85rem;
    padding: 12px;
  }
  
  .method-card, .feature-card {
    padding: 15px;
  }
  
  /* Smaller mobile menu button */
  .mobile-menu-btn {
    padding: 10px 14px;
    font-size: 1.2rem;
  }
}

/* ===== Scrollbar Styling ===== */
.sidebar::-webkit-scrollbar {
  width: 6px;
}

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

.sidebar::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ===== Smooth Scrolling ===== */
html {
  scroll-behavior: smooth;
}

/* ===== Selection ===== */
::selection {
  background: var(--primary-color);
  color: white;
}

/* ===== Links ===== */
a {
  color: var(--primary-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ===== Mobile Overlay ===== */
.mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 140;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-overlay.active {
  opacity: 1;
}

@media (max-width: 768px) {
  .mobile-overlay {
    display: block;
  }
}

/* ===== Mobile Header ===== */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: white;
  border-bottom: 1px solid var(--border-color);
  z-index: 100;
  padding: 0 20px;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.mobile-header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-header-logo img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
}

.mobile-header-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

/* ===== Mobile Menu Button ===== */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 12px;
  left: 20px;
  z-index: 200;
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 1.25rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.mobile-menu-btn.menu-open {
  opacity: 0;
  transform: translateX(-100px);
  pointer-events: none;
}

@media (max-width: 768px) {
  .mobile-header {
    display: flex;
  }

  .mobile-menu-btn {
    display: block;
  }

  .content-wrapper {
    padding-top: 80px;
  }
}

