@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&family=Playfair+Display:wght@600;700&display=swap');

:root {
  --bg: #FBF7F0;
  --surface: #FFFFFF;
  --surface-soft: #F4EDE1;
  --ink: #2A1C16;
  --muted: #766257;
  --terracotta: #C85A32;
  --terracotta-dark: #A1411F;
  --saffron: #E3A024;
  --mint: #2E7D5B;
  --mint-soft: #E5F3EC;
  --border: #E8DEC8;
  --shadow: 0 8px 24px rgba(42, 28, 22, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', 'Cairo', system-ui, sans-serif;
  line-height: 1.5;
  padding-bottom: 84px;
}

[dir="rtl"] body {
  font-family: 'Cairo', 'Plus Jakarta Sans', system-ui, sans-serif;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(251, 247, 240, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  object-fit: cover;
  box-shadow: 0 3px 10px rgba(200, 90, 50, 0.25);
}

.brand-title {
  font-family: 'Playfair Display', 'Cairo', serif;
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.1;
}

.brand-sub {
  font-size: 0.74rem;
  color: var(--muted);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-pill, .room-pill {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.12s ease, background 0.15s ease;
}

.lang-pill:active, .room-pill:active { transform: scale(0.96); }

.lang-pill {
  background: var(--terracotta);
  color: #fff;
  border-color: var(--terracotta);
}

.room-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #B8ABA0;
}
.room-dot.live {
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(46, 125, 91, 0.18);
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
}

.search-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.search-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 11px 14px;
  font-size: 0.95rem;
  color: var(--ink);
  outline: none;
}

.search-input:focus {
  border-color: var(--terracotta);
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 14px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  white-space: nowrap;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.chip.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.recipe-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 580px) {
  .recipe-grid { grid-template-columns: 1fr 1fr; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card:active { transform: scale(0.985); }

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.card-emoji {
  font-size: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--surface-soft);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--terracotta-dark);
}

.badge.india {
  background: #FFF3DA;
  color: #945B00;
}

.badge.morocco {
  background: var(--mint-soft);
  color: var(--mint);
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
}

.card-sub {
  font-size: 0.84rem;
  color: var(--muted);
  margin: 0;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--muted);
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}

/* Cook View */
.hidden { display: none !important; }

.back-btn {
  border: none;
  background: var(--surface-soft);
  color: var(--ink);
  border-radius: 12px;
  padding: 8px 14px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cook-hero {
  background: linear-gradient(135deg, #C85A32, #9F3E1D);
  color: #fff;
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
}

.cook-hero h2 {
  margin: 6px 0 4px;
  font-size: 1.35rem;
}

.cook-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.scaler {
  display: inline-flex;
  background: rgba(255,255,255,0.18);
  border-radius: 10px;
  padding: 3px;
}

.scaler button {
  border: none;
  background: transparent;
  color: #fff;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.scaler button.active {
  background: #fff;
  color: var(--terracotta-dark);
}

.section-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}

.section-box h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.ing-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--surface-soft);
}

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

.ing-left {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  flex: 1;
}

.ing-left input {
  width: 18px;
  height: 18px;
  accent-color: var(--mint);
}

.ing-left.checked span {
  text-decoration: line-through;
  color: var(--muted);
}

.swap-btn {
  border: 1px solid var(--saffron);
  background: #FFF8E6;
  color: #8A5600;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.step-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
  background: var(--bg);
}

.step-card.active-step {
  border-color: var(--terracotta);
  background: #FFF9F5;
  box-shadow: 0 4px 14px rgba(200, 90, 50, 0.12);
}

.step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--terracotta-dark);
}

.timer-btn {
  border: none;
  background: var(--ink);
  color: #fff;
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.timer-btn.running {
  background: var(--mint);
}

.floating-timer {
  position: fixed;
  bottom: 74px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.22);
  z-index: 30;
  font-weight: 700;
}

.floating-timer button {
  border: none;
  background: rgba(255,255,255,0.2);
  color: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
  font-weight: 700;
}

/* Bottom Nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 8px 6px;
  z-index: 25;
}

.nav-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 12px;
}

.nav-btn.active { color: var(--terracotta); }
.nav-btn .ico { font-size: 1.2rem; }

/* Forms & Modals */
.form-field {
  margin-bottom: 12px;
}

.form-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.form-field input, .form-field textarea, .form-field select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.92rem;
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
}

.primary-btn {
  width: 100%;
  border: none;
  background: var(--terracotta);
  color: #fff;
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(42, 28, 22, 0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
  padding: 12px;
}

.modal-sheet {
  width: 100%;
  max-width: 520px;
  background: var(--surface);
  border-radius: 22px;
  padding: 20px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
  max-height: 85vh;
  overflow-y: auto;
}

.stars {
  display: flex;
  gap: 8px;
  font-size: 1.6rem;
  margin: 8px 0;
}

.stars button {
  border: none;
  background: transparent;
  cursor: pointer;
  opacity: 0.35;
  padding: 0;
  font-size: 1.6rem;
}

.stars button.lit { opacity: 1; }

.live-banner {
  background: var(--mint-soft);
  color: var(--mint);
  border: 1px solid rgba(46, 125, 91, 0.25);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
