/* === Drag-Splitter zwischen Editor und Preview === */
.uml-splitter {
  flex: 0 0 6px;
  background: rgba(0, 0, 0, 0.06);
  cursor: col-resize;
  position: relative;
  z-index: 5;
  transition: background 0.15s ease;
  -webkit-user-select: none;
  user-select: none;
}
.uml-splitter:hover,
.uml-splitter.dragging {
  background: rgba(45, 62, 80, 0.35);
}
.uml-splitter::before {
  content: "";
  position: absolute;
  inset: 0 -4px;
}
.uml-splitter::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 32px;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 2px;
  transform: translate(-50%, -50%);
  box-shadow: -4px 0 0 0 rgba(0, 0, 0, 0.18), 4px 0 0 0 rgba(0, 0, 0, 0.18);
}
body.uml-dragging,
body.uml-dragging * {
  cursor: col-resize !important;
  -webkit-user-select: none !important;
  user-select: none !important;
}

/* === "Fork me on GitHub"-Ribbon ausblenden === */
img[src*="github-fork-me"],
map#github-banner {
  display: none !important;
}

/* === Toggle-Button === */
body.uml-drawer-open .uml-drawer-toggle {
  display: none;
}
.uml-drawer-toggle {
  position: fixed;
  top: 11px;
  left: 14px;
  z-index: 1000;
  padding: 7px 13px;
  background: #2d3e50;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: background 0.15s ease, transform 0.12s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.uml-drawer-toggle:hover {
  background: #3a5169;
  transform: translateY(-1px);
}
.uml-drawer-toggle:active {
  transform: translateY(0);
}
.uml-drawer-toggle .uml-icon {
  font-size: 15px;
  line-height: 1;
}

/* === Drawer === */
.uml-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 540px;
  max-width: 92vw;
  background: #fafafa;
  border-right: 1px solid #d4d4d4;
  box-shadow: 4px 0 16px rgba(0, 0, 0, 0.12);
  transform: translateX(-100%);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  font-family: inherit;
}
.uml-drawer.open {
  transform: translateX(0);
}

.uml-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1000;
}
.uml-drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.uml-drawer-header {
  padding: 14px 16px;
  background: #2d3e50;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.uml-drawer-title {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.2px;
}
.uml-drawer-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
  opacity: 0.8;
}
.uml-drawer-close:hover { opacity: 1; }

.uml-drawer-hint {
  padding: 8px 14px;
  font-size: 11.5px;
  color: #5a6573;
  background: #eef0f3;
  border-bottom: 1px solid #d8dadd;
  line-height: 1.4;
  flex-shrink: 0;
}
.uml-drawer-hint b {
  color: #2d3e50;
  font-weight: 600;
}

/* === Tabs === */
.uml-drawer-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 8px 8px 0 8px;
  background: #fafafa;
  border-bottom: 1px solid #e1e3e6;
  flex-shrink: 0;
}
.uml-tab {
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  padding: 7px 12px;
  font-size: 12.5px;
  font-family: inherit;
  font-weight: 500;
  color: #5a6573;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.uml-tab:hover {
  background: rgba(45, 62, 80, 0.06);
  color: #2d3e50;
}
.uml-tab.active {
  background: #fafafa;
  border-color: #e1e3e6;
  color: #2d3e50;
  position: relative;
  z-index: 1;
  margin-bottom: -1px;
  font-weight: 600;
}

/* === Body === */
.uml-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  background: #f4f5f7;
}

/* === Snippet-Karte === */
.uml-snippet {
  background: #fff;
  border: 1px solid #e2e2e2;
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.uml-snippet:hover {
  border-color: #c4cad2;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.uml-snippet-head {
  padding: 10px 12px 6px 12px;
}
.uml-snippet-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #2d3e50;
  margin: 0;
  line-height: 1.3;
}
.uml-snippet-desc {
  font-size: 11.5px;
  color: #6c7a89;
  margin: 3px 0 0 0;
  line-height: 1.4;
}

.uml-snippet-code {
  margin: 0;
  padding: 10px 12px;
  background: #f8f8f9;
  border-top: 1px solid #ececef;
  border-bottom: 1px solid #ececef;
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  font-size: 11.5px;
  line-height: 1.45;
  color: #1f2933;
  white-space: pre;
  overflow-x: auto;
  max-height: 220px;
}
.uml-snippet-code code {
  font-family: inherit;
  background: none;
}

.uml-snippet-preview-wrap {
  padding: 10px 12px;
  text-align: center;
  background: #fff;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.uml-snippet-preview-wrap.error::before {
  content: "Vorschau nicht verfügbar";
  font-size: 11px;
  color: #aaa;
  font-style: italic;
}
.uml-snippet-preview {
  max-width: 100%;
  max-height: 180px;
  height: auto;
  width: auto;
  object-fit: contain;
}
.uml-snippet-preview:not([src]) {
  display: none;
}

.uml-snippet-actions {
  display: flex;
  gap: 4px;
  padding: 8px 10px;
  background: #fafbfc;
  border-top: 1px solid #ececef;
}
.uml-snippet-action {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 8px;
  background: #fff;
  border: 1px solid #d8dadd;
  border-radius: 5px;
  font-size: 11.5px;
  font-family: inherit;
  font-weight: 500;
  color: #2d3e50;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  white-space: nowrap;
}
.uml-snippet-action:hover {
  background: #f0f4f8;
  border-color: #2d3e50;
}
.uml-snippet-action.flash-ok {
  background: #d4edda;
  border-color: #4caf50;
  color: #1f6135;
}
.uml-snippet-action.flash-err {
  background: #f8d7da;
  border-color: #d9534f;
  color: #842029;
}
.uml-snippet-icon {
  font-size: 13px;
  line-height: 1;
}
