/**
 * Estilos canónicos del Traductor de correos corporativos pasivo-agresivos
 * Fijate Tools - 2026
 */

:root {
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Colores tema claro */
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-alt: #f1f5f9;
  --bg-input: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --border-focus: #3b82f6;

  /* Acentos temáticos */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  
  --color-mode-a: #0284c7;
  --color-mode-a-bg: #e0f2fe;
  --color-mode-b: #e11d48;
  --color-mode-b-bg: #ffe4e6;

  --accent-diplomatic: #0d9488;
  --accent-diplomatic-bg: #ccfbf1;
  --accent-assertive: #2563eb;
  --accent-assertive-bg: #dbeafe;
  --accent-legal: #7c3aed;
  --accent-legal-bg: #ede9fe;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.12);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

[data-theme="dark"],
body.dark-theme {
  --bg-body: #0b0f17;
  --bg-card: #151b28;
  --bg-card-alt: #1e2638;
  --bg-input: #121722;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: #273144;
  --border-focus: #60a5fa;

  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-light: #1e293b;

  --color-mode-a: #38bdf8;
  --color-mode-a-bg: #082f49;
  --color-mode-b: #fb7185;
  --color-mode-b-bg: #4c0519;

  --accent-diplomatic: #2dd4bf;
  --accent-diplomatic-bg: #134e4a;
  --accent-assertive: #60a5fa;
  --accent-assertive-bg: #1e3a8a;
  --accent-legal: #a78bfa;
  --accent-legal-bg: #3b0764;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.6);
}

/* Reset y base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-body);
  color: var(--text-main);
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6,
.brand-title,
.section-title,
.card-header-title {
  font-family: var(--font-heading);
  color: var(--text-main);
}

/* Layout canónico */
.main-wrapper.tool-layout {
  max-width: 1200px;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
  box-sizing: border-box;
  flex: 1 0 auto;
  width: 100%;
}

.tool-with-sidebar {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  width: 100%;
}

.tool-main-content {
  flex: 1 1 0%;
  min-width: 0;
  width: 100%;
}

/* Hero introductorio */
.tool-hero {
  text-align: center;
  margin-bottom: 2rem;
  padding: 1.5rem 1rem;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(14, 165, 233, 0.04) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.tool-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary);
  margin-bottom: 0.85rem;
}

.tool-hero h2 {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.6rem;
}

.tool-hero p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 760px;
  margin: 0 auto;
}

/* Conmutador de modos principales (Modo A / Modo B) */
.mode-nav-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.mode-tab-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 52px;
  transition: all 0.2s ease;
  user-select: none;
}

.mode-tab-btn:hover {
  border-color: var(--border-focus);
  color: var(--text-main);
  transform: translateY(-1px);
}

.mode-tab-btn.active[data-mode="modeA"] {
  border-color: var(--color-mode-a);
  background: var(--color-mode-a-bg);
  color: var(--color-mode-a);
  box-shadow: var(--shadow-sm);
}

.mode-tab-btn.active[data-mode="modeB"] {
  border-color: var(--color-mode-b);
  background: var(--color-mode-b-bg);
  color: var(--color-mode-b);
  box-shadow: var(--shadow-sm);
}

.mode-tab-btn svg {
  flex-shrink: 0;
}

/* Tarjeta principal */
.card-main {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
}

/* Píldoras de categorías rápidas */
.filter-pills-wrap {
  margin-bottom: 1.25rem;
}

.filter-pills-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: none;
}

.filter-pills-list {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
  scrollbar-width: thin;
}

.pill-filter-btn {
  white-space: nowrap;
  padding: 0.45rem 0.95rem;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  background: var(--bg-card-alt);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  transition: all 0.15s ease;
}

.pill-filter-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.pill-filter-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  font-weight: 600;
}

/* Desplegable de selección de frases prediseñadas */
.preset-select-group {
  margin-bottom: 1.5rem;
}

.preset-select-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.preset-select-box {
  position: relative;
  width: 100%;
}

.preset-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0.65rem 2.5rem 0.65rem 0.9rem;
  background-color: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 0.95rem;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  appearance: none;
  cursor: pointer;
}

.preset-select:focus {
  outline: none;
  border-color: var(--border-focus);
}

.preset-select option {
  background-color: var(--bg-card);
  color: var(--text-main);
}

.preset-select-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-muted);
}

/* Área de texto personalizada */
.input-textarea-group {
  margin-bottom: 1.5rem;
}

.input-textarea-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.input-textarea-label {
  font-weight: 600;
  font-size: 0.92rem;
}

.textarea-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-small-action {
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card-alt);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-small-action:hover {
  color: var(--text-main);
  border-color: var(--text-muted);
}

.custom-textarea {
  width: 100%;
  min-height: 100px;
  padding: 0.85rem;
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 0.98rem;
  resize: vertical;
  line-height: 1.5;
}

.custom-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
}

.input-textarea-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Botón principal de traducción / análisis */
.btn-submit-action {
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  border: none;
  background: var(--primary);
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.btn-submit-action:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* SECCIÓN DE RESULTADOS */
.results-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px dashed var(--border-color);
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.results-header-title {
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Tarjetas de resultados Modo A (3 versiones) */
.results-grid-mode-a {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 900px) {
  .results-grid-mode-a {
    grid-template-columns: repeat(3, 1fr);
  }
}

.result-card {
  background: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: all 0.2s ease;
}

.result-card:hover {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-md);
}

.result-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: none;
  margin-bottom: 0.85rem;
  align-self: flex-start;
}

.badge-diplomatic {
  background: var(--accent-diplomatic-bg);
  color: var(--accent-diplomatic);
}

.badge-assertive {
  background: var(--accent-assertive-bg);
  color: var(--accent-assertive);
}

.badge-legal {
  background: var(--accent-legal-bg);
  color: var(--accent-legal);
}

.result-card-body {
  flex: 1 1 auto;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
  color: var(--text-main);
  background: var(--bg-card);
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  white-space: pre-wrap;
  word-break: break-word;
}

.result-card-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-card-copy {
  flex: 1;
  min-height: 40px;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
}

.btn-card-copy:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.btn-card-share {
  min-height: 40px;
  min-width: 40px;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-card-share:hover {
  color: var(--text-main);
  border-color: var(--border-focus);
}

/* SECCIÓN DE RESULTADOS MODO B (RADAR) */
.radar-result-box {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.radar-toxicity-card {
  background: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.radar-metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.radar-metric-title {
  font-weight: 700;
  font-size: 1rem;
}

.radar-score-badge {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 800;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.radar-bar-track {
  width: 100%;
  height: 14px;
  background: var(--border-color);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
  margin-bottom: 0.75rem;
}

.radar-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 9999px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.4s ease;
}

.radar-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Niveles de toxicidad */
.tox-green {
  background: #10b981;
  color: #064e3b;
}
[data-theme="dark"] .tox-green,
body.dark-theme .tox-green {
  background: #059669;
  color: #d1fae5;
}

.tox-yellow {
  background: #f59e0b;
  color: #78350f;
}
[data-theme="dark"] .tox-yellow,
body.dark-theme .tox-yellow {
  background: #d97706;
  color: #fef3c7;
}

.tox-orange {
  background: #ea580c;
  color: #7c2d12;
}
[data-theme="dark"] .tox-orange,
body.dark-theme .tox-orange {
  background: #c2410c;
  color: #ffedd5;
}

.tox-red {
  background: #dc2626;
  color: #ffffff;
}
[data-theme="dark"] .tox-red,
body.dark-theme .tox-red {
  background: #ef4444;
  color: #ffffff;
}

/* Desglose de significado y contramedida */
.radar-details-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .radar-details-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.radar-detail-col {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}

.radar-col-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.radar-col-content {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-main);
  flex: 1 1 auto;
}

.radar-col-content.raw-subtext {
  font-style: italic;
  color: var(--text-main);
  background: var(--bg-card-alt);
  padding: 0.85rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--color-mode-b);
}

.radar-col-content.counter-subtext {
  background: var(--bg-card-alt);
  padding: 0.85rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent-diplomatic);
}

/* Botón global para generar tarjeta visual para redes */
.share-banner-box {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(124, 58, 237, 0.08) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.share-banner-info h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.share-banner-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.btn-generate-card {
  min-height: 44px;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.btn-generate-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  filter: brightness(1.05);
}

/* MODAL DE TARJETA VISUAL (CANVAS PREVIEW) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 15, 23, 0.82);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: transform 0.25s ease;
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.btn-close-modal {
  min-height: 40px;
  min-width: 40px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-close-modal:hover {
  color: var(--text-main);
  border-color: var(--text-main);
}

.modal-canvas-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 1.25rem;
  background: #0b0f17;
  border-radius: var(--radius-md);
  padding: 0.5rem;
}

.modal-canvas-wrap canvas {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-modal-download {
  flex: 1;
  min-height: 44px;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  border: none;
  background: var(--primary);
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-modal-download:hover {
  background: var(--primary-hover);
}

/* TOAST ACCESIBLE */
.toast-notice {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #0f172a;
  color: #ffffff;
  border: 1px solid var(--border-color);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 10000;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: all 0.25s ease;
}

.toast-notice.show {
  opacity: 1;
  transform: translateY(0);
}

/* ACORDEÓN DE PREGUNTAS FRECUENTES (SEO) */
.faq-section {
  margin-top: 3rem;
  margin-bottom: 2rem;
}

.faq-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.faq-accordion {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  overflow: hidden;
}

.faq-item {
  border-bottom: 1px solid var(--border-color);
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-question {
  width: 100%;
  padding: 1.15rem 1.25rem;
  background: transparent;
  border: none;
  text-align: left;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 48px;
}

.faq-question:hover {
  background: var(--bg-card-alt);
}

.faq-question svg {
  transition: transform 0.25s ease;
  flex-shrink: 0;
  color: var(--text-muted);
}

.faq-item.open .faq-question svg {
  transform: rotate(180deg);
}

.faq-answer {
  display: none;
  padding: 0 1.25rem 1.25rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.faq-item.open .faq-answer {
  display: block;
}

/* RESPONSIVE */
@media (max-width: 640px) {
  .mode-nav-tabs {
    grid-template-columns: 1fr;
  }

  .tool-hero h2 {
    font-size: 1.5rem;
  }

  .card-main {
    padding: 1.25rem;
  }

  .share-banner-box {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn-generate-card {
    width: 100%;
    justify-content: center;
  }
}
