/* =============================================================
   EASYFOOD - PWA Mobile Styles (index.html)
   ============================================================= */

:root {
  --primary:        #FF6B35;
  --primary-dark:   #E85A20;
  --secondary:      #2EC4B6;
  --bg-dark:        #1A1A2E;
  --bg-card:        #16213E;
  --bg-input:       #0F3460;
  --text-primary:   #FFFFFF;
  --text-secondary: #B0B8C1;
  --text-muted:     #6B7280;
  --success:        #22C55E;
  --warning:        #F59E0B;
  --danger:         #EF4444;
  --info:           #3B82F6;
  --radius:         14px;
  --radius-sm:      8px;
  --shadow:         0 4px 24px rgba(0,0,0,0.4);
}

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

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  overflow: hidden;
}

#app {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* ── Screens ──────────────────────────────────────────────── */
.screen { display: none; flex-direction: column; flex: 1; overflow: hidden; }
.screen.active { display: flex; }

/* ── Header ───────────────────────────────────────────────── */
.header {
  background: var(--bg-card);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.header h1 { font-size: 17px; font-weight: 700; flex: 1; }
.back-btn  { background: none; border: none; color: var(--text-primary); font-size: 22px; cursor: pointer; padding: 0 6px; }

/* ── Scroll Content ───────────────────────────────────────── */
.scroll-content { flex: 1; overflow-y: auto; padding: 14px; -webkit-overflow-scrolling: touch; }
.scroll-content::-webkit-scrollbar { display: none; }

/* ── Logo ─────────────────────────────────────────────────── */
.logo { font-size: 36px; font-weight: 800; color: #fff; }
.logo span { color: var(--primary); }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.card-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; border: none; cursor: pointer;
  font-size: 15px; font-weight: 600; border-radius: var(--radius);
  padding: 14px; margin-bottom: 8px; transition: opacity .15s; gap: 6px;
}
.btn:active     { opacity: 0.8; }
.btn-primary    { background: var(--primary);  color: #fff; }
.btn-secondary  { background: var(--bg-card);  color: var(--text-primary); border: 1px solid rgba(255,255,255,.1); }
.btn-success    { background: var(--success);  color: #fff; }
.btn-danger     { background: var(--danger);   color: #fff; }
.btn-info       { background: var(--info);     color: #fff; }
.btn-outline    { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-sm         { padding: 9px 14px; font-size: 13px; border-radius: var(--radius-sm); margin-bottom: 0; width: auto; }
.btn-xs         { padding: 5px 10px; font-size: 11px; border-radius: 6px; margin-bottom: 0; width: auto; }

/* ── Inputs ───────────────────────────────────────────────── */
.input-group { margin-bottom: 12px; }
.input-group label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; color: var(--text-secondary); }
input, select, textarea {
  width: 100%; background: var(--bg-input);
  border: 1px solid rgba(255,255,255,.08); border-radius: var(--radius-sm);
  color: var(--text-primary); padding: 12px 14px; font-size: 15px;
  outline: none; transition: border-color .15s; font-family: inherit;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
input::placeholder, textarea::placeholder { color: var(--text-muted); }
select option { background: var(--bg-card); }
textarea { resize: vertical; min-height: 80px; }

/* ── Badges / Status ──────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.badge-pending    { background: rgba(245,158,11,.15); color: var(--warning); }
.badge-confirmed  { background: rgba(59,130,246,.15);  color: var(--info); }
.badge-preparing  { background: rgba(255,107,53,.15);  color: var(--primary); }
.badge-ready      { background: rgba(46,196,182,.15);  color: var(--secondary); }
.badge-delivered  { background: rgba(34,197,94,.15);   color: var(--success); }
.badge-cancelled  { background: rgba(239,68,68,.15);   color: var(--danger); }
.badge-success    { background: rgba(34,197,94,.15);   color: var(--success); }
.badge-danger     { background: rgba(239,68,68,.15);   color: var(--danger); }
.badge-muted      { background: rgba(255,255,255,.08); color: var(--text-muted); }

/* ── Alerts ───────────────────────────────────────────────── */
.alert { padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 10px; }
.alert-danger  { background: rgba(239,68,68,.12);   color: #fca5a5; border: 1px solid rgba(239,68,68,.2); }
.alert-success { background: rgba(34,197,94,.12);   color: #86efac; border: 1px solid rgba(34,197,94,.2); }
.alert-info    { background: rgba(59,130,246,.12);  color: #93c5fd; border: 1px solid rgba(59,130,246,.2); }
.alert-warning { background: rgba(245,158,11,.12);  color: #fcd34d; border: 1px solid rgba(245,158,11,.2); }

/* ── Bottom Bar ───────────────────────────────────────────── */
.bottom-bar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: var(--primary); padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; z-index: 50;
}

/* ── Timeline ─────────────────────────────────────────────── */
.tl-item  { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.tl-dot   { width: 28px; height: 28px; border-radius: 50%; background: var(--bg-input); display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }
.tl-dot.done   { background: var(--success); }
.tl-dot.active { background: var(--primary); }
.tl-title { font-size: 14px; font-weight: 600; }

/* ── Modal ────────────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.75);
  align-items: center; justify-content: center;
  z-index: 100; padding: 16px;
}
.modal-overlay.open { display: flex; animation: fadeIn .2s ease; }
.modal-box, .modal {
  background: var(--bg-card); border-radius: var(--radius);
  padding: 20px; width: 100%; max-width: 440px;
  max-height: 90vh; overflow-y: auto;
  position: relative; box-shadow: var(--shadow);
}
.modal-close {
  position: absolute; top: 12px; right: 12px;
  background: none; border: none; color: var(--text-muted);
  font-size: 20px; cursor: pointer; line-height: 1; padding: 4px 8px;
}
.modal-close:hover { color: var(--text-primary); }
.modal-title { font-size: 17px; font-weight: 700; margin-bottom: 14px; padding-right: 28px; }

/* ── Toast ────────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  z-index: 9999; display: flex; flex-direction: column; gap: 6px;
  width: 90%; max-width: 440px;
}
.toast {
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; box-shadow: var(--shadow);
  animation: slideUp .25s ease; text-align: center;
}
.toast-success { background: var(--success); color: #fff; }
.toast-error   { background: var(--danger);  color: #fff; }
.toast-info    { background: var(--info);     color: #fff; }
.toast-warning { background: var(--warning);  color: #000; }

/* ── Helpers ──────────────────────────────────────────────── */
.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }
.text-success   { color: var(--success); }
.text-danger    { color: var(--danger); }
.text-warning   { color: var(--warning); }
.text-center    { text-align: center; }
.fw-bold        { font-weight: 700; }
.hidden         { display: none !important; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.gap-8 { gap: 8px; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-icon  { font-size: 48px; margin-bottom: 12px; }
.spinner     { text-align: center; padding: 24px; color: var(--text-muted); font-size: 13px; }

/* ── QR Scanner ───────────────────────────────────────────── */
#qr-reader { border-radius: 12px; overflow: hidden; }

@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
