/* Estilos personalizados para Sistema GesDocRol */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  font-family: var(--font-main);
  background-color: #f8fafc;
  color: #1e293b;
  -webkit-tap-highlight-color: transparent;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Estilos de Organigrama */
#orgTreeContainer {
  overflow-x: auto;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #f1f5f9;
  cursor: grab;
  user-select: none;
  -webkit-overflow-scrolling: touch;
}

#orgTreeContainer.is-dragging {
  cursor: grabbing !important;
  user-select: none !important;
}

#orgTreeContainer::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}

#orgTreeContainer::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 8px;
}

#orgTreeContainer::-webkit-scrollbar-thumb {
  background-color: #94a3b8;
  border-radius: 8px;
  border: 2px solid #f1f5f9;
}

#orgTreeContainer::-webkit-scrollbar-thumb:hover {
  background-color: #64748b;
}

.org-tree {
  display: block;
  width: max-content;
  min-width: 100%;
  margin: 0;
  padding: 24px 80px 60px 80px;
  box-sizing: border-box;
  transform-origin: top center;
  transition: transform 0.15s ease-out;
}

.org-tree > ul {
  display: flex;
  justify-content: center;
  flex-wrap: nowrap;
  width: max-content;
  min-width: 100%;
  margin: 0 auto;
  padding: 0;
}

.org-tree ul {
  padding-top: 24px;
  position: relative;
  display: flex;
  justify-content: center;
  flex-wrap: nowrap;
  width: max-content;
  margin: 0 auto;
}

.org-tree li {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  list-style-type: none;
  position: relative;
  padding: 24px 14px 0 14px;
  box-sizing: border-box;
  transition: all 0.3s;
}

/* Conectores con pseudo-elementos ::before y ::after */
.org-tree li::before, .org-tree li::after {
  content: '';
  position: absolute;
  top: 0;
  right: 50%;
  border-top: 2px solid #cbd5e1;
  width: 50%;
  height: 24px;
}

.org-tree li::after {
  right: auto;
  left: 50%;
  border-left: 2px solid #cbd5e1;
}

.org-tree li:only-child::after, .org-tree li:only-child::before {
  display: none;
}

.org-tree li:only-child {
  padding-top: 0;
}

.org-tree li:first-child::before, .org-tree li:last-child::after {
  border: 0 none;
}

.org-tree li:last-child::before {
  border-right: 2px solid #cbd5e1;
  border-radius: 0 8px 0 0;
}

.org-tree li:first-child::after {
  border-radius: 8px 0 0 0;
}

.org-tree ul ul::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  border-left: 2px solid #cbd5e1;
  width: 0;
  height: 24px;
}

/* Tarjeta del nodo del organigrama */
.org-node {
  border: 1px solid #e2e8f0;
  padding: 12px 14px;
  text-decoration: none;
  color: #334155;
  background: #ffffff;
  font-size: 13px;
  display: inline-block;
  border-radius: 14px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  min-width: 220px;
  max-width: 270px;
  position: relative;
  z-index: 2;
  user-select: auto;
}

.org-node:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  border-color: #3b82f6;
}

/* Niveles con acentos distintivos */
.level-badge-1 { background-color: #1e3a8a; color: #ffffff; }
.level-badge-2 { background-color: #2563eb; color: #ffffff; }
.level-badge-3 { background-color: #0d9488; color: #ffffff; }
.level-badge-4 { background-color: #4f46e5; color: #ffffff; }

/* Modal Backdrop */
.modal-backdrop {
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
}

/* Efectos de pulso y estados */
.pulse-dot {
  position: relative;
}
.pulse-dot::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: inherit;
  opacity: 0.75;
  animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes ping {
  75%, 100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* Tarjetas de temas de colores */
.theme-preset-card {
  cursor: pointer;
  user-select: none;
  background-color: #ffffff;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.theme-preset-card:hover {
  transform: translateY(-2px);
}
.theme-preset-card.active-theme {
  border-color: var(--brand-600, #2563eb) !important;
  box-shadow: 0 0 0 2px var(--brand-500, #3b82f6), 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
