/* Estilos personalizados para el Plan Administrativo - Consultora ABC Training */

:root {
  --primary-navy: #0f172a;
  --primary-blue: #1e40af;
  --accent-gold: #d97706;
  --accent-blue: #3b82f6;
  --bg-slate: #f8fafc;
  --card-border: #e2e8f0;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: #f1f5f9;
  color: #1e293b;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Modo Oscuro */
html.dark body {
  background-color: #0b1120;
  color: #f1f5f9;
}

html.dark .bg-white {
  background-color: #1e293b !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

html.dark .bg-slate-50 {
  background-color: #0f172a !important;
  color: #e2e8f0 !important;
  border-color: #334155 !important;
}

html.dark .bg-slate-100 {
  background-color: #1e293b !important;
  color: #cbd5e1 !important;
}

html.dark .bg-slate-200 {
  background-color: #334155 !important;
  color: #f1f5f9 !important;
}

html.dark .text-slate-900 {
  color: #f8fafc !important;
}

html.dark .text-slate-800 {
  color: #e2e8f0 !important;
}

html.dark .text-slate-700 {
  color: #cbd5e1 !important;
}

html.dark .text-slate-600 {
  color: #94a3b8 !important;
}

html.dark input,
html.dark textarea,
html.dark select {
  background-color: #0f172a !important;
  color: #f8fafc !important;
  border-color: #475569 !important;
}

html.dark input:focus,
html.dark textarea:focus,
html.dark select:focus {
  border-color: #60a5fa !important;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.25) !important;
}

html.dark .border-slate-200,
html.dark .border-slate-300 {
  border-color: #334155 !important;
}

html.dark .divide-slate-200 > :not([hidden]) ~ :not([hidden]) {
  border-color: #334155 !important;
}

html.dark .theory-box {
  background: linear-gradient(to right, #1e293b, #0f172a) !important;
  border-left: 4px solid #60a5fa !important;
  color: #e2e8f0 !important;
}

html.dark .example-box {
  background: linear-gradient(to right, #292524, #1c1917) !important;
  border-left: 4px solid #f59e0b !important;
  color: #fde68a !important;
}

html.dark .org-node-card {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

html.dark .org-level-directivo {
  background: linear-gradient(to bottom, #2e1065, #1e293b) !important;
}

html.dark .org-level-ejecutivo {
  background: linear-gradient(to bottom, #172554, #1e293b) !important;
}

html.dark .org-level-operativo {
  background: linear-gradient(to bottom, #022c22, #1e293b) !important;
}

html.dark .org-level-apoyo {
  background: linear-gradient(to bottom, #451a03, #1e293b) !important;
}

html.dark .flow-step-card {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

/* Transiciones suaves */
.fade-in {
  animation: fadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Barra de progreso de pasos */
.step-node {
  transition: all 0.25s ease;
}

.step-node.active {
  border-color: #2563eb;
  background-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

.step-node.completed {
  border-color: #10b981;
  background-color: #10b981;
  color: #ffffff;
}

.step-node.inactive {
  border-color: #cbd5e1;
  background-color: #ffffff;
  color: #64748b;
}

html.dark .step-node.inactive {
  border-color: #475569;
  background-color: #1e293b;
  color: #94a3b8;
}

/* Botón IA con gradiente y pulso */
.btn-ia {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #db2777 100%);
  color: white;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-ia:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.3);
}

.btn-ia:active {
  transform: translateY(0);
}

/* Botón IA en modo Mejorar (cuando el usuario ya escribió) */
.btn-ia-improve {
  background: linear-gradient(135deg, #d97706 0%, #9333ea 50%, #4f46e5 100%) !important;
  color: white !important;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-ia-improve:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(217, 119, 6, 0.35);
}

.btn-ia-improve:active {
  transform: translateY(0);
}

/* Cajas de teoría y ejemplos */
.theory-box {
  background: linear-gradient(to right, #eff6ff, #f8fafc);
  border-left: 4px solid #3b82f6;
}

.example-box {
  background: linear-gradient(to right, #fefce8, #fffbeb);
  border-left: 4px solid #eab308;
}

/* Organigrama visual */
.org-chart-wrapper {
  overflow-x: auto;
  padding: 1.5rem 0.5rem;
  min-height: 260px;
}

.org-tree {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  position: relative;
}

.org-node-card {
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
  padding: 0.85rem 1rem;
  min-width: 170px;
  max-width: 220px;
  text-align: center;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}

.org-node-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.org-level-directivo {
  border-top: 4px solid #7c3aed;
  background: linear-gradient(to bottom, #faf5ff, #ffffff);
}

.org-level-ejecutivo {
  border-top: 4px solid #2563eb;
  background: linear-gradient(to bottom, #eff6ff, #ffffff);
}

.org-level-operativo {
  border-top: 4px solid #059669;
  background: linear-gradient(to bottom, #ecfdf5, #ffffff);
}

.org-level-apoyo {
  border-top: 4px solid #d97706;
  background: linear-gradient(to bottom, #fffbeb, #ffffff);
}

/* Flujograma visual */
.flow-step-card {
  position: relative;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1rem;
  transition: all 0.2s;
}

.flow-step-card::after {
  content: "➔";
  position: absolute;
  right: -1.25rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.25rem;
  color: #94a3b8;
  font-weight: bold;
}

.flow-step-card:last-child::after {
  display: none;
}

/* Ocultar stepper en portada */
.stepper-hidden {
  display: none !important;
}

/* Estilos de impresión y consolidado */
@media print {
  body {
    background: white !important;
    color: black !important;
    padding: 0 !important;
  }

  .no-print {
    display: none !important;
  }

  .print-page {
    box-shadow: none !important;
    border: none !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 2cm !important;
    page-break-after: always;
  }

  .print-page-break {
    page-break-before: always;
  }
}
