/* ==========================================================================
   RecuMail - Estilos Globales, Tokens de Diseño Claro & Elegante
   Inspirado en diseño UI de alta gama: Stripe, Linear, Apple y Notion
   ========================================================================== */

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

:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --bg-primary: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  
  --border-light: #e2e8f0;
  --border-strong: #cbd5e1;
  --border-focus: #4f46e5;
  
  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --brand-primary: #4338ca;
  --brand-light: #eef2ff;
  --brand-accent: #3b82f6;
  
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.07), 0 4px 6px -4px rgba(15, 23, 42, 0.03);
  --shadow-modal: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.05);
}

* {
  font-family: var(--font-sans);
  box-sizing: border-box;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  overflow-x: hidden;
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.03) 0px, transparent 40%),
    radial-gradient(at 100% 100%, rgba(59, 130, 246, 0.02) 0px, transparent 40%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

/* Paneles y Tarjetas Elegantes en Fondo Claro */
.glass-panel {
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-panel:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
}

.card-elevated {
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 16px;
  box-shadow: 0 4px 14px 0 rgba(15, 23, 42, 0.04);
}

/* Scrollbars Limpios */
::-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;
}

/* Píldoras de Variables Dinámicas */
.var-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 8px;
  background-color: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.var-pill:hover {
  background-color: #e0e7ff;
  border-color: #c7d2fe;
  color: #3730a3;
  transform: translateY(-1px);
}

/* Marco Simulador de Móvil */
.mobile-frame-container {
  width: 360px;
  margin: 0 auto;
  border: 12px solid #1e293b;
  border-radius: 40px;
  box-shadow: 0 20px 35px -10px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  background: #ffffff;
}

.mobile-notch {
  width: 130px;
  height: 18px;
  background: #1e293b;
  margin: 0 auto;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

/* Marco Desktop Estándar */
.desktop-preview-container {
  max-width: 640px;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

/* Bloques Modulares del Constructor de Email */
.modular-block {
  position: relative;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.modular-block:hover {
  border-color: #818cf8;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.08);
}

.modular-block-actions {
  display: flex;
  gap: 0.25rem;
}

/* Consola de Logs con Diseño Técnico Claro */
.terminal-console {
  font-family: var(--font-mono);
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

/* Indicadores de Estado */
.status-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.status-online {
  background-color: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.status-busy {
  background-color: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.status-offline {
  background-color: #94a3b8;
}

/* Transiciones Suaves entre Vistas */
.view-section {
  display: none;
  animation: fadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.view-section.active {
  display: block;
}

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

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

/* Mailpro Studio Block Tiles & Canvas */
.block-tile {
  cursor: pointer;
  user-select: none;
  background: #ffffff;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.block-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px -2px rgba(99, 102, 241, 0.12);
}

.block-tile:active {
  transform: translateY(0);
}

/* Campos de texto editables en vivo (WYSIWYG) */
[data-editable-field] {
  cursor: text;
  transition: all 0.15s ease;
  border-radius: 4px;
  min-height: 1.2em;
}

[data-editable-field]:hover {
  background-color: rgba(99, 102, 241, 0.07);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.35);
}

[data-editable-field]:focus {
  background-color: rgba(99, 102, 241, 0.1);
  box-shadow: 0 0 0 2px #6366f1;
  outline: none;
}

/* Barra flotante de acciones sobre bloques del lienzo */
.block-floating-bar {
  animation: fadeIn 0.15s ease-out;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}

