/**
 * Estilos para Sistema de Modales y Diálogos Accesibles
 * Fijate Tools - SVG Surgeon
 */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(5, 8, 17, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.active .modal-card {
  transform: translateY(0) scale(1);
}

.modal-card.modal-lg {
  max-width: 860px;
}

.modal-card.modal-sm {
  max-width: 440px;
}

.modal-header {
  padding: 1.1rem 1.4rem;
  background-color: rgba(30, 41, 59, 0.4);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

[data-theme="light"] .modal-header {
  background-color: rgba(241, 245, 249, 0.8);
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.modal-close-btn:hover {
  background-color: var(--bg-surface-elevated);
  color: var(--text-primary);
}

.modal-body {
  padding: 1.4rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.modal-footer {
  padding: 1rem 1.4rem;
  background-color: rgba(30, 41, 59, 0.25);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
}

/* Modales de Confirmación y Alertas */
.confirm-icon-box {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.confirm-icon-danger {
  background-color: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
}

.confirm-icon-info {
  background-color: rgba(59, 130, 246, 0.15);
  color: var(--accent-primary);
}

.confirm-icon-success {
  background-color: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
}

/* Modal de Exportación de Código */
.export-nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.5rem;
  overflow-x: auto;
}

.export-tab-btn {
  padding: 0.45rem 0.85rem;
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.export-tab-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-surface-elevated);
}

.export-tab-btn.active {
  color: var(--text-primary);
  background-color: var(--bg-surface-elevated);
  border-color: var(--border-focus);
}

.code-snippet-box {
  background-color: var(--bg-code);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  position: relative;
}

.code-snippet-pre {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #e2e8f0;
  max-height: 280px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.55;
}

.code-snippet-copy-btn {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
}

/* Tabla de Procesamiento por Lotes */
.batch-table-wrap {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  max-height: 320px;
  overflow-y: auto;
}

.batch-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  text-align: left;
}

.batch-table th {
  background-color: var(--bg-surface-elevated);
  padding: 0.6rem 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
}

.batch-table td {
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.batch-table tr:last-child td {
  border-bottom: none;
}

/* Notificaciones Flotantes (Toasts) */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  box-shadow: var(--shadow-lg);
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-primary);
  transform: translateY(10px);
  opacity: 0;
  animation: toastIn 0.25s forwards cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 380px;
}

@keyframes toastIn {
  to { transform: translateY(0); opacity: 1; }
}

.toast.toast-out {
  animation: toastOut 0.2s forwards ease;
}

@keyframes toastOut {
  to { transform: translateY(10px); opacity: 0; }
}

.toast-icon-success { color: var(--accent-emerald); }
.toast-icon-info { color: var(--accent-primary); }
.toast-icon-warning { color: var(--accent-amber); }
.toast-icon-error { color: var(--accent-rose); }
