/* Dabba Cloud Kitchen Styles */

/* ── Variables & Reset ── */
:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f4;
  --bg-tertiary: #f0efed;
  --text-primary: #1a1a18;
  --text-secondary: #6b6b68;
  --text-tertiary: #a8a8a5;
  --border-light: rgba(0,0,0,0.08);
  --border-medium: rgba(0,0,0,0.14);
  --accent: #1D9E75;
  --accent-dark: #0F6E56;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #1c1c1a;
    --bg-secondary: #252522;
    --bg-tertiary: #111110;
    --text-primary: #f0ede8;
    --text-secondary: #9e9b96;
    --text-tertiary: #5c5c58;
    --border-light: rgba(255,255,255,0.08);
    --border-medium: rgba(255,255,255,0.14);
  }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(120deg, #f0efed 0%, #e1f5ee 100%);
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

.app {
  width: 100%;
  max-width: 1200px;
  margin: 32px auto;
  background: var(--bg-tertiary);
  border-radius: 18px;
  box-shadow: 0 6px 32px 0 rgba(30,60,60,0.08);
  min-height: 80vh;
  padding-bottom: 32px;
  transition: max-width 0.3s;
}

@media (max-width: 900px) {
  .app {
    max-width: 98vw;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
  }
}

/* ── Header ── */
.header {
  background: var(--bg-primary);
  border-bottom: 1.5px solid var(--border-light);
  padding: 28px 36px 18px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  border-radius: 18px 18px 0 0;
}
.logo { font-size: 2.2rem; font-weight: 700; color: var(--text-primary); letter-spacing: -1px; font-family: 'Segoe UI',sans-serif; }
.logo span { color: var(--accent); }
.header-right { display: flex; align-items: center; gap: 8px; }
.ai-toggle {
  background: none;
  border: 0.5px solid var(--border-medium);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  color: var(--accent);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
}
.ai-dot { width: 7px; height: 7px; background: var(--accent); border-radius: 50%; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }
.cart-btn { background: none; border: none; cursor: pointer; padding: 6px; position: relative; color: var(--text-primary); }
.cart-badge {
  position: absolute; top: 0; right: 0;
  background: var(--accent); color: white;
  font-size: 9px; width: 15px; height: 15px;
  border-radius: 50%; display: none;
  align-items: center; justify-content: center; font-weight: 600;
}

/* ── Hero ── */
.hero {
  background: var(--bg-primary);
  padding: 18px 20px 20px;
  border-bottom: 0.5px solid var(--border-light);
}
.greeting { font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; }
.tagline { font-size: 22px; font-weight: 600; color: var(--text-primary); line-height: 1.25; margin-bottom: 16px; }
.tagline em { color: var(--accent); font-style: normal; }
.search-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-secondary);
  border: 0.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  transition: border-color .15s;
  margin-top: 22px;
}
.search-bar:focus-within { border-color: var(--accent); }
.search-bar input { border: none; background: none; font-size: 14px; color: var(--text-primary); flex: 1; outline: none; }
.search-bar input::placeholder { color: var(--text-tertiary); }

/* ── Sections ── */
.section { padding: 28px 36px; }
.section.pb0 { padding-bottom: 0; }
.sec-label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 12px; }

/* ── Categories ── */
.cats { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.cats::-webkit-scrollbar { display: none; }
.cat {
  padding: 8px 14px; border-radius: 20px;
  border: 0.5px solid var(--border-medium);
  font-size: 13px; white-space: nowrap; cursor: pointer;
  background: var(--bg-primary); color: var(--text-secondary);
  transition: all .15s; user-select: none;
}
.cat:hover { border-color: var(--accent); color: var(--accent); }
.cat.active { background: var(--accent); border-color: var(--accent); color: white; }

/* ── Meal Cards ── */
.meals-grid { display: flex; flex-direction: column; gap: 10px; }
.meal-card {
  background: var(--bg-primary);
  border: 0.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex; align-items: center; gap: 14px;
  transition: border-color .15s;
}
.meal-card:hover { border-color: var(--border-medium); }
.meal-emoji {
  font-size: 32px; width: 56px; height: 56px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.meal-info { flex: 1; min-width: 0; }
.meal-name { font-size: 14px; font-weight: 500; color: var(--text-primary); margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meal-desc { font-size: 12px; color: var(--text-secondary); margin-bottom: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meal-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.meal-price { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.meal-time { font-size: 11px; color: var(--text-tertiary); }
.add-btn {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1.5px solid var(--accent);
  background: none; color: var(--accent);
  font-size: 18px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; transition: all .15s;
}
.add-btn:hover, .add-btn.added { background: var(--accent); color: white; }
.add-btn.added { font-size: 13px; }

/* ── AI Chat ── */
.chat-container {
  background: var(--bg-primary);
  border: 0.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 14px;
}
.chat-header {
  padding: 12px 16px;
  border-bottom: 0.5px solid var(--border-light);
  display: flex; align-items: center; gap: 10px;
}
.chat-avatar {
  width: 32px; height: 32px; background: #E1F5EE;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.chat-hname { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.chat-hstatus { font-size: 11px; color: var(--accent); }
.chat-msgs {
  height: 260px; overflow-y: auto; padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.chat-msgs::-webkit-scrollbar { width: 3px; }
.chat-msgs::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }
.msg { max-width: 82%; display: flex; flex-direction: column; gap: 3px; }
.msg.bot { align-self: flex-start; }
.msg.user { align-self: flex-end; }
.msg-bubble { padding: 10px 13px; border-radius: var(--radius-md); font-size: 13px; line-height: 1.5; }
.msg.bot .msg-bubble {
  background: var(--bg-secondary); color: var(--text-primary);
  border-radius: 4px var(--radius-md) var(--radius-md) var(--radius-md);
}
.msg.user .msg-bubble {
  background: var(--accent); color: white;
  border-radius: var(--radius-md) 4px var(--radius-md) var(--radius);
}
.msg-time { font-size: 10px; color: var(--text-tertiary); }
.msg.user .msg-time { text-align: right; }
.typing {
  display: flex; gap: 4px; padding: 10px 13px;
  background: var(--bg-secondary);
  border-radius: 4px var(--radius-md) var(--radius-md) var(--radius-md);
  align-self: flex-start; width: fit-content;
}
.typing span {
  width: 6px; height: 6px;
  background: var(--text-tertiary); border-radius: 50%;
  animation: bounce .8s infinite;
}
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-5px)} }
.chat-chips {
  display: flex; gap: 6px; padding: 0 12px 10px; flex-wrap: wrap;
}
.chip {
  padding: 5px 11px; border-radius: 16px;
  border: 0.5px solid var(--border-medium);
  font-size: 12px; cursor: pointer;
  color: var(--text-secondary); background: var(--bg-primary);
  transition: all .12s; white-space: nowrap;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chat-input-row {
  padding: 10px 12px; border-top: 0.5px solid var(--border-light);
  display: flex; gap: 8px; align-items: center;
}
.chat-input-row input {
  flex: 1; border: 0.5px solid var(--border-light);
  background: var(--bg-secondary); border-radius: 20px;
  padding: 9px 14px; font-size: 13px; color: var(--text-primary);
  outline: none; transition: border-color .15s;
}
.chat-input-row input:focus { border-color: var(--accent); }
.chat-input-row input::placeholder { color: var(--text-tertiary); }
.send-btn {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: opacity .15s;
}
.send-btn:hover { opacity: .85; }
.send-btn:disabled { opacity: .4; cursor: default; }
/* ── Cart Summary ── */
.cart-summary {
  background: var(--accent-dark); color: white;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: none; justify-content: space-between; align-items: center;
  cursor: pointer; margin-bottom: 6px;
  transition: opacity .15s;
}
.cart-summary.visible { display: flex; }
.cart-summary:hover { opacity: .9; }
.bottom-pad { height: 30px; }
.wave-header {
  position: relative;
  width: 100%;
  min-height: 160px;
  margin-bottom: 0;
  z-index: 1;
}
.wave-bg {
  position: absolute;
  left: 0; top: 0; width: 100%; height: 220px;
  z-index: 0;
  pointer-events: none;
  display: block;
}
.header {
  position: relative;
  z-index: 2;
  background: transparent;
  box-shadow: none;
  border: none;
  padding-top: 38px;
  padding-bottom: 18px;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-size: 2.7rem;
  font-weight: 800;
  color: #1D9E75;
  text-shadow: 0 2px 16px rgba(29,158,117,0.10);
  letter-spacing: -1.5px;
}
@media (max-width: 900px) {
  .wave-header { min-height: 100px; }
  .logo { font-size: 2rem; }
}
.details-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 18px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 500;
  margin-left: 10px;
  cursor: pointer;
  transition: background .15s;
}
.details-btn:hover {
  background: var(--accent-dark);
}
