/* ================================================================
   Shared styles — Ticketing Platform Architecture Diagrams
   ================================================================ */

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  background: #F8FAFC;
  color: #111827;
}

code {
  font-family: "SF Mono", "Fira Code", Consolas, monospace;
  font-size: 0.875em;
  background: #F3F4F6;
  padding: 1px 5px;
  border-radius: 4px;
  color: #374151;
}

/* ----------------------------------------------------------------
   INDEX PAGE
   ---------------------------------------------------------------- */

.topbar {
  background: #FFFFFF;
  border-bottom: 1px solid #E5E7EB;
  padding: 0 32px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-brand {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  text-decoration: none;
}

.topbar-link {
  font-size: 12px;
  color: #6B7280;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color 0.15s;
}

.topbar-link:hover { color: #111827; }

.hero {
  background: #FFFFFF;
  border-bottom: 1px solid #E5E7EB;
  padding: 24px 32px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.hero-text h1 {
  font-size: 22px;
  font-weight: 800;
  color: #111827;
  margin: 0 0 4px 0;
  line-height: 1.2;
}

.hero-text p {
  font-size: 13px;
  color: #6B7280;
  margin: 0;
}

.tech-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  max-width: 340px;
}

.tech-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 4px;
  white-space: nowrap;
}

.badge-orange { background: #FEF3C7; color: #92400E; }
.badge-blue   { background: #EFF6FF; color: #1D4ED8; }
.badge-purple { background: #F5F3FF; color: #6D28D9; }
.badge-green  { background: #F0FDF4; color: #166534; }
.badge-gray   { background: #F3F4F6; color: #374151; }
.badge-rose   { background: #FFF1F2; color: #9F1239; }

.diagrams-section {
  max-width: 920px;
  margin: 32px auto;
  padding: 0 32px;
}

.section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #9CA3AF;
  margin-bottom: 16px;
}

.diagrams-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.diagram-tile {
  display: block;
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-left-width: 4px;
  border-radius: 10px;
  padding: 20px 22px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s, transform 0.15s;
}

.diagram-tile:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.tile-num {
  font-size: 11px;
  font-weight: 600;
  color: #9CA3AF;
  margin-bottom: 6px;
}

.tile-title {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 6px;
}

.tile-desc {
  font-size: 13px;
  color: #6B7280;
  line-height: 1.5;
  margin-bottom: 14px;
}

.tile-tech {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}

/* ----------------------------------------------------------------
   DIAGRAM PAGES — sidebar layout
   ---------------------------------------------------------------- */

.page {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 230px;
  flex-shrink: 0;
  background: #FFFFFF;
  border-right: 1px solid #E5E7EB;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  padding: 18px 16px 14px;
  border-bottom: 1px solid #F3F4F6;
}

.sidebar-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  font-size: 11px;
  color: #9CA3AF;
  margin-bottom: 10px;
  transition: color 0.1s;
}

.sidebar-back:hover { color: #374151; }

.sidebar-brand-title {
  font-size: 13px;
  font-weight: 700;
  color: #111827;
}

.sidebar-brand-sub {
  font-size: 11px;
  color: #9CA3AF;
  margin-top: 2px;
}

.sidebar-nav {
  padding: 16px 0;
  flex: 1;
}

.sidebar-nav-label {
  padding: 0 16px 10px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #C4C9D4;
}

.sidebar-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 16px;
  text-decoration: none;
  color: #374151;
  font-size: 13px;
  border-left: 2px solid transparent;
  transition: background 0.1s, color 0.1s;
}

.sidebar-item:hover {
  background: #F9FAFB;
  color: #111827;
}

.sidebar-item.active {
  background: #EFF6FF;
  color: #1D4ED8;
  border-left-color: #2563EB;
  font-weight: 600;
}

.sidebar-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
  margin-top: 3px;
}

.sidebar-item-label { line-height: 1.35; }

.sidebar-item-sub {
  font-size: 10px;
  font-weight: 400;
  color: #9CA3AF;
  display: block;
  margin-top: 1px;
}

.sidebar-item.active .sidebar-item-sub { color: #93C5FD; }

/* Main area */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.main-header {
  background: #FFFFFF;
  border-bottom: 1px solid #E5E7EB;
  padding: 24px 32px 20px;
}

.main-header h1 {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 6px 0;
}

.main-header p {
  font-size: 13px;
  color: #6B7280;
  margin: 0;
}

.diagram-wrapper {
  flex: 1;
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
}

.diagram-card {
  flex: 1;
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 28px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  cursor: grab;
  min-height: 400px;
  position: relative;
}

.diagram-card:active { cursor: grabbing; }

/* ----------------------------------------------------------------
   ZOOM CONTROLS
   ---------------------------------------------------------------- */

.zoom-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
}

.zoom-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #E5E7EB;
  border-radius: 6px;
  background: #FFFFFF;
  color: #374151;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s, border-color 0.1s;
  user-select: none;
}

.zoom-btn:hover  { background: #F3F4F6; border-color: #D1D5DB; }
.zoom-btn:active { background: #E5E7EB; }

.zoom-btn-reset { font-size: 13px; margin-left: 4px; }

.zoom-level {
  min-width: 42px;
  text-align: center;
  font-size: 12px;
  color: #6B7280;
  font-variant-numeric: tabular-nums;
}
