/* ═══════════════════════════════════════════════════════════════
   PDF EDITOR STYLES V2  ·  Estilos del Editor de Plantillas
   Hacienda San Miguel · Cotizador de Bodas
   ─────────────────────────────────────────────────────────────────
   Estilos para el panel de edición de plantillas PDF
   ═══════════════════════════════════════════════════════════════ */

/* ── LAYOUT PRINCIPAL DEL EDITOR ────────────────────────────────── */
.pdf-editor-layout-v2 {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  margin-top: 20px;
  min-height: calc(100vh - 200px);
}

@media (max-width: 1200px) {
  .pdf-editor-layout-v2 {
    grid-template-columns: 1fr;
  }
}

/* ── SIDEBAR DE CONFIGURACIÓN ───────────────────────────────────── */
.pdf-editor-sidebar-v2 {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: fit-content;
  position: sticky;
  top: 80px;
}

/* ── CARDS DE CONFIGURACIÓN ─────────────────────────────────────── */
.config-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xs);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.config-card:hover {
  box-shadow: var(--sh-sm);
}

.config-card-header {
  background: linear-gradient(to bottom, var(--gray-50), white);
  border-bottom: 1px solid var(--gray-150);
  padding: 12px 16px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  gap: 8px;
}

.config-card-header i {
  color: var(--brand-primary);
  font-size: 0.85rem;
}

.config-card-body {
  padding: 16px;
}

/* ── LISTA DE SECCIONES ─────────────────────────────────────────── */
.secciones-list-v2 {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.seccion-item-v2 {
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--r-md);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s;
  cursor: move;
}

.seccion-item-v2:hover {
  background: white;
  border-color: var(--brand-primary);
  box-shadow: 0 2px 8px rgba(200, 105, 26, 0.1);
}

.seccion-item-v2.active {
  background: #FDF0E6;
  border-color: var(--brand-primary);
}

.seccion-drag-handle {
  color: var(--gray-400);
  cursor: grab;
  font-size: 0.9rem;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.seccion-item-v2:hover .seccion-drag-handle {
  opacity: 1;
}

.seccion-drag-handle:active {
  cursor: grabbing;
}

.seccion-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gray-700);
}

.seccion-info i {
  color: var(--brand-primary);
  font-size: 0.8rem;
}

.seccion-nombre {
  flex: 1;
}

.seccion-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-icon-sm {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.8rem;
}

.btn-icon-sm:hover {
  background: var(--brand-primary);
  color: white;
}

/* ── TOGGLE SWITCH PEQUEÑO ──────────────────────────────────────── */
.toggle-switch-sm {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

.toggle-switch-sm input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider-sm {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--gray-300);
  transition: 0.3s;
  border-radius: 22px;
}

.toggle-slider-sm:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch-sm input:checked + .toggle-slider-sm {
  background-color: var(--brand-primary);
}

.toggle-switch-sm input:checked + .toggle-slider-sm:before {
  transform: translateX(18px);
}

/* ── PANEL DE VISTA PREVIA ──────────────────────────────────────── */
.pdf-editor-preview-v2 {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 800px;
}

.pdf-preview-header-v2 {
  background: white;
  border-bottom: 1px solid var(--gray-200);
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pdf-preview-actions {
  display: flex;
  gap: 8px;
}

.pdf-preview-body-v2 {
  flex: 1;
  overflow-y: auto;
  padding: 30px 20px;
  background: linear-gradient(to bottom, var(--gray-100), var(--gray-50));
}

/* ── FORM HINT ──────────────────────────────────────────────────── */
.form-hint {
  font-size: 0.75rem;
  color: var(--gray-400);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-hint i {
  font-size: 0.7rem;
}

/* ── CODE SNIPPETS EN MODALES ───────────────────────────────────── */
code {
  background: var(--gray-100);
  color: var(--brand-primary);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.85em;
  font-weight: 500;
  border: 1px solid var(--gray-200);
}

/* ── RESPONSIVE ─────────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .pdf-editor-sidebar-v2 {
    position: static;
    top: auto;
  }

  .pdf-editor-preview-v2 {
    min-height: 600px;
  }
}

@media (max-width: 768px) {
  .pdf-editor-layout-v2 {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .pdf-preview-body-v2 {
    padding: 20px 10px;
  }

  .pdf-document-v2 {
    transform: scale(0.7) !important;
  }
}

/* ── ANIMACIONES ────────────────────────────────────────────────── */
.config-card {
  animation: fadeInUp 0.3s ease-out;
}

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

.seccion-item-v2 {
  animation: slideIn 0.2s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ── FIN DE ESTILOS PDF EDITOR V2 ───────────────────────────────── */
