/* ==========================================================================
   EMB Seating Generator - CSS CORREGIDO
   Solo estilos para clases que SÍ existen
   ========================================================================== */

/* ============ VARIABLES (mantener igual) ============ */
:root {
  /* COLORES LIGHT MODE */
  --emb-color-primary: #10b981;
  --emb-color-primary-dark: #059669;
  --emb-color-primary-light: #d1fae5;
  
  --emb-color-secondary: #8b5cf6;
  --emb-color-secondary-dark: #7c3aed;
  
  --emb-color-error: #ef4444;
  --emb-color-error-dark: #dc2626;
  --emb-color-success: #10b981;
  --emb-color-warning: #f59e0b;
  --emb-color-info: #3b82f6;
  
  /* NEUTRALES LIGHT */
  --emb-neutral-50: #f8fafc;
  --emb-neutral-100: #f1f5f9;
  --emb-neutral-200: #e2e8f0;
  --emb-neutral-300: #cbd5e1;
  --emb-neutral-400: #94a3b8;
  --emb-neutral-500: #64748b;
  --emb-neutral-600: #475569;
  --emb-neutral-700: #334155;
  --emb-neutral-800: #1e293b;
  --emb-neutral-900: #0f172a;
  
  /* FONDOS LIGHT */
  --emb-bg-primary: #ffffff;
  --emb-bg-secondary: #f8fafc;
  --emb-bg-tertiary: #f1f5f9;
  --emb-bg-modal: #ffffff;
  
  /* TEXTOS LIGHT */
  --emb-text-primary: #1f2937;
  --emb-text-secondary: #6b7280;
  --emb-text-tertiary: #9ca3af;
  --emb-text-inverse: #ffffff;
  --emb-text-modal: #1f2937;
  
  /* BORDES LIGHT */
  --emb-border-light: #e5e7eb;
  --emb-border-medium: #d1d5db;
  --emb-border-dark: #9ca3af;
  --emb-border-modal: #e5e7eb;
  
  /* SOMBRAS */
  --emb-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --emb-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --emb-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --emb-shadow-modal: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  /* ESPACIADO */
  --emb-space-xs: 4px;
  --emb-space-sm: 8px;
  --emb-space-md: 16px;
  --emb-space-lg: 24px;
  --emb-space-xl: 32px;
  
  /* BORDES REDONDEADOS */
  --emb-radius-sm: 4px;
  --emb-radius-md: 8px;
  --emb-radius-lg: 12px;
  --emb-radius-xl: 16px;
  
  /* TIPOGRAFÍA */
  --emb-font-xs: 11px;
  --emb-font-sm: 12px;
  --emb-font-base: 14px;
  --emb-font-lg: 16px;
  --emb-font-xl: 18px;
}

/* ============ DARK MODE ============ */
@media (prefers-color-scheme: dark) {
  :root {
    /* COLORES DARK */
    --emb-color-primary: #34d399;
    --emb-color-primary-dark: #10b981;
    
    --emb-color-secondary: #a78bfa;
    --emb-color-secondary-dark: #8b5cf6;
    
    --emb-color-error: #f87171;
    --emb-color-error-dark: #dc2626;
    --emb-color-success: #34d399;
    --emb-color-warning: #fbbf24;
    --emb-color-info: #60a5fa;
    
    /* NEUTRALES DARK (invertidos) */
    --emb-neutral-50: #0f172a;
    --emb-neutral-100: #1e293b;
    --emb-neutral-200: #334155;
    --emb-neutral-300: #475569;
    --emb-neutral-400: #64748b;
    --emb-neutral-500: #94a3b8;
    --emb-neutral-600: #cbd5e1;
    --emb-neutral-700: #e2e8f0;
    --emb-neutral-800: #f1f5f9;
    --emb-neutral-900: #f8fafc;
    
    /* FONDOS DARK */
    --emb-bg-primary: #1f2937;
    --emb-bg-secondary: #111827;
    --emb-bg-tertiary: #374151;
    --emb-bg-modal: #1f2937;
    
    /* TEXTOS DARK */
    --emb-text-primary: #f9fafb;
    --emb-text-secondary: #d1d5db;
    --emb-text-tertiary: #9ca3af;
    --emb-text-inverse: #1f2937;
    --emb-text-modal: #f9fafb;
    
    /* BORDES DARK */
    --emb-border-light: #374151;
    --emb-border-medium: #4b5563;
    --emb-border-dark: #6b7280;
    --emb-border-modal: #374151;
    
    /* SOMBRAS DARK */
    --emb-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --emb-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --emb-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --emb-shadow-modal: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
  }
}

/* ==========================================================================
   MODALES BÁSICOS - ESTILOS MINIMALES
   ========================================================================== */

/* MODAL PRINCIPAL */
.emb-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none; /* Por defecto oculto */
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: embModalFadeIn 0.3s ease;
}

.emb-modal[style*="display: block"] {
  display: flex !important;
}

@keyframes embModalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.emb-modal-content {
  background: var(--emb-bg-modal);
  border-radius: var(--emb-radius-md);
  box-shadow: var(--emb-shadow-modal);
  max-width: 95%;
  max-height: 90vh;
  width: 800px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--emb-text-modal);
}

/* HEADER DEL MODAL */
.emb-modal-header {
  padding: var(--emb-space-lg) var(--emb-space-xl);
  background: var(--emb-bg-secondary);
  border-bottom: 1px solid var(--emb-border-modal);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.emb-modal-header h4 {
  margin: 0;
  font-size: var(--emb-font-lg);
  font-weight: 600;
  color: var(--emb-text-primary);
}

.emb-modal-close {
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: var(--emb-text-secondary);
  background: none;
  border: none;
  padding: 0;
  transition: color var(--emb-transition-base);
}

.emb-modal-close:hover {
  color: var(--emb-color-error);
}

/* BODY DEL MODAL */
.emb-modal-body {
  padding: var(--emb-space-xl);
  overflow-y: auto;
  flex: 1;
  background: var(--emb-bg-modal);
}

/* FOOTER DEL MODAL */
.emb-modal-footer {
  padding: var(--emb-space-lg) var(--emb-space-xl);
  background: var(--emb-bg-secondary);
  border-top: 1px solid var(--emb-border-modal);
  display: flex;
  gap: var(--emb-space-sm);
  justify-content: flex-end;
}

/* ==========================================================================
   COMPONENTES DENTRO DEL MODAL (CLASES QUE SÍ EXISTEN)
   ========================================================================== */

/* PESTAÑAS CRUD - según tu código HTML */
.emb-crud-tabs {
  display: flex;
  background: var(--emb-bg-secondary);
  border-bottom: 1px solid var(--emb-border-light);
  margin-bottom: var(--emb-space-lg);
}

.emb-crud-tab {
  padding: var(--emb-space-md) var(--emb-space-lg);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: var(--emb-font-base);
  color: var(--emb-text-secondary);
  transition: all 0.2s ease;
}

.emb-crud-tab:hover {
  color: var(--emb-text-primary);
  background: var(--emb-bg-tertiary);
}

.emb-crud-tab.active {
  color: var(--emb-color-primary);
  border-bottom-color: var(--emb-color-primary);
  background: var(--emb-bg-primary);
  font-weight: 600;
}

.emb-crud-pane {
  display: none;
}

.emb-crud-pane.active {
  display: block;
}

/* SECCIONES DENTRO DEL MODAL */
.emb-add-section,
.emb-delete-section {
  background: var(--emb-bg-secondary);
  border: 1px solid var(--emb-border-light);
  border-radius: var(--emb-radius-md);
  padding: var(--emb-space-lg);
  margin-bottom: var(--emb-space-lg);
}

.emb-add-section h6,
.emb-delete-section h6 {
  margin: 0 0 var(--emb-space-md) 0;
  font-size: var(--emb-font-base);
  font-weight: 600;
  color: var(--emb-text-primary);
}

/* BOTONES BÁSICOS */
.emb-primary-btn,
.emb-secondary-btn,
.emb-danger-btn {
  padding: var(--emb-space-sm) var(--emb-space-lg);
  border-radius: var(--emb-radius-sm);
  border: none;
  font-size: var(--emb-font-base);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.emb-primary-btn {
  background: var(--emb-color-primary);
  color: var(--emb-text-inverse);
}

.emb-primary-btn:hover {
  background: var(--emb-color-primary-dark);
}

.emb-secondary-btn {
  background: var(--emb-bg-tertiary);
  color: var(--emb-text-primary);
  border: 1px solid var(--emb-border-light);
}

.emb-secondary-btn:hover {
  background: var(--emb-neutral-200);
}

.emb-danger-btn {
  background: var(--emb-color-error);
  color: var(--emb-text-inverse);
}

.emb-danger-btn:hover {
  background: var(--emb-color-error-dark);
}

/* ==========================================================================
   ESTILOS EXISTENTES DEL GENERADOR (mantener igual)
   ========================================================================== */

/* Estado de butacas */
.emb-seating-status.has-seats {
  background: var(--emb-color-primary-light);
  border: 1px solid var(--emb-color-primary);
  border-radius: var(--emb-radius-md);
  padding: var(--emb-space-lg);
  margin-bottom: var(--emb-space-xl);
}

.emb-seating-status.no-seats {
  background: var(--emb-bg-secondary);
  border: 1px solid var(--emb-border-light);
  border-radius: var(--emb-radius-md);
  padding: var(--emb-space-lg);
  margin-bottom: var(--emb-space-xl);
}

.emb-status-success {
  display: flex;
  align-items: center;
  gap: var(--emb-space-sm);
}

.emb-seats-count {
  background: var(--emb-color-success);
  color: var(--emb-text-inverse);
  padding: var(--emb-space-xs) var(--emb-space-sm);
  border-radius: var(--emb-radius-lg);
  font-size: var(--emb-font-sm);
  font-weight: 600;
  line-height: 1;
}

/* Generador de zona */
.emb-zone-generator {
  background: var(--emb-bg-primary);
  border: 1px solid var(--emb-border-light);
  border-radius: var(--emb-radius-md);
  padding: var(--emb-space-xl);
  margin-bottom: var(--emb-space-xl);
  box-shadow: var(--emb-shadow-sm);
}

.emb-rows-configuration {
  margin-top: var(--emb-space-xl);
  padding: var(--emb-space-lg);
  background: var(--emb-bg-secondary);
  border-radius: var(--emb-radius-md);
  border: 1px solid var(--emb-border-light);
}

/* Configuración de filas */
.emb-row-config {
  background: var(--emb-bg-primary);
  padding: var(--emb-space-lg);
  border-radius: var(--emb-radius-sm);
  margin-bottom: var(--emb-space-md);
  border: 1px solid var(--emb-border-light);
}

.emb-row-config:last-child {
  margin-bottom: 0;
}

.emb-row-actions {
  display: flex;
  align-items: flex-end;
  gap: var(--emb-space-sm);
}

/* Botones */
.emb-remove-row-btn {
  background: var(--emb-color-error);
  color: var(--emb-text-inverse);
  border: none;
  padding: var(--emb-space-sm) var(--emb-space-md);
  border-radius: var(--emb-radius-sm);
  cursor: pointer;
  font-size: var(--emb-font-sm);
}

.emb-remove-row-btn:hover {
  background: var(--emb-color-error-dark);
}

.emb-add-row-btn {
  background: var(--emb-color-success);
  color: var(--emb-text-inverse);
  border: none;
  padding: var(--emb-space-sm) var(--emb-space-md);
  border-radius: var(--emb-radius-sm);
  cursor: pointer;
  font-size: var(--emb-font-sm);
}

.emb-add-row-btn:hover {
  background: var(--emb-color-primary-dark);
}

/* Grid de butacas */
.emb-seating-grid {
  background: var(--emb-bg-secondary);
  border: 1px solid var(--emb-border-light);
  border-radius: var(--emb-radius-md);
  padding: var(--emb-space-lg);
  max-height: 500px;
  overflow-y: auto;
}

.emb-seating-row {
  display: flex;
  align-items: center;
  margin-bottom: var(--emb-space-sm);
  padding: var(--emb-space-sm);
  background: var(--emb-bg-primary);
  border-radius: var(--emb-radius-sm);
  border: 1px solid var(--emb-border-light);
}

.emb-seating-row-label {
  width: 80px;
  font-weight: 600;
  color: var(--emb-text-primary);
  font-size: var(--emb-font-base);
  flex-shrink: 0;
}

.emb-seating-row-seats {
  display: flex;
  gap: var(--emb-space-xs);
  flex-wrap: wrap;
  flex: 1;
  min-height: 40px;
  align-items: center;
}

/* Butacas */
.emb-seat-preview {
  width: 35px;
  height: 35px;
  background: var(--emb-color-primary);
  color: var(--emb-text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--emb-radius-sm);
  font-size: var(--emb-font-xs);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.emb-seat-preview:hover {
  transform: scale(1.1);
  background: var(--emb-color-primary-dark);
}

.emb-seat-preview.vip {
  background: var(--emb-color-secondary);
}

.emb-seat-preview.vip:hover {
  background: var(--emb-color-secondary-dark);
}

.emb-seat-preview.economy {
  background: var(--emb-neutral-500);
}

.emb-seat-preview.economy:hover {
  background: var(--emb-neutral-600);
  
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
  .emb-modal-content {
    max-width: 95%;
    width: 95%;
    margin: var(--emb-space-sm);
  }
  
  .emb-modal-header,
  .emb-modal-body,
  .emb-modal-footer {
    padding: var(--emb-space-md);
  }
  
  .emb-crud-tabs {
    flex-direction: column;
  }
  
  .emb-crud-tab {
    width: 100%;
    text-align: left;
  }
  
  .emb-seating-row {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .emb-seating-row-label {
    width: 100%;
    margin-bottom: var(--emb-space-xs);
  }
  
  .emb-seating-row-seats {
    width: 100%;
  }
}

/* ==========================================================================
   ACCESIBILIDAD
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .emb-seat-preview:hover {
    transform: none;
  }
  
  .emb-modal {
    animation: none;
  }
}

/* ==========================================================================
   ESTILOS FALTANTES PERO NECESARIOS (según tu código)
   ========================================================================== */

/* Estos estilos probablemente ya los tienes, los mantengo */
.emb-form-input,
.emb-form-select,
.emb-form-textarea {
  width: 100%;
  padding: var(--emb-space-sm) var(--emb-space-md);
  background: var(--emb-bg-primary);
  border: 1px solid var(--emb-border-light);
  border-radius: var(--emb-radius-sm);
  font-size: var(--emb-font-base);
  color: var(--emb-text-primary);
}

.emb-form-input:focus,
.emb-form-select:focus,
.emb-form-textarea:focus {
  outline: none;
  border-color: var(--emb-color-primary);
  box-shadow: 0 0 0 3px var(--emb-color-primary-light);
}

/* Para el dark mode de estos inputs */
@media (prefers-color-scheme: dark) {
  .emb-form-input,
  .emb-form-select,
  .emb-form-textarea {
    background: var(--emb-neutral-200);
    border-color: var(--emb-neutral-400);
    color: var(--emb-text-primary);
  }
  
  .emb-form-input:focus,
  .emb-form-select:focus,
  .emb-form-textarea:focus {
    border-color: var(--emb-color-primary);
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.3);
  }
}

/* SOLUCIÓN TEMPORAL - Asegura visibilidad de textos */
.emb-modal * {
  color: var(--emb-text-primary) !important;
}

/* Fuerza el color en elementos específicos */
h1, h2, h3, h4, h5, h6,
.emb-modal-header h4,
.emb-modal-body h3,
.emb-modal-body h4,
.emb-modal-body h5,
.emb-modal-body h6 {
  color: var(--emb-text-primary) !important;
}