/* ===========================
   Dentalink Docs UI – Premium Edition
   Author: Javad Abdi
   =========================== */

/* Reset & base */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html, body {
  margin: 0;
  padding: 0;
  font-family: 'Vazirmatn', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color: var(--text);
  background: var(--bg);
  transition: background 0.3s ease, color 0.3s ease;
  scroll-behavior: smooth;
}

:root {
  --bg: #fdfefe;
  --panel: rgba(255, 255, 255, 0.72);
  --panel-glass: rgba(255, 255, 255, 0.45);
  --muted: #6b7280;
  --accent: #0284c7;
  --accent-soft: #bae6fd;
  --text: #0f172a;
  --radius: 14px;
  --shadow: 0 4px 16px rgba(0,0,0,0.08);
}

[data-theme="dark"] {
  --bg: #0b1220;
  --panel: rgba(15, 25, 40, 0.6);
  --panel-glass: rgba(20, 32, 52, 0.5);
  --muted: #9ca3af;
  --accent: #38bdf8;
  --accent-soft: #1e3a8a;
  --text: #e2e8f0;
  --shadow: 0 4px 16px rgba(0,0,0,0.4);
}

/* Header */
/* === HEADER BAR === */
.docs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--panel);
  padding: 10px 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  flex-wrap: wrap; /* در موبایل‌ها خط بعدی */
  gap: 10px;
}

/* سمت چپ: لوگو و جستجو */
.docs-header .left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
}

.logo {
  width: 36px;
  height: auto;
  margin-inline-end: 8px;
}

/* جستجو */
.search-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 10px;
  padding: 4px 8px;
  transition: all 0.2s ease;
}
.search-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.search-wrap input {
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  min-width: 220px;
  font-size: 15px;
  direction: inherit;
}
.search-wrap button {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 18px;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.search-wrap button:hover { opacity: 1; }

/* سمت راست: زبان و تم */
.docs-header .right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
}

.lang {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.lang:hover { color: var(--accent); }
.lang.active {
  color: var(--accent);
  font-weight: 600;
}

.btn-theme {
  border: none;
  background: var(--panel);
  font-size: 20px;
  cursor: pointer;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s, transform 0.2s;
}
.btn-theme:hover {
  background: rgba(0,0,0,0.05);
  transform: rotate(20deg);
}

/* Layout */
.docs-main {
  display: flex;
  gap: 20px;
  padding: 20px;
  min-height: calc(100vh - 120px);
}
.docs-sidebar {
  width: 260px;
  background: var(--panel);
  backdrop-filter: blur(20px);
  padding: 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-y: auto;
  height: fit-content;
  position: sticky;
  top: 90px;
}
.sidebar-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sidebar-list li {
  margin: 8px 0;
}
.sidebar-list a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  transition: background 0.2s, color 0.2s;
}
.sidebar-list a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

/* Content */
.docs-content {
  flex: 1;
  background: transparent;
  padding: 8px 12px;
  border-radius: var(--radius);
}
.lesson-header-img {
    height:calc(100% - 64px);
    width:260px;
}
.markdown-body {
  background: var(--panel);
  padding: 24px 28px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  line-height: 1.8;
  font-size: 1rem;
}
.markdown-body h1, .markdown-body h2, .markdown-body h3 {
  color: var(--text);
  font-weight: 700;
  margin-top: 1.5em;
}
.markdown-body code {
  background: rgba(0,0,0,0.05);
  padding: 2px 6px;
  border-radius: 6px;
  font-family: "JetBrains Mono", monospace;
}
[data-theme="dark"] .markdown-body code {
  background: rgba(255,255,255,0.08);
}
.markdown-body pre {
  background: #0b1220;
  color: #fff;
  padding: 16px;
  border-radius: var(--radius);
  overflow-x: auto;
  font-family: "JetBrains Mono", monospace;
}
[data-theme="dark"] pre {
  background: #060d1a;
}

/* Search results dropdown */
.search-results {
  position: absolute;
  right: 24px;
  top: 70px;
  background: var(--panel);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  max-width: 440px;
  z-index: 80;
  backdrop-filter: blur(14px);
}
.search-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.search-list li {
  padding: 10px 0;
  border-bottom: 1px dashed rgba(0,0,0,0.06);
}
.search-list a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.snippet {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

/* Footer */
.docs-footer {
  text-align: center;
  padding: 18px;
  color: var(--muted);
  font-size: 14px;
  background: transparent;
}

/* Responsive */
@media (max-width: 900px) {
  .docs-main {
    flex-direction: column;
    padding: 12px;
  }
  .docs-sidebar {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    position: relative;
    top: 0;
  }
  .docs-content {
    order: -1;
  }
}
/* ریسپانسیو */
@media (max-width: 768px) {
  .docs-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .search-wrap input {
    min-width: 100%;
  }
  .docs-header .right {
    justify-content: center;
  }
}