/* ─────────────────────────────────────────────────────────────
   docs.css  —  Tourmir Documentation Styles
   ───────────────────────────────────────────────────────────── */

/* ── Smooth scroll & base ──────────────────────────────────── */
html { scroll-behavior: smooth; scroll-padding-top: 80px; }

/* ── Sidebar active item ───────────────────────────────────── */
.sidebar-item { border-left: 2px solid transparent; }
.sidebar-active { border-left: 2px solid #0D9488 !important; padding-left: calc(0.75rem - 2px) !important; }

/* ── TOC active link ───────────────────────────────────────── */
.toc-active { color: #0D9488 !important; font-weight: 500; }
.dark .toc-active { color: #2dd4bf !important; }

/* ── Anchor hash links ─────────────────────────────────────── */
.anchor-hash {
  display: inline-flex; align-items: center; margin-left: 0.45em;
  color: #94a3b8; opacity: 0; vertical-align: middle;
  text-decoration: none; transition: opacity 0.15s;
}
h2:hover .anchor-hash, h3:hover .anchor-hash { opacity: 1; }

/* ── Copy button ───────────────────────────────────────────── */
.copy-btn {
  position: absolute; top: 0.6rem; right: 0.6rem;
  display: flex; align-items: center; justify-content: center;
  width: 1.9rem; height: 1.9rem; border-radius: 0.375rem;
  background: rgba(255,255,255,0.07); color: #94a3b8;
  border: 1px solid rgba(148,163,184,0.15);
  opacity: 0; transition: opacity 0.15s, color 0.15s; cursor: pointer;
}
pre:hover .copy-btn { opacity: 1; }
.copy-btn:hover { color: #e2e8f0; background: rgba(255,255,255,0.12); }

/* ── Prose ─────────────────────────────────────────────────── */
.docs-prose { line-height: 1.78; font-size: 1rem; }
.docs-prose > * + * { margin-top: 1.2rem; }

.docs-prose h1 {
  font-size: 2rem; font-weight: 700; line-height: 1.2;
  color: #0f172a; margin-top: 0; margin-bottom: 1.5rem;
}
.dark .docs-prose h1 { color: #f1f5f9; }

.docs-prose h2 {
  font-size: 1.2rem; font-weight: 600; line-height: 1.3;
  color: #0f172a; margin-top: 2.75rem; margin-bottom: 0.75rem;
  padding-bottom: 0.5rem; border-bottom: 1px solid #e2e8f0;
  display: flex; align-items: center;
}
.dark .docs-prose h2 { color: #f1f5f9; border-bottom-color: #1e293b; }

.docs-prose h3 {
  font-size: 1rem; font-weight: 600; color: #1e293b;
  margin-top: 1.75rem; margin-bottom: 0.5rem;
  display: flex; align-items: center;
}
.dark .docs-prose h3 { color: #e2e8f0; }

.docs-prose p { color: #374151; margin-bottom: 0; }
.dark .docs-prose p { color: #94a3b8; }

.docs-prose a {
  color: #0D9488; text-decoration: underline;
  text-decoration-color: rgba(13,148,136,0.35);
  text-underline-offset: 2px; transition: text-decoration-color 0.15s;
}
.docs-prose a:hover { text-decoration-color: #0D9488; }
.dark .docs-prose a { color: #2dd4bf; text-decoration-color: rgba(45,212,191,0.3); }
.dark .docs-prose a:hover { text-decoration-color: #2dd4bf; }

.docs-prose ul { list-style-type: disc; padding-left: 1.5rem; }
.docs-prose ol { list-style-type: decimal; padding-left: 1.5rem; }
.docs-prose li { color: #374151; margin-bottom: 0.25rem; }
.dark .docs-prose li { color: #94a3b8; }

.docs-prose strong { font-weight: 600; color: #0f172a; }
.dark .docs-prose strong { color: #e2e8f0; }

.docs-prose em { font-style: italic; }

/* Inline code */
.docs-prose code:not(pre code) {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.875em; background: #f1f5f9;
  color: #0f766e; padding: 0.15em 0.4em;
  border-radius: 0.3rem; border: 1px solid #e2e8f0;
}
.dark .docs-prose code:not(pre code) {
  background: #1e293b; color: #2dd4bf; border-color: #334155;
}

/* Code blocks */
.docs-prose pre {
  background: #0d1117; border-radius: 0.625rem;
  overflow-x: auto; padding: 1.2rem 1.4rem;
  margin: 1.5rem 0; border: 1px solid #21262d;
  position: relative; font-size: 0.875rem; line-height: 1.6;
}
.dark .docs-prose pre { background: #0d1117; border-color: #21262d; }
.docs-prose pre code { background: none !important; color: inherit; padding: 0; border: none; font-size: inherit; }

/* Tables */
.docs-prose table {
  width: 100%; border-collapse: collapse;
  font-size: 0.9rem; margin: 1.5rem 0;
  border: 1px solid #e2e8f0; border-radius: 0.5rem;
  overflow: hidden;
}
.dark .docs-prose table { border-color: #334155; }
.docs-prose thead th {
  text-align: left; padding: 0.65rem 1rem;
  font-weight: 600; font-size: 0.8125rem;
  color: #475569; background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
}
.dark .docs-prose thead th { color: #94a3b8; background: #1e293b; border-bottom-color: #334155; }
.docs-prose tbody td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  color: #374151; vertical-align: top;
}
.dark .docs-prose tbody td { border-bottom-color: #1e293b; color: #94a3b8; }
.docs-prose tbody tr:last-child td { border-bottom: none; }
.docs-prose tbody tr:hover td { background: #f8fafc; }
.dark .docs-prose tbody tr:hover td { background: #1e293b; }

/* Blockquote */
.docs-prose blockquote {
  border-left: 3px solid #0D9488; padding-left: 1rem;
  margin-left: 0; color: #475569; font-style: italic;
}
.dark .docs-prose blockquote { color: #64748b; }

/* HR */
.docs-prose hr { border: none; border-top: 1px solid #e2e8f0; margin: 2rem 0; }
.dark .docs-prose hr { border-top-color: #1e293b; }

/* ── Callout boxes ─────────────────────────────────────────── */
.callout {
  border-radius: 0.5rem; padding: 1rem 1.25rem;
  margin: 1.5rem 0; border-left: 3px solid;
  display: flex; gap: 0.75rem; align-items: flex-start;
}
.callout-icon { font-size: 1rem; flex-shrink: 0; margin-top: 0.15rem; line-height: 1.6; }
.callout-body { flex: 1; min-width: 0; font-size: 0.9375rem; line-height: 1.65; }
.callout-body p { margin: 0; }
.callout-title { font-weight: 600; display: block; margin-bottom: 0.2rem; }

.callout-note { background: #f0f9ff; border-left-color: #0ea5e9; color: #075985; }
.dark .callout-note { background: rgba(14,165,233,0.08); color: #7dd3fc; }
.callout-note .callout-icon { color: #0ea5e9; }

.callout-warning { background: #fffbeb; border-left-color: #f59e0b; color: #78350f; }
.dark .callout-warning { background: rgba(245,158,11,0.08); color: #fcd34d; }
.callout-warning .callout-icon { color: #f59e0b; }

.callout-tip { background: #f0fdf4; border-left-color: #0D9488; color: #14532d; }
.dark .callout-tip { background: rgba(13,148,136,0.08); color: #86efac; }
.callout-tip .callout-icon { color: #0D9488; }

/* ── Status badges ─────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 0.2em 0.65em; border-radius: 9999px;
  font-size: 0.78rem; font-weight: 500; line-height: 1;
}
.badge-dirty { background: #fee2e2; color: #991b1b; }
.badge-inprogress { background: #fef3c7; color: #92400e; }
.badge-clean { background: #dcfce7; color: #14532d; }
.badge-occupied { background: #e0e7ff; color: #3730a3; }
.dark .badge-dirty { background: rgba(153,27,27,0.25); color: #fca5a5; }
.dark .badge-inprogress { background: rgba(146,64,14,0.25); color: #fde68a; }
.dark .badge-clean { background: rgba(20,83,45,0.25); color: #86efac; }
.dark .badge-occupied { background: rgba(55,48,163,0.25); color: #a5b4fc; }

/* ── Custom scrollbar ──────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
.dark ::-webkit-scrollbar-thumb { background: #334155; }

/* ── Mobile sidebar ────────────────────────────────────────── */
@media (max-width: 1023px) {
  #docs-sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
  }
  #docs-sidebar.mobile-open {
    display: block !important;
    transform: translateX(0);
  }
}

/* ── Getting Started cards ─────────────────────────────────── */
.gs-card {
  display: flex; gap: 1rem; align-items: flex-start;
  padding: 1.25rem; border-radius: 0.75rem;
  border: 1px solid #e2e8f0; transition: border-color 0.15s, box-shadow 0.15s;
  text-decoration: none !important; color: inherit;
}
.gs-card:hover { border-color: #0D9488; box-shadow: 0 0 0 3px rgba(13,148,136,0.08); }
.dark .gs-card { border-color: #1e293b; }
.dark .gs-card:hover { border-color: #0D9488; box-shadow: 0 0 0 3px rgba(13,148,136,0.12); }

/* ── Step numbers ──────────────────────────────────────────── */
.step-num {
  width: 2rem; height: 2rem; border-radius: 50%;
  background: #0D9488; color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.875rem; flex-shrink: 0;
}

/* ── Responsive table wrapper ──────────────────────────────── */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ── Mobile improvements ───────────────────────────────────── */

/* Scale h1 down on small screens */
@media (max-width: 639px) {
  .docs-prose h1 { font-size: 1.6rem; }
  .docs-prose h2 { font-size: 1.05rem; }
  /* Show copy buttons on touch — hover never fires on mobile */
  .copy-btn { opacity: 0.65; }
  /* Tighten callout padding */
  .callout { padding: 0.75rem 1rem; gap: 0.5rem; }
  /* Tighten prose spacing */
  .docs-prose { font-size: 0.9375rem; }
}

/* Keep navbar from overflowing on very small phones (< 380px) */
@media (max-width: 379px) {
  #lang-en, #lang-ro {
    padding: 0.2rem 0.45rem !important;
    font-size: 0.65rem !important;
  }
}

/* Prev/next navigation stacks on mobile */
@media (max-width: 479px) {
  #docs-prev-next > div { flex-direction: column; }
  #docs-prev-next a { flex: none; width: 100%; }
}

/* Code blocks: smaller font on mobile, still scrollable */
@media (max-width: 639px) {
  .docs-prose pre {
    font-size: 0.8rem;
    padding: 0.9rem 1rem;
  }
}

/* Touch-friendly min tap target for sidebar items */
@media (hover: none) {
  .sidebar-item { min-height: 44px; }
  .copy-btn { opacity: 1; width: 2.2rem; height: 2.2rem; }
}
