/* ========================================================
   DocOrg • Portal Organizacional de Procesos - Stylesheet
   ======================================================== */

:root {
  --docorg-brand: #0284c7;
  --docorg-header-bg: #0f172a;
  --docorg-sidebar-bg: #f8fafc;
  --docorg-card-bg: #ffffff;
  --docorg-border: #e2e8f0;
  --docorg-text: #1e293b;
  --docorg-text-muted: #64748b;
  --docorg-subproceso-bg: #e7f1ff;
  --docorg-subproceso-border: #0d6efd;
  --docorg-subproceso-text: #084298;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--docorg-text);
  background-color: #f1f5f9;
  overflow-x: hidden;
}

/* Header */
.docorg-header {
  background-color: var(--docorg-header-bg);
  border-bottom: 1px solid #1e293b;
  min-height: 68px;
}

.brand-badge {
  background-color: var(--docorg-brand);
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Sidebar */
.docorg-sidebar {
  background-color: var(--docorg-sidebar-bg);
  border-right: 1px solid var(--docorg-border);
  height: calc(100vh - 68px);
  position: sticky;
  top: 68px;
  overflow-y: auto;
}

.search-box {
  background-color: #ffffff;
  border: 1px solid var(--docorg-border);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.search-box:focus-within {
  border-color: var(--docorg-brand);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.filter-btn {
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  transition: all 0.15s ease;
}

.filter-btn.active {
  background-color: #0284c7 !important;
  color: #ffffff !important;
}

.area-group-header {
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
}

.area-group-header:hover {
  background-color: #e2e8f0;
}

.proc-item-link {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  color: #334155;
  text-decoration: none;
  font-size: 0.85rem;
  transition: all 0.15s ease;
  margin-bottom: 2px;
}

.proc-item-link:hover {
  background-color: #e2e8f0;
  color: #0f172a;
}

.proc-item-link.active {
  background-color: #e0f2fe;
  color: #0369a1;
  font-weight: 600;
  border-left: 3px solid #0284c7;
}

/* Badges */
.badge-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 700;
}

.badge-subproceso {
  background-color: var(--docorg-subproceso-bg);
  border: 1px solid var(--docorg-subproceso-border);
  color: var(--docorg-subproceso-text);
  font-weight: 600;
}

/* Tabs */
.docorg-tabs .nav-link {
  color: #475569;
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 10px 18px;
  transition: all 0.2s ease;
}

.docorg-tabs .nav-link:hover {
  color: #0284c7;
  border-color: #cbd5e1;
}

.docorg-tabs .nav-link.active {
  color: #0284c7;
  background: transparent;
  border-bottom: 3px solid #0284c7;
}

/* Diagram Container & Panzoom */
.diagram-viewport {
  background-color: #ffffff;
  border: 1px solid var(--docorg-border);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  height: 720px;
  cursor: grab;
  user-select: none;
}

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

.diagram-canvas {
  transform-origin: 0 0;
  display: inline-block;
  padding: 20px;
}

.diagram-canvas svg {
  display: block;
  max-width: none !important;
  height: auto;
}

/* Make PlantUML links in SVG obvious and clickable */
.diagram-canvas a {
  cursor: pointer !important;
}

.diagram-canvas a:hover text {
  fill: #0d6efd !important;
  font-weight: bold;
}

.diagram-controls {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
  padding: 6px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--docorg-border);
}

.subprocesses-bar {
  background-color: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 10px 14px;
}

/* Step by Step Timeline */
.timeline-step {
  position: relative;
  padding-left: 28px;
  margin-bottom: 20px;
}

.timeline-step::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 14px;
  bottom: -20px;
  width: 2px;
  background-color: #cbd5e1;
}

.timeline-step:last-child::before {
  display: none;
}

.timeline-dot {
  position: absolute;
  left: 0;
  top: 8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: #ffffff;
  border: 3px solid #0284c7;
  z-index: 2;
}

.timeline-dot.start {
  border-color: #16a34a;
}

.timeline-dot.end-success {
  border-color: #16a34a;
  background-color: #dcfce7;
}

.timeline-dot.end-rejected {
  border-color: #dc2626;
  background-color: #fee2e2;
}

.timeline-dot.gateway {
  border-radius: 3px;
  transform: rotate(45deg);
  border-color: #d97706;
}

.step-card {
  background-color: #ffffff;
  border: 1px solid var(--docorg-border);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.step-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
}

/* Source Code Card */
.puml-code-container {
  background-color: #0f172a;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 18px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  overflow-x: auto;
  max-height: 700px;
}
