/* Multi-page Documentation Styles for Wmimo */

.docs-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 48px;
  padding: 40px 0 80px 0;
  min-height: calc(100vh - 68px);
}

/* Sidebar */
.docs-sidebar {
  position: sticky;
  top: 88px;
  height: calc(100vh - 110px);
  overflow-y: auto;
  padding-right: 12px;
}

/* Sidebar Inline Quick Search */
.docs-sidebar-search {
  margin-bottom: 20px;
}

.sidebar-search-box {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}

.sidebar-search-box:focus-within {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(var(--brand-primary-rgb), 0.15);
  background: var(--bg-card-elevated);
}

.sidebar-search-box svg {
  color: var(--text-muted);
  flex-shrink: 0;
  transition: color var(--transition-fast);
}

.sidebar-search-box:focus-within svg {
  color: var(--brand-primary);
}

.sidebar-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  color: var(--text-primary);
  min-width: 0;
}

.sidebar-search-input::placeholder {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.sidebar-search-clear {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.sidebar-search-clear:hover {
  color: var(--text-primary);
  background: var(--bg-subtle);
}

.sidebar-search-empty {
  padding: 16px 8px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.docs-nav-group {
  margin-bottom: 24px;
}

.docs-nav-title {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  margin-bottom: 8px;
  padding-left: 10px;
}

.docs-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.docs-nav-item a {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  text-decoration: none;
}

.docs-nav-item a:hover {
  color: var(--text-primary);
  background: var(--bg-subtle);
}

.docs-nav-item.active a {
  color: var(--brand-primary);
  background: var(--badge-bg);
  font-weight: 600;
}

/* Article Content */
.docs-content {
  max-width: 820px;
  min-width: 0;
}

.docs-article {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.docs-article-header {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-color);
}

.docs-article-header h1 {
  font-size: clamp(1.65rem, 4vw, 2.2rem);
  margin-bottom: 8px;
}

.docs-article-header p {
  font-size: 0.98rem;
  color: var(--text-secondary);
}

.docs-article h2 {
  font-size: clamp(1.25rem, 3vw, 1.45rem);
  margin-top: 20px;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
}

.docs-article h3 {
  font-size: clamp(1.08rem, 2.5vw, 1.2rem);
  margin-top: 16px;
  margin-bottom: 8px;
}

.docs-article p {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.docs-article ul, .docs-article ol {
  padding-left: 20px;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.docs-article li {
  margin-bottom: 6px;
  line-height: 1.6;
}

/* Steps */
.steps-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 14px 0;
}

.step-card {
  display: flex;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: 16px 18px;
}

.step-number {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.step-body h4 {
  font-size: 0.98rem;
  margin-bottom: 4px;
}

.step-body p {
  font-size: 0.88rem;
}

/* Code Blocks */
.code-block-wrapper {
  position: relative;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 16px 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.code-block-wrapper::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #FF5F56;
  box-shadow: 14px 0 0 #FFBD2E, 28px 0 0 #27C93F;
  z-index: 2;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px 8px 56px;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid var(--code-border);
  font-size: 0.74rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.code-copy-btn {
  position: absolute;
  top: 6px;
  right: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #E2E8F0;
  cursor: pointer;
  font-size: 0.74rem;
  font-family: var(--font-sans);
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  backdrop-filter: blur(8px);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  z-index: 2;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.code-copy-btn:hover {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #FFFFFF;
}

.code-copy-btn.copied {
  background: #10B981 !important;
  border-color: #10B981 !important;
  color: #FFFFFF !important;
}

.code-block-wrapper pre,
pre.code-content {
  padding: 16px;
  padding-top: 32px;
  overflow-x: auto;
  font-size: 0.84rem;
  line-height: 1.65;
  color: var(--code-text);
  margin: 0;
  -webkit-overflow-scrolling: touch;
}

.code-block-wrapper code {
  font-family: var(--font-mono);
  color: inherit;
  background: transparent;
  padding: 0;
}

/* Callout Alerts */
.callout {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  margin: 16px 0;
  border: 1px solid transparent;
  border-left-width: 4px;
}

.callout-info {
  background: var(--callout-info-bg);
  border-color: var(--callout-info-border);
  border-left-color: var(--brand-primary);
}

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

.callout-body {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text-primary);
}

.callout-body strong {
  color: var(--text-primary);
  display: block;
  margin-bottom: 2px;
}

/* Tables */
.docs-table-wrapper {
  overflow-x: auto;
  margin: 16px 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  -webkit-overflow-scrolling: touch;
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.86rem;
  min-width: 480px;
}

.docs-table th, .docs-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
}

.docs-table th {
  background: var(--table-head-bg);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.docs-table tr:hover td {
  background: var(--table-hover-bg);
}

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

/* Pagination */
.docs-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  gap: 14px;
  flex-wrap: wrap;
}

.docs-pag-btn {
  display: inline-flex;
  flex-direction: column;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--transition-fast);
  min-width: 140px;
}

.docs-pag-btn:hover {
  border-color: var(--brand-primary);
}

.docs-pag-btn .sub {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.docs-pag-btn .title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--brand-primary);
  margin-top: 2px;
}

/* ==========================================================================
   Mobile Responsive Docs
   ========================================================================== */
@media (max-width: 860px) {
  .docs-layout {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px 0 60px 0;
  }
  
  .docs-sidebar {
    position: static;
    height: auto;
    max-height: 280px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-card);
    background: var(--bg-card);
    padding: 16px;
    margin-bottom: 8px;
    box-shadow: var(--shadow-card);
  }

  .docs-pagination {
    flex-direction: column;
    gap: 10px;
  }

  .docs-pag-btn {
    width: 100%;
    text-align: center;
    align-items: center;
  }
}
