/* ===============================
   VARIABLES
=============================== */

:root {
  --bg-dark: #0f1211;
  --bg-card: #181f1d;

  /* SmartMeal Brand Colors */
  --primary: #4CAF50;
  /* Green */
  --secondary: #ff9800;
  /* Orange */

  /* Mapped for compatibility */
  --accent: #ff9800;
  /* Use Orange as main accent for buttons to pop against dark */
  --accent-green: #4CAF50;

  --accent-soft: rgba(255, 152, 0, 0.15);
  --text-main: #f5f6fa;
  --text-muted: #b2bec3;
}

/* ===============================
   RESET / BASE
=============================== */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(160deg, #1e272e, #000000);
  color: var(--text-main);
  min-height: 100vh;
}

/* ===============================
   PANTALLAS
=============================== */

.pantalla {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none !important;
}

/* ===============================
   HEADER
=============================== */

.header {
  padding: 20px;
  text-align: center;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header h1 {
  margin: 0;
  font-size: 1.8rem;
}

.contexto {
  margin-top: 6px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.back {
  position: absolute;
  left: 20px;
  top: 22px;
  cursor: pointer;
  color: var(--accent);
  font-size: 1.1rem;
}

/* ===============================
   CONTENIDO
=============================== */

.content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ===============================
   BLOQUES / TARJETAS
=============================== */

.bloque {
  background: var(--bg-card);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* ===============================
   BOTONES MOMENTO
=============================== */

.momento {
  width: 100%;
  padding: 18px;
  margin-bottom: 12px;
  border-radius: 14px;
  border: none;
  font-size: 1.1rem;
  background: linear-gradient(135deg, var(--secondary), #e67e22);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.momento:active {
  transform: scale(0.97);
}

/* ===============================
   LISTA DE PLATOS
=============================== */

#platos {
  list-style: none;
  padding: 0;
  margin: 0;
}

#platos li {
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  margin-bottom: 10px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

#platos li:active {
  transform: scale(0.97);
  background: var(--accent-soft);
}

/* ===============================
   BUSCADOR
=============================== */

#buscador {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: none;
  margin-bottom: 12px;
  background: #0e1412;
  color: var(--text-main);
}

#buscador::placeholder {
  color: var(--text-muted);
}

/* ===============================
   LISTAS INTERNAS
=============================== */

ul,
ol {
  padding-left: 20px;
}

li {
  margin-bottom: 6px;
}

/* ===============================
   TOGGLES
=============================== */

.toggle {
  width: 100%;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 1rem;
  text-align: left;
  padding: 8px 0;
  cursor: pointer;
}

/* ===============================
   VARIANTES
=============================== */

.variante {
  margin-top: 10px;
}

.variante strong {
  display: block;
  margin-bottom: 6px;
}

/* ===============================
   MACROS
=============================== */

#macros p {
  margin: 6px 0;
}

canvas {
  margin-top: 12px;
}

/* ===============================
   OK / VALIDACIÓN
=============================== */

.ok {
  text-align: center;
  font-size: 0.9rem;
  color: var(--accent);
  opacity: 0.85;
}

/* ===============================
   TRANSICIONES SUAVES
=============================== */

.bloque,
#platos li,
.momento {
  transition: all 0.2s ease;
}

.selector-macros select {
  width: 100%;
  padding: 12px;
  background: #0f1f1c;
  color: #e8fdf8;
  border: 1px solid #1de9b6;
  border-radius: 10px;
  margin-top: 6px;
}

.selectores {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.cta {
  margin-top: 16px;
  width: 100%;
  padding: 14px;
  font-size: 16px;
  background: linear-gradient(135deg, var(--accent-green), #2ed573);
  color: #fff;
  font-weight: bold;
}

.momento.activo {
  outline: 4px solid #ffffff;
  background: linear-gradient(135deg, #ffa502, #ff6b6b);
}

/* ===============================
   SWITCH TOGGLE
=============================== */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #555;
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked+.slider {
  background-color: var(--accent);
}

input:checked+.slider:before {
  transform: translateX(26px);
}