/* ==========================================================================
   Estilos del Conjugador interactivo de verbos en español - Fijate Tools
   ========================================================================== */

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

  /* Paleta cromática corporativa en modo oscuro (predeterminado) */
  --bg-body: #0b0f17;
  --bg-card: #111827;
  --bg-card-subtle: #162032;
  --bg-card-header: #1a2438;
  --bg-input: #0f172a;
  --border-color: #243247;
  --border-color-hover: #3b82f6;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --primary-color: #3b82f6;
  --primary-hover: #2563eb;
  --primary-light: rgba(59, 130, 246, 0.15);

  --accent-amber: #f59e0b;
  --accent-amber-light: rgba(245, 158, 11, 0.16);
  --accent-purple: #a855f7;
  --accent-purple-light: rgba(168, 85, 247, 0.16);
  --accent-pink: #ec4899;
  --accent-pink-light: rgba(236, 72, 153, 0.16);
  --accent-emerald: #10b981;
  --accent-emerald-light: rgba(16, 185, 129, 0.16);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
}

[data-theme="light"] {
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --bg-card-header: #e2e8f0;
  --bg-input: #ffffff;
  --border-color: #cbd5e1;
  --border-color-hover: #2563eb;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;

  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: rgba(37, 99, 235, 0.1);

  --accent-amber: #d97706;
  --accent-amber-light: rgba(217, 119, 6, 0.12);
  --accent-purple: #7c3aed;
  --accent-purple-light: rgba(124, 58, 237, 0.12);
  --accent-pink: #db2777;
  --accent-pink-light: rgba(219, 39, 119, 0.12);
  --accent-emerald: #059669;
  --accent-emerald-light: rgba(5, 150, 105, 0.12);

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Sincronización icono tema */
[data-theme="dark"] .icon-sun { display: inline-block !important; }
[data-theme="dark"] .icon-moon { display: none !important; }
[data-theme="light"] .icon-sun { display: none !important; }
[data-theme="light"] .icon-moon { display: inline-block !important; }

/* Tipografías base */
body {
  font-family: var(--font-main);
  background-color: var(--bg-body);
  color: var(--text-main);
  margin: 0;
  padding: 0;
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6,
.brand-title,
.section-title,
.hero-title,
.faq-section-title {
  font-family: var(--font-heading);
}

.mono,
code,
.verb-form,
.verb-ending,
.verb-stem {
  font-family: var(--font-mono);
}

/* Layout y contención canónica */
.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 y Buscador interactivo */
.conjugator-hero {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
}

.hero-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.hero-title-area h2 {
  margin: 0 0 0.35rem 0;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.hero-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

/* Barra de búsqueda */
.search-form-wrapper {
  position: relative;
  width: 100%;
  margin-bottom: 1.25rem;
}

.search-input-group {
  display: flex;
  position: relative;
  width: 100%;
}

.search-icon-box {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 52px;
  background: var(--bg-input);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 3rem 0 3.25rem;
  font-size: 1.15rem;
  font-family: var(--font-heading);
  color: var(--text-main);
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px var(--primary-light);
}

.btn-search-clear {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-search-clear:hover {
  color: var(--text-main);
}

/* Desplegable de autocompletado */
.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 320px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.autocomplete-dropdown.active {
  display: block;
}

.autocomplete-item {
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.15s;
}

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

.autocomplete-item:hover,
.autocomplete-item.selected {
  background: var(--primary-light);
}

.autocomplete-verb {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text-main);
}

.autocomplete-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Píldoras de verbos populares */
.popular-verbs-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.popular-label {
  font-size: 0.82rem;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 0.25rem;
}

.popular-chip {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}

.popular-chip:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-1px);
}

/* Ficha del verbo actual */
.active-verb-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
}

.verb-headline-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.verb-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.current-verb-name {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0;
  color: var(--text-main);
}

.verb-badges-list {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.badge {
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-group {
  background: var(--primary-light);
  color: var(--primary-color);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-irregular {
  background: var(--accent-amber-light);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-regular {
  background: var(--accent-emerald-light);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-model {
  background: var(--bg-card-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.verb-actions-group {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.btn-verb-action {
  height: 42px;
  padding: 0 1rem;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.15s;
}

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

/* Formas no personales */
.non-finite-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  padding: 1.25rem;
  background: var(--bg-card-subtle);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.non-finite-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.non-finite-label {
  font-size: 0.78rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.non-finite-val {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.non-finite-subval {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.dual-participle-alert {
  font-size: 0.8rem;
  color: var(--accent-amber);
  margin-top: 0.25rem;
}

/* Barra de configuración y filtros */
.conjugation-toolbar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: center;
  justify-content: space-between;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.segmented-control {
  display: inline-flex;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.seg-btn {
  background: transparent;
  border: none;
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 36px;
}

.seg-btn.active {
  background: var(--primary-color);
  color: #ffffff;
}

/* Interruptores Toggle */
.toggle-switch-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-main);
  user-select: none;
}

.toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  background-color: var(--border-color);
  border-radius: 24px;
  transition: background-color 0.2s;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle-input:checked + .toggle-slider {
  background-color: var(--primary-color);
}

.toggle-input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

/* Barra de leyenda de irregularidades */
.irregularity-legend-bar {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  padding: 0.75rem 1rem;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 2rem;
  font-size: 0.82rem;
}

.legend-title {
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot-stem {
  background-color: var(--accent-amber);
}

.legend-dot-ending {
  background-color: var(--accent-purple);
}

.legend-dot-suppletive {
  background-color: var(--accent-pink);
}

/* Modos y Tiempos Verbales */
.mood-section {
  margin-bottom: 3rem;
}

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

.mood-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.mood-badge {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card-subtle);
  color: var(--text-muted);
}

.tenses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

/* Tarjeta individual de tiempo verbal */
.tense-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, border-color 0.15s;
}

.tense-card:hover {
  border-color: var(--primary-color);
}

.tense-card-header {
  background: var(--bg-card-header);
  padding: 0.85rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
}

.tense-card-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.btn-card-copy {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-card-copy:hover {
  color: var(--text-main);
  background: var(--bg-card-subtle);
}

.tense-table {
  width: 100%;
  border-collapse: collapse;
}

.tense-table tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

[data-theme="light"] .tense-table tr {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

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

.tense-table td {
  padding: 0.6rem 1rem;
  vertical-align: middle;
}

.td-pronoun {
  width: 32%;
  color: var(--text-dim);
  font-size: 0.84rem;
}

.td-form {
  width: 68%;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
}

/* Resaltado morfemático de irregularidades */
.highlight-active .stem-irregular {
  color: var(--accent-amber);
  background: var(--accent-amber-light);
  padding: 0.1rem 0.25rem;
  border-radius: 3px;
  font-weight: 700;
}

.highlight-active .ending-irregular {
  color: var(--accent-purple);
  background: var(--accent-purple-light);
  padding: 0.1rem 0.25rem;
  border-radius: 3px;
  font-weight: 700;
}

.highlight-active .form-suppletive {
  color: var(--accent-pink);
  background: var(--accent-pink-light);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-weight: 700;
}

/* Taller interactivo de pronombres enclíticos */
.enclitic-workshop-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 3rem;
  box-shadow: var(--shadow-md);
}

.workshop-title {
  margin: 0 0 0.5rem 0;
  font-size: 1.45rem;
  font-weight: 700;
}

.workshop-desc {
  margin: 0 0 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.workshop-controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.workshop-control-block {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.workshop-control-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.clitic-pills-row {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.clitic-pill-btn {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: var(--font-mono);
  cursor: pointer;
  min-height: 38px;
  transition: all 0.15s;
}

.clitic-pill-btn:hover {
  border-color: var(--primary-color);
}

.clitic-pill-btn.active {
  background: var(--primary-color);
  color: #ffffff;
  border-color: var(--primary-color);
}

.workshop-result-card {
  background: var(--bg-card-subtle);
  border: 2px dashed var(--primary-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.workshop-result-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.workshop-fused-word {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--primary-color);
  margin: 0;
}

.workshop-tag {
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--accent-emerald-light);
  color: var(--accent-emerald);
}

.workshop-explanation-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Modales accesibles y toasts */
.toast-notification {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--primary-color);
  box-shadow: var(--shadow-lg);
  color: var(--text-main);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  z-index: 1000;
  display: none;
  animation: toastFadeIn 0.2s ease-out;
}

.toast-notification.active {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

/* FAQ y Acordeón */
.seo-faq-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 2rem;
}

.faq-section-title {
  margin: 0 0 1.25rem 0;
  font-size: 1.45rem;
  font-weight: 700;
}

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

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

.faq-accordion-trigger {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 1.15rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  font-family: var(--font-heading);
}

.faq-accordion-trigger:hover {
  color: var(--primary-color);
}

.faq-accordion-icon {
  transition: transform 0.2s;
  color: var(--text-dim);
}

.faq-accordion-item.active .faq-accordion-icon {
  transform: rotate(180deg);
}

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

.faq-accordion-item.active .faq-accordion-content {
  display: block;
}

/* Selector nativo */
select.select-field {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  height: 40px;
  background-color: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0 40px 0 0.75rem;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  font-family: var(--font-main);
}

select.select-field::picker-icon {
  display: none;
}

/* Responsive */
@media (max-width: 768px) {
  .hero-header-row {
    flex-direction: column;
    align-items: stretch;
  }

  .tenses-grid {
    grid-template-columns: 1fr;
  }

  .verb-headline-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .current-verb-name {
    font-size: 1.85rem;
  }

  .conjugation-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-left,
  .toolbar-right {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .segmented-control {
    width: 100%;
  }

  .seg-btn {
    flex: 1;
    text-align: center;
  }

  .workshop-fused-word {
    font-size: 1.75rem;
  }
}
