/* ═══════════════════════════════════════════════════
   OTW Store — Documentation Stylesheet
   Clean, modern, professional documentation design
   ═══════════════════════════════════════════════════ */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: #1e293b;
  background: #f8fafc;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: #6366f1;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #4338ca;
  text-decoration: none;
}

code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.875em;
  padding: 0.15em 0.45em;
  background: #f1f5f9;
  color: #6366f1;
  border-radius: 4px;
  white-space: normal;
  word-break: break-word;
}

.flex-grow-1 {
  flex-grow: 1;
}

.mt-3 {
  margin-top: 1rem !important;
}

.mt-4 {
  margin-top: 1.5rem !important;
}


/* ═══════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════ */
.doc-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.doc-header__inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 100%;
  padding: 0 1.5rem;
  height: 60px;
}

.doc-header__brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: #1e293b;
  text-decoration: none;
  white-space: nowrap;
}

.doc-header__brand:hover {
  color: #6366f1;
  text-decoration: none;
}

.brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: #6366f1;
  color: #fff;
  border-radius: 8px;
  font-size: 0.85rem;
}

.doc-header__separator {
  width: 1px;
  height: 24px;
  background: #e2e8f0;
}

.doc-header__label {
  font-size: 0.85rem;
  font-weight: 500;
  color: #94a3b8;
  letter-spacing: 0.02em;
}

.doc-header__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: #6366f1;
  background: #eef2ff;
  border-radius: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.doc-header__link:hover {
  background: #6366f1;
  color: #fff;
  text-decoration: none;
}

.doc-header__mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.doc-header__mobile-toggle:hover {
  background: #f1f5f9;
  color: #1e293b;
}


/* ═══════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════ */
.doc-layout {
  display: flex;
  min-height: calc(100vh - 60px);
}


/* ═══════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════ */
.doc-sidebar {
  position: sticky;
  top: 60px;
  width: 260px;
  min-width: 260px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  background: #fff;
  border-right: 1px solid #e2e8f0;
  padding: 1.25rem 0;
  scrollbar-width: thin; /* Modern browsers */
  scrollbar-color: #cbd5e1 transparent; /* Modern browsers */
}

.doc-sidebar::-webkit-scrollbar {
  width: 4px;
}

.doc-sidebar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.doc-sidebar__nav {
  padding: 0 0.75rem;
}

.doc-sidebar__group {
  margin-bottom: 1.25rem;
}

.doc-sidebar__heading {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  padding: 0 0.75rem;
  margin-bottom: 0.4rem;
}

.doc-sidebar__link {
  display: block;
  padding: 0.35rem 0.75rem;
  font-size: 0.88rem;
  font-weight: 450;
  color: #475569;
  border-radius: 6px;
  transition: all 0.15s ease;
  text-decoration: none;
  line-height: 1.5;
}

.doc-sidebar__link:hover {
  color: #6366f1;
  background: #f8fafc;
  text-decoration: none;
}

.doc-sidebar__link.is-active {
  color: #6366f1;
  background: #eef2ff;
  font-weight: 550;
}


/* ═══════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════ */
.doc-main {
  flex: 1;
  min-width: 0;
  max-width: 900px;
  margin: 0;
  padding: 2rem 2.5rem 4rem;
}


/* ═══════════════════════════════════════════════════
   SECTIONS
   ═══════════════════════════════════════════════════ */
.doc-section {
  padding-bottom: 2.5rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid #e2e8f0;
  scroll-margin-top: 80px;
}

.doc-section:last-of-type {
  border-bottom: none;
}

.doc-section__title {
  font-size: 1.65rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.doc-section__lead {
  font-size: 1rem;
  color: #64748b;
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.doc-section__subtitle {
  font-size: 1.15rem;
  font-weight: 600;
  color: #1e293b;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  padding-top: 0.5rem;
}


/* ═══════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════ */
.doc-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}

.doc-card__title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #f1f5f9;
}


/* ═══════════════════════════════════════════════════
   LISTS
   ═══════════════════════════════════════════════════ */
.doc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.doc-list li {
  position: relative;
  padding: 0.3rem 0 0.3rem 1.25rem;
  color: #475569;
  line-height: 1.6;
}

.doc-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 6px;
  height: 6px;
  background: #6366f1;
  border-radius: 50%;
}

.doc-list--ordered {
  padding-left: 1.5rem;
  margin: 0;
}

.doc-list--ordered li {
  padding: 0.25rem 0;
  color: #475569;
  line-height: 1.6;
}


/* ═══════════════════════════════════════════════════
   FIELD GRID (badges for required/optional)
   ═══════════════════════════════════════════════════ */
.doc-field-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.doc-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: 6px;
  line-height: 1.4;
}

.doc-badge--required {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.doc-badge--required::before {
  content: '*';
  font-weight: 700;
}

.doc-badge--optional {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}


/* ═══════════════════════════════════════════════════
   STATUS BADGES
   ═══════════════════════════════════════════════════ */
.doc-status-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.doc-status {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 20px;
}

.doc-status--success {
  background: #f0fdf4;
  color: #15803d;
}

.doc-status--muted {
  background: #f8fafc;
  color: #64748b;
}

.doc-status--info {
  background: #eff6ff;
  color: #2563eb;
}

.doc-status--danger {
  background: #fef2f2;
  color: #dc2626;
}


/* ═══════════════════════════════════════════════════
   STEPS
   ═══════════════════════════════════════════════════ */
.doc-steps {
  margin: 1.25rem 0;
}

.doc-step {
  display: flex;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.doc-step:last-child {
  border-bottom: none;
}

.doc-step__number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  background: #6366f1;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 50%;
}

.doc-step strong {
  display: block;
  font-size: 0.93rem;
  color: #1e293b;
  margin-bottom: 0.15rem;
}

.doc-step p {
  font-size: 0.88rem;
  color: #64748b;
  margin: 0;
  line-height: 1.6;
}


/* ═══════════════════════════════════════════════════
   CALLOUTS
   ═══════════════════════════════════════════════════ */
.doc-callout {
  padding: 0.85rem 1.1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.doc-callout--info {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1e40af;
}

.doc-callout--warning {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #92400e;
}

.doc-callout--success {
  background: #f0fdf4;
  border-color: #22c55e;
  color: #15803d;
}


/* ═══════════════════════════════════════════════════
   IMAGES
   ═══════════════════════════════════════════════════ */
.doc-img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 0;
  border: 1px solid #e2e8f0;
  margin: 1rem 0;
  cursor: zoom-in;
}

.doc-img-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1rem 0;
}

.doc-img-group .doc-img {
  flex: 1 1 280px;
  min-width: 0;
  margin: 0;
}


/* ═══════════════════════════════════════════════════
   TABLE
   ═══════════════════════════════════════════════════ */
.doc-table {
  width: 100%;
  border-collapse: collapse;
}

.doc-table td,
.doc-table th {
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid #f1f5f9;
  text-align: left;
  font-size: 0.9rem;
}

.doc-table--compact td:first-child {
  width: 120px;
  color: #64748b;
}


/* ═══════════════════════════════════════════════════
   REPORT GRID
   ═══════════════════════════════════════════════════ */
.doc-report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.doc-report-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0;
  overflow: hidden;
}

.doc-report-card__body {
  padding: 1rem 1.15rem;
}

.doc-report-card__body h5 {
  font-size: 0.93rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.3rem;
}

.doc-report-card__body p {
  font-size: 0.82rem;
  color: #64748b;
  margin: 0;
  line-height: 1.5;
}

.doc-report-card img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-top: 1px solid #f1f5f9;
  cursor: zoom-in;
}


/* ═══════════════════════════════════════════════════
   IMAGE ZOOM MODAL
   ═══════════════════════════════════════════════════ */
.doc-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.85);
  align-items: center;
  justify-content: center;
  padding: 2rem;
  cursor: zoom-out;
}

.doc-modal-overlay.is-visible {
  display: flex;
}

.doc-modal-close {
  position: fixed;
  top: 1rem;
  right: 1.5rem;
  z-index: 10000;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.5rem;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s ease;
}

.doc-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.doc-modal-img {
  max-width: 95%;
  max-height: 90vh;
  border-radius: 0;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  object-fit: contain;
  cursor: default;
}


/* ═══════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════ */
.doc-footer {
  text-align: center;
  padding: 2rem 0 1.5rem;
  color: #94a3b8;
  font-size: 0.82rem;
  border-top: 1px solid #e2e8f0;
  margin-top: 1rem;
}

.doc-footer p {
  margin: 0;
}


/* ═══════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .doc-main {
    padding: 1.5rem 1.5rem 3rem;
  }
}

@media (max-width: 768px) {
  /* Header */
  .doc-header__link {
    display: none;
  }

  .doc-header__mobile-toggle {
    display: flex;
  }

  /* Sidebar */
  .doc-sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    z-index: 900;
    width: 280px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.08);
  }

  .doc-sidebar.is-open {
    transform: translateX(0);
  }

  /* Main */
  .doc-main {
    padding: 1.25rem 1rem 3rem;
    max-width: 100%;
  }

  /* Section */
  .doc-section__title {
    font-size: 1.35rem;
  }

  /* Images */
  .doc-img-group {
    flex-direction: column;
  }

  /* Reports */
  .doc-report-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .doc-header__inner {
    padding: 0 1rem;
  }

  .doc-header__separator,
  .doc-header__label {
    display: none;
  }

  .doc-main {
    padding: 1rem 0.75rem 2.5rem;
  }

  .doc-section__title {
    font-size: 1.2rem;
  }

  .doc-card {
    padding: 1rem;
  }

  .doc-field-grid {
    gap: 0.35rem;
  }

  .doc-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.55rem;
  }
}
