/* Estilos globales y utilitarios para el Constructor de Emails */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --canvas-bg: #f1f5f9;
  --bs-primary: #4f46e5;
  --bs-primary-rgb: 79, 70, 229;
  --bs-link-color: #4f46e5;
  --bs-link-hover-color: #4338ca;
  --bs-body-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --bs-border-radius: 0.75rem;
  --bs-border-radius-sm: 0.5rem;
  --bs-border-radius-lg: 1rem;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #f8fafc;
  color: #1e293b;
}

/* Contenedores Estándar de la Aplicación */
.container-app {
  max-width: 1220px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

.container-focused {
  max-width: 740px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Tarjetas y Paneles Estilo Moderno */
.card-app {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.card-app:hover {
  border-color: #cbd5e1;
}

/* Botones Primarios y de Acción */
.btn-primary {
  background-color: #4f46e5 !important;
  border-color: #4f46e5 !important;
  color: #ffffff !important;
  font-weight: 600;
}
.btn-primary:hover, .btn-primary:focus {
  background-color: #4338ca !important;
  border-color: #4338ca !important;
}

.btn-success, .btn-send-action {
  background-color: #059669 !important;
  border-color: #059669 !important;
  color: #ffffff !important;
  font-weight: 700;
}
.btn-success:hover, .btn-send-action:hover {
  background-color: #047857 !important;
  border-color: #047857 !important;
}

/* Form Controls */
.form-control, .form-select {
  border-radius: 0.625rem;
  border: 1px solid #cbd5e1;
  font-size: 0.8125rem;
  padding: 0.55rem 0.85rem;
  color: #1e293b;
  background-color: #ffffff;
}
.form-control:focus, .form-select:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  outline: none;
}

/* Small Form Controls & Input Groups: Altura uniforme de 31px */
input.form-control-sm, select.form-select-sm {
  border-radius: 0.5rem;
  font-size: 0.8125rem !important;
  height: 31px !important;
  min-height: 31px !important;
  padding-top: 0.25rem !important;
  padding-bottom: 0.25rem !important;
}
input.form-control-sm {
  padding-left: 0.65rem !important;
  padding-right: 0.65rem !important;
}
select.form-select-sm {
  padding-left: 0.65rem !important;
  padding-right: 2rem !important;
}
.input-group-sm > .form-control,
.input-group-sm > .input-group-text,
.input-group-sm > .form-select {
  height: 31px !important;
  min-height: 31px !important;
  font-size: 0.8125rem !important;
  padding-top: 0.25rem !important;
  padding-bottom: 0.25rem !important;
}

.form-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 0.35rem;
}

/* Color Swatches para Listas de Suscripción */
.color-swatch-btn {
  width: 24px;
  height: 24px;
  border-radius: 50% !important;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  padding: 0;
  outline: none;
  display: inline-block;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  vertical-align: middle;
}
.color-swatch-btn:hover {
  transform: scale(1.12);
}
.color-swatch-btn.selected {
  box-shadow: 0 0 0 2.5px #ffffff, 0 0 0 4.5px #2563eb !important;
  transform: scale(1.08);
}


/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Canvas & Email Viewport */
.canvas-wrapper {
  background-color: var(--canvas-bg);
  background-image: 
    radial-gradient(#cbd5e1 1px, transparent 1px);
  background-size: 20px 20px;
}

.email-viewport {
  transition: max-width 0.25s cubic-bezier(0.4, 0, 0.2, 1), width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* Bloques en el Canvas */
.email-block-wrapper {
  position: relative;
  transition: all 0.15s ease;
  outline: 2px solid transparent;
  outline-offset: -2px;
}

.email-block-wrapper:hover {
  outline: 2px dashed #93c5fd;
}

.email-block-wrapper.is-selected {
  outline: 2px solid #3b82f6 !important;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
  z-index: 10;
}

/* Barra de herramientas flotante del bloque */
.block-toolbar {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  transform: translateY(-4px);
}

.email-block-wrapper:hover .block-toolbar,
.email-block-wrapper.is-selected .block-toolbar {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* Drop zones para Drag & Drop */
.drop-indicator {
  height: 4px;
  background-color: #3b82f6;
  border-radius: 2px;
  margin: 2px 0;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
  animation: pulse-indicator 1.2s infinite ease-in-out;
}

@keyframes pulse-indicator {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.is-dragging {
  opacity: 0.45;
  transform: scale(0.98);
}

.drag-over-top {
  position: relative;
}
.drag-over-top::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 0;
  right: 0;
  height: 4px;
  background-color: #4f46e5;
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(79, 70, 229, 0.8);
  z-index: 50;
  pointer-events: none;
}

.drag-over-bottom {
  position: relative;
}
.drag-over-bottom::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 4px;
  background-color: #4f46e5;
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(79, 70, 229, 0.8);
  z-index: 50;
  pointer-events: none;
}

/* Tarjeta de módulo en panel izquierdo */
.module-card {
  padding: 0.4rem !important;
  transition: all 0.15s ease;
  cursor: grab;
  user-select: none;
}

.module-card .module-icon,
.module-card .module-icon-box {
  width: 24px;
  height: 24px;
}

.module-card .module-icon svg,
.module-card .module-icon-box svg {
  width: 16px !important;
  height: 16px !important;
}

.module-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  border-color: #93c5fd;
}

.module-card:active {
  cursor: grabbing;
}

/* Animaciones y utilitarios */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.2s ease-out forwards;
}

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

/* Monospace font para visor de código */
.font-mono-code {
  font-family: 'JetBrains Mono', Consolas, Monaco, monospace;
}

/* Utilitarios esenciales independientes de CDN */
.hidden {
  display: none !important;
}

img {
  max-width: 100%;
}

/* Clases utilitarias adicionales para controles de imagen responsive */
.accent-indigo-600 {
  accent-color: #4f46e5;
}

.border-indigo-100 {
  border-color: #e0e7ff;
}

.hover\:bg-indigo-50:hover {
  background-color: #eef2ff;
}

.hover\:border-indigo-200:hover {
  border-color: #c7d2fe;
}

.space-y-2\.5 > :not([hidden]) ~ :not([hidden]) {
  margin-top: 0.625rem;
}

.shadow-2xs {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.fluid-img {
  max-width: 100% !important;
  height: auto !important;
}

.fluid-img-full {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
}

/* Responsividad en el canvas del editor cuando se activa vista móvil */
.email-viewport.is-mobile .email-container {
  width: 100% !important;
  max-width: 100% !important;
}

.email-viewport.is-mobile .stack-column,
.email-viewport.is-mobile .stack-column-center {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  direction: ltr !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.email-viewport.is-mobile .stack-column-first {
  margin-bottom: 25px !important;
}

.email-viewport.is-mobile .stack-column-center {
  text-align: center !important;
}

.email-viewport.is-mobile .mobile-center {
  text-align: center !important;
}

.email-viewport.is-mobile .mobile-hide {
  display: none !important;
}

.email-viewport.is-mobile .mobile-padding {
  padding-left: 16px !important;
  padding-right: 16px !important;
}

.email-viewport.is-mobile .gallery-col-1 {
  width: 100% !important;
  max-width: 100% !important;
  display: block !important;
}

.email-viewport.is-mobile .gallery-col-2 {
  width: 50% !important;
  max-width: 50% !important;
  display: inline-block !important;
}

.email-viewport.is-mobile .gallery-col-3 {
  width: 33.333% !important;
  max-width: 33.333% !important;
  display: inline-block !important;
}

.email-viewport.is-mobile .gallery-col-4 {
  width: 50% !important;
  max-width: 50% !important;
  display: inline-block !important;
}

.cursor-pointer {
  cursor: pointer;
}

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

.animate-fade-in {
  animation: fadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.max-w-md {
  max-width: 28rem !important;
}

.max-w-xl, .max-w-600 {
  max-width: 600px !important;
}

/* Clases de botones y colores Emerald para envíos */
.bg-emerald-600 {
  background-color: #059669 !important;
}
.hover\:bg-emerald-700:hover, .bg-emerald-700 {
  background-color: #047857 !important;
}
.bg-emerald-500 {
  background-color: #10b981 !important;
}
.bg-emerald-100 {
  background-color: #d1fae5 !important;
}
.text-emerald-800 {
  color: #065f46 !important;
}
.text-emerald-900 {
  color: #064e3b !important;
}

.btn-send-action {
  background-color: #059669 !important;
  color: #ffffff !important;
}
.btn-send-action:hover {
  background-color: #047857 !important;
  color: #ffffff !important;
}

/* Layout 2 columnas garantizado para vista Configuración */
.config-two-columns {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 15px !important;
  align-items: start !important;
}

@media (max-width: 860px) {
  .config-two-columns {
    grid-template-columns: 1fr !important;
  }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}



