/* ==========================================================================
   bxwall Documentation Stylesheet
   Modern, Responsive, Marketplace-Ready Theme with Light & Dark Mode
   ========================================================================== */

:root {
  /* Color Palette - Light Mode */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-code: #1e293b;
  --bg-inline-code: #f1f5f9;
  --border-color: #e2e8f0;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-link: #4f46e5;
  --text-link-hover: #4338ca;
  --text-code: #f8fafc;
  
  --accent-primary: #6366f1;
  --accent-secondary: #4f46e5;
  --accent-light: #e0e7ff;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  
  /* Callout colors */
  --note-border: #3b82f6;
  --note-bg: #eff6ff;
  --tip-border: #10b981;
  --tip-bg: #ecfdf5;
  --warning-border: #f59e0b;
  --warning-bg: #fffbeb;
  --important-border: #8b5cf6;
  --important-bg: #f5f3ff;
  
  --sidebar-width: 290px;
  --topbar-height: 70px;
  --radius: 8px;
  --transition: all 0.25s ease-in-out;
}

[data-theme="dark"] {
  /* Color Palette - Dark Mode */
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-sidebar: #111827;
  --bg-card: #1f2937;
  --bg-code: #030712;
  --bg-inline-code: #1f2937;
  --border-color: #1f2937;
  
  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --text-link: #818cf8;
  --text-link-hover: #a5b4fc;
  --text-code: #f3f4f6;
  
  --accent-light: #1e1b4b;
  --note-bg: #1e3a8a20;
  --tip-bg: #064e3b20;
  --warning-bg: #78350f20;
  --important-bg: #4c1d9520;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

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

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

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.3;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

h1 { font-size: 2.25rem; letter-spacing: -0.025em; }
h2 { font-size: 1.65rem; border-bottom: 2px solid var(--border-color); padding-bottom: 0.5rem; letter-spacing: -0.02em; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

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

a {
  color: var(--text-link);
  text-decoration: none;
  transition: var(--transition);
}

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

ul, ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
  color: var(--text-secondary);
}

li {
  margin-bottom: 0.5rem;
}

strong {
  color: var(--text-primary);
}

/* Top Navbar */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-height);
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.75rem;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--text-primary);
  text-decoration: none !important;
}

.brand-badge {
  background: var(--accent-gradient);
  color: #ffffff;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.search-box {
  position: relative;
  width: 280px;
}

.search-box input {
  width: 100%;
  padding: 0.55rem 1rem 0.55rem 2.4rem;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: var(--transition);
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.search-box i {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.theme-toggle-btn {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.5rem 0.85rem;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
}

.theme-toggle-btn:hover {
  background: var(--border-color);
}

.btn-buy {
  background: var(--accent-gradient);
  color: #ffffff !important;
  padding: 0.5rem 1.25rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.875rem;
  box-shadow: var(--shadow-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-buy:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

/* Layout Wrapper */
.layout-container {
  display: flex;
  margin-top: var(--topbar-height);
  min-height: calc(100vh - var(--topbar-height));
}

/* Sidebar Navigation */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  position: fixed;
  top: var(--topbar-height);
  bottom: 0;
  left: 0;
  overflow-y: auto;
  padding: 1.5rem 1rem 2rem 1rem;
  transition: var(--transition);
  z-index: 900;
}

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

.nav-group {
  margin-bottom: 1.5rem;
}

.nav-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  padding-left: 0.75rem;
}

.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-item {
  margin-bottom: 0.2rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.85rem;
  color: var(--text-secondary);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none !important;
  transition: var(--transition);
}

.nav-link i {
  font-size: 1rem;
  width: 1.25rem;
  text-align: center;
  color: var(--text-muted);
  transition: var(--transition);
}

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

.nav-link:hover i {
  color: var(--accent-primary);
}

.nav-link.active {
  background-color: var(--accent-light);
  color: var(--accent-primary);
  font-weight: 600;
}

.nav-link.active i {
  color: var(--accent-primary);
}

/* Main Content */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 2.5rem 3rem 4rem 3rem;
  max-width: 1050px;
}

.doc-section {
  scroll-margin-top: calc(var(--topbar-height) + 1.5rem);
  margin-bottom: 3.5rem;
}

.hero-header {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: calc(var(--radius) * 1.5);
  padding: 2.5rem;
  margin-bottom: 3rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.hero-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: var(--accent-gradient);
}

.hero-title {
  margin-top: 0;
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.meta-item {
  display: flex;
  flex-direction: column;
}

.meta-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.meta-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Callouts / Alerts */
.callout {
  padding: 1.25rem;
  border-radius: var(--radius);
  margin: 1.5rem 0;
  border-left: 4px solid var(--note-border);
  background-color: var(--note-bg);
  position: relative;
}

.callout-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.callout.callout-note { border-left-color: var(--note-border); background-color: var(--note-bg); }
.callout.callout-note .callout-title { color: var(--note-border); }

.callout.callout-tip { border-left-color: var(--tip-border); background-color: var(--tip-bg); }
.callout.callout-tip .callout-title { color: var(--tip-border); }

.callout.callout-warning { border-left-color: var(--warning-border); background-color: var(--warning-bg); }
.callout.callout-warning .callout-title { color: var(--warning-border); }

.callout.callout-important { border-left-color: var(--important-border); background-color: var(--important-bg); }
.callout.callout-important .callout-title { color: var(--important-border); }

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

/* Code Blocks & Inline Code */
code {
  font-family: 'Fira Code', 'JetBrains Mono', Consolas, Monaco, 'Andale Mono', monospace;
  font-size: 0.875em;
  background-color: var(--bg-inline-code);
  color: var(--accent-primary);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

pre {
  background-color: var(--bg-code);
  color: var(--text-code);
  padding: 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.5rem 0;
  position: relative;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

pre code {
  background-color: transparent;
  color: inherit;
  padding: 0;
  font-size: 0.9rem;
  line-height: 1.6;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.05);
  padding: 0.5rem 1rem;
  margin: -1.25rem -1.25rem 1rem -1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.8rem;
  color: #94a3b8;
}

.copy-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f8fafc;
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Feature Cards Grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.feature-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-primary);
}

.feature-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--accent-light);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.feature-card p {
  margin-bottom: 0;
  font-size: 0.9rem;
}

/* Tables */
.table-responsive {
  overflow-x: auto;
  margin: 1.5rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

th, td {
  padding: 0.85rem 1.15rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

th {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tr:last-child td {
  border-bottom: none;
}

/* Steps List */
.step-list {
  list-style: none;
  padding-left: 0;
  counter-reset: step-counter;
}

.step-item {
  position: relative;
  padding-left: 3.5rem;
  margin-bottom: 2rem;
}

.step-item::before {
  counter-increment: step-counter;
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 0;
  width: 2.4rem;
  height: 2.4rem;
  background: var(--accent-gradient);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: var(--shadow-sm);
}

.step-item h3 {
  margin-top: 0;
}

/* Accordion FAQ */
.faq-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  background-color: var(--bg-card);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  text-align: left;
  padding: 1.2rem 1.5rem;
  background: none;
  border: none;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
}

.faq-question:hover {
  background-color: var(--bg-primary);
}

.faq-question i {
  transition: transform 0.3s ease;
  color: var(--text-muted);
}

.faq-item.active .faq-question i {
  transform: rotate(180deg);
  color: var(--accent-primary);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  padding: 0 1.5rem;
}

.faq-item.active .faq-answer {
  max-height: 500px;
  padding: 0 1.5rem 1.2rem 1.5rem;
}

/* Backdrop Overlay for Mobile Navigation Drawer */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 850;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* Footer */
footer {
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
  margin-top: 4rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ==========================================================================
   Responsive Breakpoints & Mobile Optimization
   ========================================================================== */

/* Tablet & Mobile Layout (< 992px) */
@media (max-width: 992px) {
  :root {
    --topbar-height: 64px;
    --sidebar-width: 280px;
  }
  
  .mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
  }
  
  .search-box {
    width: 200px;
  }
  
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width);
    box-shadow: none;
  }
  
  .sidebar.show {
    transform: translateX(0);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.3);
  }
  
  .main-content {
    margin-left: 0;
    padding: 1.75rem 1.5rem 3.5rem 1.5rem;
    max-width: 100%;
  }
}

/* Mobile Devices (< 768px) */
@media (max-width: 768px) {
  :root {
    --topbar-height: 60px;
  }

  .topbar {
    padding: 0 0.85rem;
  }

  .brand-logo span {
    font-size: 1.15rem;
  }

  .brand-badge {
    display: none;
  }

  .search-box {
    width: 150px;
  }

  .search-box input {
    padding: 0.45rem 0.75rem 0.45rem 2rem;
    font-size: 0.8rem;
  }

  .search-box i {
    left: 0.75rem;
    font-size: 0.8rem;
  }

  .theme-toggle-btn {
    padding: 0.4rem 0.65rem;
    font-size: 0.8rem;
  }

  .btn-buy {
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
  }

  .hero-header {
    padding: 1.5rem 1.25rem;
    margin-bottom: 2rem;
  }

  .hero-title {
    font-size: 1.75rem;
  }

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

  .meta-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
  }

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

  .table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1rem 0;
    border-radius: var(--radius);
  }

  .table-responsive table {
    min-width: 540px;
  }

  pre {
    padding: 1rem;
    font-size: 0.82rem;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .code-header {
    margin: -1rem -1rem 0.75rem -1rem;
    padding: 0.4rem 0.85rem;
    font-size: 0.75rem;
  }

  footer {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
    padding: 1.5rem 0;
  }
}

/* Small Mobile Screens (< 480px) */
@media (max-width: 480px) {
  .topbar-controls {
    gap: 0.4rem;
  }

  .search-box {
    display: none;
  }

  .theme-toggle-btn span {
    display: none;
  }

  .theme-toggle-btn {
    padding: 0.45rem 0.6rem;
    border-radius: 50%;
  }

  .btn-buy span {
    display: none;
  }

  .btn-buy {
    padding: 0.45rem 0.65rem;
    border-radius: 50%;
  }

  .hero-title {
    font-size: 1.45rem;
  }

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

  .step-item {
    padding-left: 3rem;
  }

  .step-item::before {
    width: 2rem;
    height: 2rem;
    font-size: 0.85rem;
  }

  .faq-question {
    padding: 0.9rem 1rem;
    font-size: 0.9rem;
  }

  .faq-answer {
    padding: 0 1rem;
  }

  .faq-item.active .faq-answer {
    padding: 0 1rem 1rem 1rem;
  }
}

