/* Estilos canónicos para la Calculadora del Maestro Paellero
 * Fijate Tools - fijate.com
 */

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

  /* Paleta cromática - Gastronómica premium (Azafrán, Fuego y Acero) */
  --bg-page: #fbf9f5;
  --bg-card: #ffffff;
  --bg-card-alt: #f5f0e8;
  --border-color: #e5ded3;
  --border-highlight: #d97706;
  --text-main: #232220;
  --text-muted: #645e56;
  --text-inverted: #ffffff;

  --accent-saffron: #d97706;
  --accent-saffron-light: #fef3c7;
  --accent-fire: #ea580c;
  --accent-fire-light: #ffedd5;
  --accent-socarrat: #b45309;
  --accent-charcoal: #1c1917;
  --accent-success: #15803d;
  --accent-success-light: #dcfce7;

  --shadow-sm: 0 1px 3px rgba(35, 34, 32, 0.05);
  --shadow-md: 0 4px 12px rgba(35, 34, 32, 0.08);
  --shadow-lg: 0 10px 25px -3px rgba(217, 119, 6, 0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

[data-theme="dark"],
body.dark-mode {
  --bg-page: #0b0f17;
  --bg-card: #141c2a;
  --bg-card-alt: #1c2638;
  --border-color: #24324a;
  --border-highlight: #f59e0b;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-inverted: #0b0f17;

  --accent-saffron: #f59e0b;
  --accent-saffron-light: rgba(245, 158, 11, 0.15);
  --accent-fire: #fb923c;
  --accent-fire-light: rgba(251, 146, 60, 0.15);
  --accent-socarrat: #f97316;
  --accent-charcoal: #e2e8f0;
  --accent-success: #22c55e;
  --accent-success-light: rgba(34, 197, 94, 0.15);

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

/* Reset y estructura básica */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

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

.mono, code, .kpi-num, .timer-digits {
  font-family: var(--font-mono);
}

/* Layout principal */
.tool-layout {
  max-width: 1200px;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
  width: 100%;
}

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

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

/* Encabezado hero de la herramienta */
.tool-hero {
  margin-bottom: 2rem;
}

.tool-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  text-transform: lowercase;
}

.badge-pill:first-letter {
  text-transform: uppercase;
}

.badge-saffron {
  background: var(--accent-saffron-light);
  color: var(--accent-saffron);
  border: 1px solid rgba(217, 119, 6, 0.25);
}

.badge-fire {
  background: var(--accent-fire-light);
  color: var(--accent-fire);
  border: 1px solid rgba(234, 88, 12, 0.25);
}

.tool-title-main {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.tool-desc-lead {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 850px;
}

/* Rejilla de trabajo: 2 columnas (Formulario + Resultados) */
.paella-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (min-width: 900px) {
  .paella-grid {
    grid-template-columns: 1.05fr 1.15fr;
  }
}

/* Tarjetas */
.card-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

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

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

.card-title-with-icon {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.2rem;
}

/* Formularios y controles */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-main);
}

.form-help {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

/* Selector de tipo de arroz (Tabs horizontales compactos) */
.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
  background: var(--bg-card-alt);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.segmented-control input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-control label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.6rem 0.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  min-height: 44px;
}

.segmented-control input[type="radio"]:checked + label {
  background: var(--bg-card);
  color: var(--accent-saffron);
  box-shadow: var(--shadow-sm);
}

/* Selector de comensales numérico con botones */
.stepper-wrapper {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  overflow: hidden;
  height: 48px;
}

.btn-stepper {
  width: 52px;
  height: 100%;
  background: var(--bg-card-alt);
  border: none;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease;
}

.btn-stepper:hover {
  background: var(--border-color);
}

.input-stepper {
  flex: 1 1 0%;
  width: 0;
  min-width: 0;
  height: 100%;
  border: none;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  font-family: var(--font-mono);
  background: transparent;
  color: var(--text-main);
  outline: none;
}

/* Campos select responsivos canónicos */
.select-custom {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 2.5rem 0 0.85rem;
  font-size: 0.92rem;
  font-family: var(--font-main);
  background-color: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  outline: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  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='%23d97706' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.select-custom:focus {
  border-color: var(--border-highlight);
  box-shadow: 0 0 0 3px var(--accent-saffron-light);
}

.select-custom option {
  background-color: var(--bg-card);
  color: var(--text-main);
  padding: 0.5rem;
}

[data-theme="dark"] .select-custom option {
  background-color: #141c2a;
  color: #f1f5f9;
}

/* Input con sufijo / unidad */
.input-with-unit {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  overflow: hidden;
  height: 44px;
}

.input-with-unit input {
  flex: 1 1 0%;
  width: 0;
  min-width: 0;
  height: 100%;
  border: none;
  padding: 0 0.85rem;
  font-size: 0.95rem;
  font-family: var(--font-mono);
  background: transparent;
  color: var(--text-main);
  outline: none;
}

.unit-tag {
  padding: 0 0.85rem;
  background: var(--bg-card-alt);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  height: 100%;
  display: flex;
  align-items: center;
  border-left: 1px solid var(--border-color);
}

/* Rejilla de 2 columnas de inputs ambientales */
.form-row-dual {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 520px) {
  .form-row-dual {
    grid-template-columns: 1fr 1fr;
  }
}

/* KPI Cards de Resultados */
.kpis-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.kpi-card {
  background: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.kpi-card-featured {
  grid-column: span 2;
  background: linear-gradient(135deg, var(--accent-saffron-light), var(--bg-card));
  border: 1px solid rgba(217, 119, 6, 0.35);
  box-shadow: var(--shadow-sm);
}

.kpi-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.kpi-value-row {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.kpi-num {
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-main);
}

.kpi-card-featured .kpi-num {
  color: var(--accent-saffron);
}

.kpi-unit {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
}

.kpi-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  line-height: 1.3;
}

/* Visualizador SVG de la paella */
.paella-svg-container {
  background: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
  margin-bottom: 1.25rem;
}

.paella-svg-box {
  width: 100%;
  max-width: 280px;
  height: 280px;
  margin: 0 auto;
}

.svg-caption-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0 0.5rem;
}

/* Ficha técnica y consejos del maestro paellero */
.technical-sheet {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.tech-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--border-color);
  font-size: 0.86rem;
}

.tech-row:last-child {
  border-bottom: none;
}

.tech-key {
  color: var(--text-muted);
  font-weight: 500;
}

.tech-val {
  font-weight: 700;
  text-align: right;
}

.advice-callout {
  background: var(--accent-fire-light);
  border-left: 4px solid var(--accent-fire);
  padding: 0.85rem 1rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-bottom: 1.25rem;
  font-size: 0.88rem;
}

.advice-callout strong {
  color: var(--accent-fire);
  display: block;
  margin-bottom: 0.25rem;
}

.advice-list {
  padding-left: 1.25rem;
  margin-top: 0.4rem;
  font-size: 0.84rem;
  color: var(--text-main);
}

.advice-list li {
  margin-bottom: 0.35rem;
}

/* Temporizador acústico del socarrat */
.timer-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
  position: relative;
  transition: all 0.3s ease;
}

.timer-card.socarrat-alert-active {
  border-color: var(--accent-fire);
  box-shadow: 0 0 25px rgba(234, 88, 12, 0.35);
  animation: pulse-socarrat 1.5s infinite alternate ease-in-out;
}

@keyframes pulse-socarrat {
  from {
    border-color: var(--accent-fire);
    box-shadow: 0 0 15px rgba(234, 88, 12, 0.2);
  }
  to {
    border-color: #ef4444;
    box-shadow: 0 0 35px rgba(239, 68, 68, 0.5);
  }
}

.timer-digits-wrapper {
  text-align: center;
  margin: 1rem 0;
}

.timer-digits {
  font-size: clamp(3rem, 7vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  line-height: 1;
}

.timer-phase-banner {
  background: var(--bg-card-alt);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  text-align: center;
}

.timer-phase-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent-saffron);
  margin-bottom: 0.25rem;
}

.timer-phase-instructions {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Barra de progreso de fases */
.timer-progress-track {
  width: 100%;
  height: 8px;
  background: var(--bg-card-alt);
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  position: relative;
}

.timer-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-saffron), var(--accent-fire));
  border-radius: 9999px;
  transition: width 0.3s linear;
}

/* Botones de acción del temporizador */
.timer-controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
}

.btn-timer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: 44px;
  padding: 0 1.25rem;
  font-size: 0.92rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-timer-primary {
  background: var(--accent-saffron);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.3);
}

.btn-timer-primary:hover {
  background: #b45309;
  transform: translateY(-1px);
}

.btn-timer-secondary {
  background: var(--bg-card-alt);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-timer-secondary:hover {
  background: var(--border-color);
}

.btn-timer-icon-only {
  width: 44px;
  padding: 0;
}

.btn-muted {
  color: #ef4444;
  border-color: #ef4444;
}

/* Botones de compartir */
.share-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.btn-action-full {
  flex: 1 1 200px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-action-full:hover {
  border-color: var(--border-highlight);
  background: var(--bg-card-alt);
}

.btn-whatsapp {
  background: #25d366;
  color: #ffffff;
  border: none;
}

.btn-whatsapp:hover {
  background: #1ebd5b;
}

/* Modal accesible de confirmación */
.modal-paella-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
  backdrop-filter: blur(4px);
  transition: opacity 0.2s ease;
}

.modal-hidden {
  display: none !important;
}

.modal-paella-dialog {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  animation: modal-pop 0.2s ease;
}

@keyframes modal-pop {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-paella-title {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--text-main);
}

.modal-paella-text {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  white-space: pre-line;
}

.modal-btn-row {
  display: flex;
  justify-content: flex-end;
}

.btn-modal-close {
  background: var(--accent-saffron);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.65rem 1.5rem;
  font-weight: 700;
  cursor: pointer;
}

/* Guía didáctica y acordeón SEO al pie */
.seo-guide-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 2rem;
}

.seo-guide-title {
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

.seo-guide-content p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.65;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin: 1.25rem 0;
}

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

.table-custom th,
.table-custom td {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border-color);
}

.table-custom th {
  background: var(--bg-card-alt);
  color: var(--text-main);
  font-weight: 700;
}

.table-custom tr:hover td {
  background: var(--bg-card-alt);
}
