/*
 * ═══════════════════════════════════════════════════════════
 *  JAVA POO MASTER — UML DESIGNER STYLES  (redesign v6)
 *  Layout: topbar limpio + sidebar colapsable + canvas max
 * ═══════════════════════════════════════════════════════════
 */

/* ── Variables CSS para temas dinámicos ─────────────────── */
:root {
  --uml-canvas-bg: #0f0f1a;
  --uml-border: #334155;
  --uml-border-light: #475569;
  --uml-text-primary: #cbd5e1;
  --uml-text-secondary: #94a3b8;
  --uml-text-muted: #64748b;
  --uml-text-bright: #a5b4fc;
  --uml-card-bg: #1a1a2e;
  --uml-header-bg: #2d2b55;
  --uml-chip-bg: #1e293b;
  --uml-chip-hover: #334155;
  --uml-method-color: #7dd3fc;
  --uml-input-bg: #1e293b;
  --uml-input-border: #334155;
}

/* ══════════════════════════════════════════════════════════
   TOPBAR
   ══════════════════════════════════════════════════════════ */

.uml-topbar {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 10px;
  background: #080812;
  border-bottom: 1px solid #1e293b;
  min-height: 48px;
  user-select: none;
}

/* Branding */
.uml-tb-left {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 16px;
  border-right: 1px solid #1e293b;
  flex-shrink: 0;
}

.uml-win-dots {
  display: flex;
  gap: 5px;
  align-items: center;
}
.uml-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}
.uml-dot-r { background: #ef4444; }
.uml-dot-y { background: #eab308; }
.uml-dot-g { background: #22c55e; }

.uml-tb-title {
  font-size: .78rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: .04em;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

/* Centro: controles primarios */
.uml-tb-center {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  flex: 1;
}

/* Derecha: dropdowns */
.uml-tb-right {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 14px;
  border-left: 1px solid #1e293b;
  flex-shrink: 0;
}

/* Grupo de botones */
.uml-btngrp {
  display: flex;
  align-items: center;
  background: #0d1020;
  border: 1px solid #1e293b;
  border-radius: 7px;
  overflow: hidden;
}
.uml-btngrp .uml-tb-btn {
  border: none;
  border-radius: 0;
  background: transparent;
}
.uml-btngrp .uml-tb-btn + .uml-tb-btn {
  border-left: 1px solid #1e293b;
}

/* Botón base del topbar */
.uml-tb-btn {
  height: 30px;
  min-width: 30px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid #1e293b;
  background: transparent;
  color: #64748b;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .13s;
  gap: 4px;
}
.uml-tb-btn:hover { background: #1e293b; color: #e2e8f0; border-color: #334155; }
.uml-tb-btn.active { background: #1e1b4b; border-color: #4f46e5; color: #a5b4fc; }

/* Variante texto pequeño (1:1) */
.uml-tb-btn--text {
  font-size: .68rem;
  font-weight: 700;
  font-family: monospace;
  padding: 0 6px;
}

/* Separador vertical */
.uml-tb-sep {
  width: 1px;
  height: 20px;
  background: #1e293b;
  flex-shrink: 0;
}

/* Label de zoom */
.uml-zoom-lbl {
  font-size: .7rem;
  font-family: 'JetBrains Mono', monospace;
  color: #64748b;
  width: 36px;
  text-align: center;
  pointer-events: none;
  font-weight: 600;
}

/* Botón pill (Código, Ejemplos) */
.uml-tb-pill {
  height: 30px;
  padding: 0 12px;
  border-radius: 7px;
  border: 1px solid #1e293b;
  background: transparent;
  color: #64748b;
  font-size: .73rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all .13s;
  white-space: nowrap;
}
.uml-tb-pill:hover { background: #1e293b; color: #e2e8f0; border-color: #334155; }
.uml-tb-pill.active { background: #1e1b4b; border-color: #4f46e5; color: #a5b4fc; }

/* Pill de ejemplos — acento sutil */
.uml-tb-pill--examples {
  border-color: #2d3748;
  color: #7dd3fc;
  background: rgba(125,211,252,.06);
}
.uml-tb-pill--examples:hover { background: rgba(125,211,252,.12); color: #bae6fd; border-color: #334155; }

/* Chevron animado */
.uml-chevron { transition: transform .2s; }
.uml-menu-wrap.open .uml-chevron { transform: rotate(180deg); }

/* Botón kebab (⋮ tres puntos) */
.uml-tb-kebab {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  border: 1px solid #1e293b;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .13s;
}
.uml-tb-kebab:hover { background: #1e293b; color: #e2e8f0; border-color: #334155; }
.uml-tb-kebab.open  { background: #1e1b4b; border-color: #4f46e5; color: #a5b4fc; }

/* ── Mobile toggle (solo en móvil) ───── */
#uml-mob-toggle { display: none; }

/* ══════════════════════════════════════════════════════════
   DROPDOWN MENUS
   ══════════════════════════════════════════════════════════ */

.uml-menu-wrap {
  position: relative;
}

.uml-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 220px;
  background: #0d1020;
  border: 1px solid #2d3748;
  border-radius: 10px;
  padding: 4px;
  z-index: 2000;
  box-shadow: 0 16px 40px rgba(0,0,0,.65), 0 0 0 1px rgba(255,255,255,.03);
  animation: umlDropIn .15s ease;
}
.uml-dropdown--right { left: auto; right: 0; }
.uml-dropdown.hidden { display: none; }

@keyframes umlDropIn {
  from { opacity:0; transform: translateY(-6px) scale(.97); }
  to   { opacity:1; transform: translateY(0)    scale(1);   }
}

/* Header del grupo */
.uml-drop-hdr {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #4b5563;
  padding: 6px 10px 3px;
}

/* Ítem del dropdown */
.uml-drop-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: .78rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all .1s;
}
.uml-drop-item:hover { background: #1e293b; color: #e2e8f0; }

/* Ícono del ítem */
.uml-di-icon {
  font-size: .9rem;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

/* Texto del ítem */
.uml-di-text {
  flex: 1;
}
.uml-di-text small {
  color: #4b5563;
  font-size: .68rem;
}

/* Badge de conteo/estado */
.uml-di-badge {
  font-size: .62rem;
  font-weight: 700;
  padding: .1em .4em;
  border-radius: .25em;
  flex-shrink: 0;
  letter-spacing: .02em;
}
.uml-di-green  { background: #14532d; color: #4ade80; }
.uml-di-blue   { background: #1e3a5f; color: #60a5fa; }
.uml-di-amber  { background: #451a03; color: #fbbf24; }
.uml-di-purple { background: #3b0764; color: #c084fc; }
.uml-di-violet { background: #2e1065; color: #a78bfa; }

/* Ítem acento (Java→UML) */
.uml-drop-item--accent {
  color: #a78bfa;
}
.uml-drop-item--accent:hover {
  background: rgba(167,139,250,.1);
  color: #c4b5fd;
}

/* Ítem peligro (Limpiar) */
.uml-drop-item--danger { color: #f87171; }
.uml-drop-item--danger:hover { background: rgba(239,68,68,.12); color: #fca5a5; }

/* Separador en dropdown */
.uml-drop-sep {
  height: 1px;
  background: #1e293b;
  margin: 4px 6px;
}

/* ══════════════════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════════════════ */

.uml-sidebar {
  width: 168px;
  min-width: 168px;
  background: #080812;
  border-right: 1px solid #1e293b;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width .22s ease, min-width .22s ease;
  flex-shrink: 0;
}

/* Estado colapsado */
.uml-sidebar--collapsed {
  width: 0 !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

/* Header del sidebar */
.uml-sb-hdr {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid #1e293b;
  background: #0a0d18;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 10;
}
.uml-sb-hdr-title {
  font-size: .7rem;
  font-weight: 700;
  color: #4b5563;
  letter-spacing: .06em;
  text-transform: uppercase;
  flex: 1;
}
.uml-sb-collapse-btn {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1px solid #1e293b;
  background: transparent;
  color: #4b5563;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .13s;
}
.uml-sb-collapse-btn:hover { background: #1e293b; color: #94a3b8; border-color: #334155; }

/* Botón de expandir (flota en el canvas cuando sidebar colapsado) */
.uml-sb-expand {
  position: absolute;
  top: 10px;
  left: 6px;
  z-index: 20;
  width: 26px;
  height: 36px;
  border-radius: 0 6px 6px 0;
  border: 1px solid #1e293b;
  border-left: none;
  background: #0a0d18;
  color: #4b5563;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .13s;
}
.uml-sb-expand:hover { background: #1e293b; color: #94a3b8; }
.uml-sb-expand.hidden { display: none; }

/* Sección del sidebar */
.uml-sb-sec {
  padding: 10px 8px;
}
.uml-sb-sec--last {
  flex: 1;
}

/* Divisor */
.uml-sb-div {
  height: 1px;
  background: #1e293b;
  margin: 0 8px;
  flex-shrink: 0;
}

/* Labels de sección */
.uml-sidebar-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: #4b5563;
  margin-bottom: 7px;
  text-transform: uppercase;
}

/* Grilla de visibilidad */
.uml-vis-grid {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 3px 6px;
  font-size: .72rem;
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 10px;
}
.uml-vis-sym {
  font-weight: 800;
  text-align: center;
}
.uml-vis-priv { color: #f87171; }
.uml-vis-pub  { color: #4ade80; }
.uml-vis-prot { color: #60a5fa; }
.uml-vis-pkg  { color: #64748b; }
.uml-vis-name { color: #64748b; }

/* Shortcuts rápidos */
.uml-shortcuts {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.uml-sc-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .66rem;
}
.uml-sc-row kbd {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 3px;
  padding: 1px 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: .62rem;
  color: #94a3b8;
  white-space: nowrap;
}
.uml-sc-row span { color: #4b5563; }

/* ══════════════════════════════════════════════════════════
   CHIPS de clases arrastrables
   ══════════════════════════════════════════════════════════ */

.uml-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid #1e293b;
  background: #0d1020;
  color: var(--uml-text-secondary);
  font-size: .72rem;
  font-weight: 500;
  cursor: grab;
  transition: all .12s;
  user-select: none;
}
.uml-chip:hover     { background: #1e293b; border-color: #4f46e5; color: #e2e8f0; transform: translateX(2px); }
.uml-chip:active    { cursor: grabbing; }
.uml-chip-add       { color: #818cf8; border-color: #1e1b4b; cursor: pointer; justify-content: center; }
.uml-chip-add:hover { background: #1e1b4b; color: #a5b4fc; border-color: #4f46e5; }

/* ══════════════════════════════════════════════════════════
   BOTONES DE TIPO DE RELACIÓN
   ══════════════════════════════════════════════════════════ */

.uml-rel-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid #1e293b;
  background: transparent;
  color: var(--uml-text-secondary);
  font-size: .72rem;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all .12s;
}
.uml-rel-btn:hover  { background: #0d1020; border-color: #334155; color: var(--uml-text-primary); }
.uml-rel-active     { background: #1e1b4b !important; border-color: #4f46e5 !important; color: #a5b4fc !important; }

/* ══════════════════════════════════════════════════════════
   CANVAS WRAPPER — scroll container
   ══════════════════════════════════════════════════════════ */

.uml-canvas-wrap {
  min-width: 0;
  background-color: #060810;
  /* Misma trama de puntos que el canvas para continuidad visual */
  background-image: radial-gradient(circle, rgba(79,70,229,.18) 1px, transparent 1px);
  background-size: 24px 24px;
  background-attachment: local;
  /* Scroll suave */
  scroll-behavior: smooth;
  /* Borde interior sutil para separar del sidebar */
  box-shadow: inset 2px 0 12px rgba(0,0,0,.4);
}

/* ══════════════════════════════════════════════════════════
   CANVAS — lienzo infinito
   ══════════════════════════════════════════════════════════ */

.uml-canvas {
  position: relative;
  background-color: var(--uml-canvas-bg, #080812);
  /* Puntos: más modernos que líneas */
  background-image: radial-gradient(circle, rgba(79,70,229,.22) 1px, transparent 1px);
  background-size: 24px 24px;
  overflow: visible;
  /* Grid mayor cada 6 puntos (144px) mediante degradado transparente */
  background-image:
    radial-gradient(circle, rgba(79,70,229,.45) 1.5px, transparent 1.5px),
    radial-gradient(circle, rgba(79,70,229,.16) 1px,   transparent 1px);
  background-size: 144px 144px, 24px 24px;
}

.uml-canvas.connecting-mode {
  cursor: crosshair !important;
  outline: 2px solid rgba(250,204,21,.25);
  outline-offset: -2px;
}

/* ── Estado vacío del canvas ───────────────────────────── */
.uml-drop-hint {
  position: absolute;
  /* Centrado en el área visible inicial (top-left del scroll) */
  top: 220px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
  color: rgba(99,102,241,.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: opacity .3s;
}
.uml-drop-hint.hidden { opacity: 0; }

/* Ícono SVG */
.uml-drop-hint svg {
  opacity: .7;
}

/* Textos */
.uml-hint-title {
  font-size: .9rem;
  font-weight: 700;
  color: rgba(129,140,248,.7);
  margin: 0;
  letter-spacing: .03em;
}
.uml-hint-sub {
  font-size: .72rem;
  color: rgba(99,102,241,.45);
  margin: 0;
  line-height: 1.6;
}
.uml-hint-sub strong { color: rgba(129,140,248,.65); font-weight: 600; }

/* Decoración de esquina en el canvas (marca de origen) */
.uml-canvas::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 20px; height: 20px;
  border-top: 2px solid rgba(99,102,241,.3);
  border-left: 2px solid rgba(99,102,241,.3);
  border-radius: 3px 0 0 0;
  pointer-events: none;
  z-index: 2;
}

/* Degradado de borde interior para efecto de profundidad */
.uml-canvas::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right,  rgba(8,8,18,.35) 0px, transparent 40px),
    linear-gradient(to bottom, rgba(8,8,18,.35) 0px, transparent 40px);
  pointer-events: none;
  z-index: 1;
}

/* ══════════════════════════════════════════════════════════
   TARJETAS DE CLASE
   ══════════════════════════════════════════════════════════ */

.uml-card {
  position: absolute;
  min-width: 138px;
  border-radius: 8px;
  overflow: hidden;
  cursor: grab;
  user-select: none;
  background: var(--uml-card-bg);
  border: 1.5px solid var(--uml-border);
  box-shadow: 0 4px 18px rgba(0,0,0,.55);
  z-index: 10;
  transition: border-color .12s, box-shadow .12s;
}
.uml-card:hover    { border-color: #4f46e5; box-shadow: 0 6px 28px rgba(0,0,0,.7); }
.uml-card.selected { border-color: #818cf8; box-shadow: 0 0 0 2px rgba(129,140,248,.35), 0 6px 28px rgba(0,0,0,.7); }
.uml-card.connecting-src { border-color: #facc15; box-shadow: 0 0 0 2px rgba(250,204,21,.4); }
.uml-card:active   { cursor: grabbing; }

.uml-card-header {
  background: var(--uml-header-bg);
  padding: 5px 7px;
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--uml-border);
}
.uml-card-name {
  font-family: monospace;
  font-weight: 700;
  font-size: 12px;
  color: var(--uml-text-bright);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.uml-card-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .12s; }
.uml-card:hover .uml-card-actions { opacity: 1; }

.uml-cbtn {
  width: 17px; height: 17px;
  border-radius: 3px; border: none;
  font-size: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.1);
  color: #cbd5e1; padding: 0;
  transition: background .1s;
  line-height: 1;
}
.uml-cbtn:hover      { background: rgba(255,255,255,.22); color: white; }
.uml-cbtn-del:hover  { background: rgba(239,68,68,.55); }
.uml-cbtn-conn.active { background: rgba(250,204,21,.35); color: #facc15; }

.uml-card-section     { padding: 3px 0; }
.uml-card-section-sep { border-top: 1px dashed #2d3748; margin: 0; }

.uml-card-row {
  display: flex; align-items: center;
  padding: 1.5px 8px;
  gap: 3px;
}
.uml-card-row:hover { background: rgba(255,255,255,.035); }

.uml-row-text {
  font-family: monospace;
  font-size: 10.5px;
  color: var(--uml-text-secondary);
  flex: 1;
  cursor: text;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.uml-row-text.method { color: var(--uml-method-color); }

.uml-row-del {
  width: 13px; height: 13px;
  border: none; border-radius: 2px;
  background: transparent; color: #475569;
  font-size: 9px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .1s, background .1s;
  padding: 0;
}
.uml-card-row:hover .uml-row-del { opacity: 1; }
.uml-row-del:hover { background: rgba(239,68,68,.3); color: #f87171; }

.uml-card-add-row {
  display: flex; align-items: center;
  padding: 2px 8px;
  font-size: 10px; color: var(--uml-text-muted);
  cursor: pointer;
  background: none; border: none;
  width: 100%; text-align: left; gap: 3px;
  transition: color .1s;
}
.uml-card-add-row:hover { color: #818cf8; }

/* ══════════════════════════════════════════════════════════
   SVG DE RELACIONES
   ══════════════════════════════════════════════════════════ */

.uml-svg {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  overflow: visible;
  z-index: 5;
}

/* ══════════════════════════════════════════════════════════
   PANEL DE CÓDIGO
   ══════════════════════════════════════════════════════════ */

#uml-code-panel { display: none; }
#uml-code-panel.visible { display: flex; }

/* Tabs del panel de código */
.uml-ctab {
  padding: 4px 10px;
  font-size: .72rem;
  font-weight: 600;
  border-radius: 5px;
  border: 1px solid transparent;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: all .12s;
}
.uml-ctab:hover  { color: #94a3b8; }
.uml-ctab.active { background: #1e1b4b; border-color: #4f46e5; color: #a5b4fc; }

/* Compat: uml-icon-btn (usado por uml-diagram.js para añadir .active al código toggle) */
.uml-icon-btn.active { background: #1e1b4b !important; border-color: #4f46e5 !important; color: #a5b4fc !important; }

/* ══════════════════════════════════════════════════════════
   STATUS BAR
   ══════════════════════════════════════════════════════════ */

/* La barra de estado usa clases de Tailwind inline en el HTML */

/* ══════════════════════════════════════════════════════════
   CONCEPTOS UML (sección Learn)
   ══════════════════════════════════════════════════════════ */

.uml-concept-card {
  background: white; border-radius: 16px; overflow: hidden;
  box-shadow: 0 4px 6px rgba(0,0,0,.1); transition: all .3s ease;
}
.uml-concept-card:hover { transform: translateY(-4px); box-shadow: 0 8px 25px rgba(0,0,0,.15); }

.relation-herencia    { background: #dbeafe; color: #1d4ed8; }
.relation-composicion { background: #dcfce7; color: #166534; }
.relation-agregacion  { background: #fef3c7; color: #92400e; }
.relation-asociacion  { background: #f3e8ff; color: #7c3aed; }
.relation-dependencia { background: #fee2e2; color: #dc2626; }

.uml-relation-type {
  display: inline-block; padding: .25rem .75rem;
  border-radius: 9999px; font-size: .75rem;
  font-weight: 600; text-transform: uppercase;
}

/* ══════════════════════════════════════════════════════════
   TUTORIAL UML — Modal paso a paso
   ══════════════════════════════════════════════════════════ */

#uml-tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: umlTutFadeIn .25s ease;
}
#uml-tutorial-overlay.hidden { display: none; }

@keyframes umlTutFadeIn {
  from { opacity: 0; transform: scale(.96); }
  to   { opacity: 1; transform: scale(1); }
}

.uml-tut-card {
  background: #1e1e2e;
  border: 1px solid #334155;
  border-radius: 20px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 25px 60px rgba(0,0,0,.6);
  overflow: hidden;
  position: relative;
}

.uml-tut-header {
  background: linear-gradient(135deg, #312e81, #4c1d95);
  padding: 20px 24px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.uml-tut-header-text h3 {
  font-size: 18px;
  font-weight: 800;
  color: #e0e7ff;
  margin: 0 0 4px;
  line-height: 1.2;
}
.uml-tut-header-text .uml-tut-subtitle {
  font-size: 12px;
  color: #a5b4fc;
  margin: 0;
}
.uml-tut-close {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 8px;
  color: #94a3b8;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 16px;
  flex-shrink: 0;
  transition: all .15s;
}
.uml-tut-close:hover { background: rgba(239,68,68,.25); color: #f87171; border-color: #ef4444; }

.uml-tut-illustration {
  background: #0f0f1a;
  border-bottom: 1px solid #1e293b;
  padding: 18px 24px;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: monospace;
  font-size: 12px;
}

.uml-tut-body {
  padding: 20px 24px;
}
.uml-tut-step-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  color: #6366f1;
  text-transform: uppercase;
  margin: 0 0 6px;
}
.uml-tut-desc {
  font-size: 13.5px;
  line-height: 1.65;
  color: #94a3b8;
  margin: 0;
}
.uml-tut-desc strong { color: #c7d2fe; }
.uml-tut-desc code {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 12px;
  color: #7dd3fc;
}

.uml-tut-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  padding: 0 24px 16px;
}
.uml-tut-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #334155;
  transition: all .2s;
  cursor: pointer;
}
.uml-tut-dot.active { background: #6366f1; width: 22px; border-radius: 4px; }
.uml-tut-dot.done   { background: #4ade80; }

.uml-tut-footer {
  padding: 12px 24px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid #1e293b;
}
.uml-tut-btn-skip {
  font-size: 12px;
  color: #475569;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 0;
  transition: color .15s;
}
.uml-tut-btn-skip:hover { color: #94a3b8; }
.uml-tut-nav { display: flex; gap: 8px; }
.uml-tut-btn-prev {
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: transparent;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.uml-tut-btn-prev:hover:not(:disabled) { background: #334155; color: #e2e8f0; }
.uml-tut-btn-prev:disabled { opacity: .3; cursor: default; }
.uml-tut-btn-next {
  padding: 8px 20px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
  box-shadow: 0 4px 12px rgba(99,102,241,.4);
}
.uml-tut-btn-next:hover { background: linear-gradient(135deg, #4f46e5, #7c3aed); transform: translateY(-1px); }

/* Botón abrir tutorial en topbar (mantenemos referencia) */
.uml-tut-open-btn { }

/* ══════════════════════════════════════════════════════════
   PANEL DE CÓDIGO minimizable
   ══════════════════════════════════════════════════════════ */

.uml-code-panel { transition: all .3s ease; }
.uml-code-panel.uml-panel-minimized { display: none !important; }
#uml-code-minimize { opacity: .6; }
#uml-code-minimize:hover { opacity: 1; }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════ */

@media (max-width: 767px) {

  /* Topbar: apilar en dos filas si es necesario */
  .uml-topbar {
    flex-wrap: wrap;
    padding: 6px 8px;
    gap: 6px;
  }
  .uml-tb-center {
    order: 3;
    padding: 0;
    width: 100%;
    justify-content: center;
    border-top: 1px solid #1e293b;
    padding-top: 6px;
  }
  .uml-tb-sep { display: none; }

  /* Cuerpo: columna */
  #uml-body {
    flex-direction: column !important;
    height: auto !important;
  }

  /* Sidebar: ancho completo, colapsado por defecto */
  .uml-sidebar {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    border-right: none !important;
    border-bottom: 1px solid #1e293b;
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s ease;
  }
  .uml-sidebar.open {
    max-height: 520px;
    overflow: auto;
  }
  .uml-sidebar--collapsed { max-height: 0 !important; }
  .uml-sb-collapse-btn { display: none; }
  .uml-sb-expand { display: none !important; }

  /* Botón mobile sidebar */
  #uml-mob-toggle { display: inline-flex !important; }

  /* Canvas */
  #uml-canvas { min-height: 380px !important; }
  .uml-canvas-wrap { min-height: 380px; }

  /* Panel de código */
  #uml-code-panel {
    width: 100%    !important;
    min-width: 0   !important;
    border-left: none !important;
    border-top: 1px solid #21262d !important;
    max-height: 280px;
  }
  #uml-code-panel.visible { display: flex !important; }

  /* Status bar */
  #uml-connect-status { font-size: .65rem; }
  #uml-status         { font-size: .65rem; }
}

@media (max-width: 479px) {
  #uml-canvas { min-height: 300px !important; }
  .uml-canvas-wrap { min-height: 300px; }
  .uml-sidebar.open { max-height: 420px; }
  .uml-zoom-lbl { display: none; }
}
