/* =============================================================
   MASTER CONVERTER — Géométrie Culinaire
   Premium CSS — Or / Chocolat / Crème
   ============================================================= */

/* ---- Modal Layout ---- */
#masterConverterModal .modal-content {
  max-height: 92vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* ---- Top: Shape Selectors and Inputs ---- */
.mc-configurator {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: start;
  margin-bottom: 1.5rem;
}

.mc-side {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.mc-side-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
}

.mc-from .mc-side-title { color: #8B5E3C; }
.mc-to   .mc-side-title { color: var(--gold-dark); }

/* Shape select with icon preview */
.mc-shape-select {
  width: 100%;
  font-size: 0.9rem;
  padding: 0.6rem 0.8rem;
  border: 1.5px solid var(--surface-border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s;
}

.mc-shape-select:focus {
  border-color: var(--gold);
  outline: none;
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.mc-fields {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mc-field-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.mc-field-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  min-width: 100px;
}

.mc-input-wrapper {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.mc-input {
  text-align: center;
  font-weight: 700;
  font-size: 0.9rem !important;
  padding: 0.4rem 0.5rem !important;
}

.mc-unit {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  min-width: 20px;
}

/* Arrow connector between sides */
.mc-arrow-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 2.5rem;
  gap: 0.3rem;
}

.mc-arrow-icon {
  font-size: 2rem;
  animation: mcArrowPulse 1.8s ease-in-out infinite;
}

@keyframes mcArrowPulse {
  0%, 100% { transform: translateX(0); opacity: 1; }
  50%       { transform: translateX(4px); opacity: 0.7; }
}

/* ---- SVG Visualization ---- */
.mc-svg-section {
  margin-bottom: 1.5rem;
}

.mc-svg-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

#mcSVGContainer {
  width: 100%;
  background: var(--cream-warm);
  border-radius: var(--radius);
  border: 1px solid rgba(197, 165, 90, 0.1);
  overflow: hidden;
  min-height: 140px;
}

.dark-theme #mcSVGContainer {
  background: var(--cream-warm);
}

#mcSVGContainer svg {
  width: 100%;
  height: auto;
  display: block;
}

/* ---- Result KPIs ---- */
.mc-result-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.mc-kpi {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  transition: all 0.3s ease;
}

.mc-kpi:hover {
  box-shadow: var(--shadow-chocolate);
}

.mc-kpi-main {
  border-width: 2px;
  background: linear-gradient(135deg, rgba(197, 165, 90, 0.05) 0%, rgba(60, 31, 14, 0.03) 100%);
  box-shadow: var(--shadow-gold);
}

.mc-kpi-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.mc-kpi-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

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

/* Instruction box */
.mc-instruction-box {
  background: linear-gradient(135deg, rgba(197, 165, 90, 0.06) 0%, rgba(39, 174, 96, 0.04) 100%);
  border: 1px solid rgba(197, 165, 90, 0.18);
  border-radius: var(--radius-sm);
  padding: 0.8rem 1.2rem;
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.5;
}

/* ---- Recipe Selector ---- */
.mc-recipe-zone {
  background: var(--bg-alt);
  border-radius: var(--radius);
  border: 1px solid var(--surface-border);
  padding: 1.2rem;
  margin-bottom: 1.2rem;
}

.mc-recipe-zone label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.mc-recipe-zone select {
  width: 100%;
  font-size: 0.9rem;
}

/* ---- Ingredient Table ---- */
.mc-ing-header,
.mc-ing-row {
  display: grid;
  grid-template-columns: 2.5fr 1fr 1fr 1fr;
  gap: 0;
  align-items: center;
  padding: 0.5rem 0.8rem;
  font-size: 0.82rem;
  border-radius: 6px;
  transition: background 0.2s;
}

.mc-ing-header {
  font-weight: 800;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--surface-border);
  border-radius: 0;
  margin-bottom: 0.3rem;
}

.mc-ing-row:hover {
  background: rgba(197, 165, 90, 0.04);
}

.mc-ing-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.mc-ing-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.mc-ing-from {
  color: var(--text-muted);
  text-align: center;
}

.mc-ing-up {
  color: var(--gold-dark);
  font-weight: 700;
  text-align: center;
  font-size: 0.78rem;
}

.mc-ing-down {
  color: #6366f1;
  font-weight: 700;
  text-align: center;
  font-size: 0.78rem;
}

.mc-ing-to {
  text-align: right;
  font-size: 0.88rem;
}

.mc-ingredients-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
}

.mc-ingredients-empty span {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}

.mc-cost-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding: 0.8rem 1rem;
  background: linear-gradient(135deg, rgba(197, 165, 90, 0.06), rgba(39, 174, 96, 0.04));
  border: 1px solid rgba(197, 165, 90, 0.15);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
}

/* ---- Pro Tools Card (in Outils Métier tab) ---- */
#mcProToolCard {
  cursor: pointer;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .mc-configurator {
    grid-template-columns: 1fr;
  }
  .mc-arrow-connector {
    transform: rotate(90deg);
    padding-top: 0;
  }
  .mc-result-grid {
    grid-template-columns: 1fr 1fr;
  }
  .mc-kpi-main {
    grid-column: 1 / -1;
  }
  .mc-ing-header, .mc-ing-row {
    grid-template-columns: 1fr 0.7fr 0.7fr 0.7fr;
    font-size: 0.75rem;
  }
}
