/* ==========================================================
   Moodiz Foodiz — Shared Stylesheet
   Palette: Black #000000 | Orange #F7941E | Yellow #FFC20E | White #FFFFFF
   ========================================================== */

:root {
  --mf-black: #000000;
  --mf-orange: #F7941E;
  --mf-yellow: #FFC20E;
  --mf-white: #FFFFFF;
  --mf-grey-100: #f4f4f4;
  --mf-grey-300: #d9d9d9;
  --mf-grey-500: #8a8a8a;
  --mf-grey-700: #444444;
  --mf-red: #d93b3b;
  --mf-green: #2e9e4f;
  --mf-radius: 14px;
  --mf-pill: 30px;
  --mf-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--mf-grey-100);
  color: #1a1a1a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

img { max-width: 100%; }

a { color: var(--mf-orange); }

/* ---------------- Header (customer + admin) ---------------- */
.mf-header {
  background: var(--mf-black);
  border-bottom: 4px solid var(--mf-orange);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 10px;
}

.mf-header .mf-logo {
  height: 60px;
  width: auto;
  display: block;
}

@media (max-width: 600px) {
  .mf-header .mf-logo { height: 45px; }
}

.mf-order-btn {
  background: linear-gradient(135deg, var(--mf-yellow), var(--mf-orange));
  color: var(--mf-black);
  font-weight: 800;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: var(--mf-pill);
  border: none;
  font-size: 14px;
  white-space: nowrap;
  box-shadow: var(--mf-shadow);
  cursor: pointer;
}

/* ---------------- Layout containers ---------------- */
.mf-container {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

.mf-wide-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

.mf-card {
  background: var(--mf-white);
  border-radius: var(--mf-radius);
  box-shadow: var(--mf-shadow);
  padding: 20px;
  margin-bottom: 18px;
}

/* ---------------- Typography ---------------- */
h1, h2, h3 { color: #111; line-height: 1.25; }
.mf-page-title { font-size: 24px; font-weight: 800; margin: 6px 0 4px; }
.mf-page-subtitle { color: var(--mf-grey-700); margin: 0 0 20px; font-size: 15px; }
.mf-block-heading { font-size: 17px; font-weight: 700; margin: 0 0 12px; color: #111; }

/* ---------------- Form elements ---------------- */
label.mf-label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
  font-size: 15px;
}

input[type="text"], input[type="tel"], select, textarea {
  width: 100%;
  font-size: 16px; /* prevents iOS zoom */
  padding: 12px 14px;
  border: 1px solid var(--mf-grey-300);
  border-radius: 10px;
  background: var(--mf-white);
  min-height: 44px;
  font-family: inherit;
}

textarea { min-height: 100px; resize: vertical; }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--mf-orange);
  box-shadow: 0 0 0 3px rgba(247,148,30,0.15);
}

.mf-error-text {
  color: var(--mf-red);
  font-size: 13px;
  margin-top: 6px;
  display: none;
}
.mf-field.has-error .mf-error-text { display: block; }
.mf-field.has-error input,
.mf-field.has-error select,
.mf-field.has-error textarea { border-color: var(--mf-red); }

.mf-field { margin-bottom: 20px; }

.mf-top-error {
  background: #fdecec;
  border: 1px solid var(--mf-red);
  color: #7a1f1f;
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 18px;
  font-size: 14px;
}

.mf-char-counter {
  text-align: right;
  font-size: 12px;
  color: var(--mf-grey-500);
  margin-top: 4px;
}

/* ---------------- Star ratings ---------------- */
.mf-stars {
  display: flex;
  gap: 6px;
}
.mf-star {
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  color: var(--mf-grey-300);
  background: none;
  border: none;
  padding: 4px;
  min-width: 44px;
  min-height: 44px;
  user-select: none;
}
.mf-star.selected { color: var(--mf-orange); }

/* ---------------- Chips / multi-select ---------------- */
.mf-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.mf-chip {
  border: 2px solid var(--mf-grey-300);
  background: var(--mf-white);
  padding: 10px 16px;
  border-radius: var(--mf-pill);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.mf-chip.selected {
  border-color: var(--mf-orange);
  background: linear-gradient(135deg, #fff6e6, #ffedd0);
  color: #7a4a00;
}

/* ---------------- Emoji buttons ---------------- */
.mf-emoji-group {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.mf-emoji-btn {
  flex: 1 1 18%;
  min-width: 60px;
  background: var(--mf-white);
  border: 2px solid var(--mf-grey-300);
  border-radius: 14px;
  padding: 10px 4px;
  text-align: center;
  cursor: pointer;
  min-height: 44px;
}
.mf-emoji-btn .emoji { font-size: 30px; display: block; }
.mf-emoji-btn .label { font-size: 12px; font-weight: 700; margin-top: 4px; display: block; color: #333; }
.mf-emoji-btn.selected {
  border-color: var(--mf-orange);
  background: linear-gradient(135deg, #fff6e6, #ffedd0);
}

/* ---------------- File upload ---------------- */
.mf-file-input {
  border: 2px dashed var(--mf-grey-300);
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  background: var(--mf-white);
  cursor: pointer;
}
.mf-file-input input[type=file] { display: none; }
.mf-file-preview { margin-top: 12px; max-width: 160px; border-radius: 8px; }

/* ---------------- Buttons ---------------- */
.mf-submit-btn {
  width: 100%;
  background: var(--mf-black);
  color: var(--mf-yellow);
  border: 2px solid var(--mf-orange);
  font-weight: 800;
  font-size: 17px;
  padding: 16px;
  border-radius: var(--mf-pill);
  cursor: pointer;
  min-height: 44px;
}
.mf-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.mf-btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 10px;
  border: none;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
  min-height: 40px;
}
.mf-btn-primary { background: linear-gradient(135deg, var(--mf-yellow), var(--mf-orange)); color: #000; }
.mf-btn-dark { background: var(--mf-black); color: var(--mf-yellow); }
.mf-btn-outline { background: var(--mf-white); border: 2px solid var(--mf-grey-300); color: #333; }
.mf-btn-danger { background: var(--mf-red); color: #fff; }
.mf-btn-sm { padding: 6px 12px; font-size: 12px; min-height: 32px; }

/* ---------------- Thank You page ---------------- */
.mf-thankyou {
  text-align: center;
  padding: 40px 20px;
}
.mf-thankyou .big-emoji { font-size: 90px; line-height: 1; margin: 10px 0; }
.mf-thankyou h1 { font-size: 24px; }
.mf-thankyou .msg { font-size: 16px; color: #333; margin: 10px 0 20px; }
.mf-thankyou .meta { color: var(--mf-grey-500); font-size: 13px; margin-top: 20px; }
.mf-ref-code {
  display: inline-block;
  background: var(--mf-grey-100);
  border-radius: 8px;
  padding: 6px 12px;
  font-family: monospace;
  font-size: 13px;
  margin-top: 6px;
}

/* ---------------- Admin: layout ---------------- */
.mf-admin-body { background: var(--mf-grey-100); min-height: 100vh; }
.mf-admin-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  background: #111;
  padding: 8px 16px;
}
.mf-admin-nav a {
  color: #ddd;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
}
.mf-admin-nav a:hover, .mf-admin-nav a.active {
  background: var(--mf-orange);
  color: #000;
}

.mf-login-wrap {
  max-width: 380px;
  margin: 60px auto;
  padding: 0 16px;
}

/* ---------------- Admin: KPI cards ---------------- */
.mf-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.mf-kpi-card {
  background: var(--mf-white);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--mf-shadow);
  border-top: 4px solid var(--mf-orange);
}
.mf-kpi-card .kpi-value { font-size: 26px; font-weight: 800; color: #111; }
.mf-kpi-card .kpi-label { font-size: 12px; color: var(--mf-grey-700); margin-top: 4px; }

.mf-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.mf-chart-card canvas { max-width: 100%; }

/* ---------------- Admin: tables ---------------- */
.mf-table-wrap {
  overflow-x: auto;
  background: var(--mf-white);
  border-radius: var(--mf-radius);
  box-shadow: var(--mf-shadow);
}
table.mf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 900px;
}
table.mf-table th, table.mf-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--mf-grey-100);
  white-space: nowrap;
}
table.mf-table th { background: #fafafa; font-weight: 700; position: sticky; top: 0; }
table.mf-table tr.unread { background: #fff9ec; font-weight: 600; }
table.mf-table img.thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; cursor: pointer; }

.mf-filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}
.mf-filter-bar input, .mf-filter-bar select {
  min-height: 38px;
  padding: 6px 10px;
  font-size: 13px;
  width: auto;
}

.mf-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}
.mf-badge-unread { background: var(--mf-orange); color: #000; }
.mf-badge-read { background: var(--mf-grey-300); color: #333; }

.mf-pagination { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.mf-pagination a, .mf-pagination span {
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--mf-white);
  border: 1px solid var(--mf-grey-300);
  text-decoration: none;
  color: #333;
  font-size: 13px;
}
.mf-pagination a.active { background: var(--mf-orange); border-color: var(--mf-orange); color: #000; font-weight: 700; }

/* ---------------- Admin: forms / CRUD ---------------- */
.mf-admin-form-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.mf-crud-list { list-style: none; margin: 0; padding: 0; }
.mf-crud-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--mf-grey-100);
  flex-wrap: wrap;
}
.mf-crud-actions { display: flex; gap: 6px; }
.mf-inactive { opacity: 0.5; }

.mf-flash-success {
  background: #e9f9ee;
  border: 1px solid var(--mf-green);
  color: #1c6b34;
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 18px;
  font-size: 14px;
}

.mf-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.mf-detail-item .k { font-size: 12px; color: var(--mf-grey-500); text-transform: uppercase; letter-spacing: .5px; }
.mf-detail-item .v { font-size: 15px; font-weight: 600; margin-top: 2px; }

.mf-photo-full { max-width: 320px; border-radius: 10px; box-shadow: var(--mf-shadow); }

footer.mf-footer {
  text-align: center;
  font-size: 12px;
  color: var(--mf-grey-500);
  padding: 20px;
}

/* Lightbox */
.mf-lightbox-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.mf-lightbox-overlay.open { display: flex; }
.mf-lightbox-overlay img { max-width: 90vw; max-height: 90vh; border-radius: 8px; }
.mf-lightbox-close {
  position: absolute; top: 16px; right: 20px;
  color: #fff; font-size: 30px; cursor: pointer; background: none; border: none;
}
