/* ============================================================
   Algerian Fast-Food Tycoon 2 — Modern Dark Theme
   ============================================================ */

/* ---------- Design Tokens ---------- */
:root {
  --bg: #060810;
  --bg2: #0c0e16;
  --surface: #12151e;
  --surface2: #181c28;
  --fg: #eef0f6;
  --fg-dim: #a0a6b8;
  --muted: #6b7394;
  --accent: #7b6ef6;
  --accent2: #a78bfa;
  --success: #34d399;
  --danger: #f87171;
  --warning: #fbbf24;
  --border: rgba(255, 255, 255, 0.08);
  --border-hi: rgba(255, 255, 255, 0.2);
  --glow: rgba(123, 110, 246, 0.35);
  --accent-glow: rgba(123, 110, 246, 0.5);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.55);
  font-family: "Inter", "Noto Sans Arabic", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Progress gradient toggle ---------- */
:root {
  --progress-gradient: linear-gradient(135deg, var(--accent), var(--accent2));
}

body[data-progress="white"] {
  --progress-gradient: linear-gradient(135deg, #fff, #e0e0e0);
}

/* ---------- Base Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body,
#app {
  height: 100%;
  margin: 0;
  overflow-x: hidden;
}

/* ---------- Background image ---------- */
html {
  background: #111 url('assets/menu_bg.png') center/cover no-repeat fixed !important;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: transparent !important;
  color: var(--fg);
  font-family: var(--font);
  line-height: 1.6;
  overflow-x: hidden;
}

#app {
  background: transparent !important;
}

/* Dark overlay for readability over the background image */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 0;
  pointer-events: none;
}

/* ============================================================
   FOCUS & ACCESSIBILITY
   ============================================================ */
/* Strong visible focus ring for keyboard/screen-reader users */
*:focus-visible {
  outline: 2px solid var(--accent) !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 4px var(--glow) !important;
  border-radius: var(--radius-sm);
  transition: outline-offset 0.1s ease;
}

/* Hide focus ring for mouse users */
*:focus:not(:focus-visible) {
  outline: none !important;
  box-shadow: none !important;
}

/* Skip-to-content link for screen readers */
.skip-link {
  position: absolute;
  top: -100px;
  left: 8px;
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius);
  z-index: 9999;
  font-weight: 700;
}

.skip-link:focus {
  top: 8px;
}

/* ============================================================
   HEADER
   ============================================================ */
.app-header {
  position: fixed !important;
  bottom: 40px !important;
  right: 40px !important;
  padding: 0;
  border: none;
  background: transparent !important;
  backdrop-filter: none;
  box-shadow: none;
  z-index: 500;
  pointer-events: none;
}

.app-header.hidden {
  display: none !important;
}

h1 {
  margin: 0;
  font-size: 40px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -1px;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

/* ============================================================
   MAIN MENU GRID
   ============================================================ */
.black-screen {
  padding: 24px 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  z-index: 1;
  background: transparent !important;
}

.controls {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10002;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  width: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: auto !important;
}

.controls.minimized {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.nav-combo {
  background: #111 !important;
  color: #fff !important;
  border: 1px solid #1a6b5a !important;
  padding: 10px 18px !important;
  font-size: 1rem !important;
  /* Smaller as requested */
  font-weight: 500 !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
  min-width: 260px !important;
  outline: none !important;
  appearance: none !important;
  transition: all 0.3s ease !important;
  text-align: center;
}

.nav-combo:hover,
.nav-combo:focus {
  border-color: #34d399 !important;
  box-shadow: 0 10px 40px rgba(52, 211, 153, 0.2) !important;
}

.nav-combo option {
  background: #1a1a1a;
  color: #fff;
  padding: 12px;
}

/* Header container styling to fit combo box in tunnel bar */
.header-nav-container {
  flex: 1;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 100% !important;
}

.section-header .nav-combo {
  background: rgba(0, 0, 0, 0.25) !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  padding: 4px 10px !important;
  font-size: 0.82rem !important;
  min-width: 140px !important;
  height: 28px !important;
  /* Fits precisely inside the 44px bar */
  box-shadow: none !important;
  margin: 0 !important;
  border-radius: 3px !important;
}

.section-header .nav-combo:hover {
  background: rgba(0, 0, 0, 0.45) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
}

/* Responsive styles for mobile */
@media (max-width: 600px) {
  .nav-combo {
    min-width: 220px !important;
    font-size: 0.9rem !important;
    padding: 8px 16px !important;
  }
}

/* ---------- Menu Entrance Animation ---------- */
.menu-list .menu-item .big-btn.menu-appear {
  opacity: 0;
  transform: translateY(12px);
}

.menu-list .menu-item .big-btn.menu-animate {
  animation: menu-slide-in 320ms cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

@keyframes menu-slide-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================
   BIG BUTTON (Universal)
   ============================================================ */
.big-btn {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  text-align: left !important;
  width: 100% !important;
  min-height: 48px !important;
  padding: 12px 18px !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  color: #111 !important;
  background: #f8f8f8 !important;
  border: 1px solid #ddd !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  animation: none !important;
  pointer-events: auto !important;
}

/* Hover overlay removed — was causing mouse event interference */

/* Label */
.menu-label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: var(--fg);
  line-height: 1.2;
}

/* Large buttons specifically */
#btn-store .menu-label,
#btn-cook .menu-label,
#btn-orders .menu-label {
  font-size: 20px;
}

/* ---------- Hover ---------- */
.big-btn:hover {
  background: #0078d7 !important;
  color: #fff !important;
  border-color: #0078d7 !important;
}

/* Floating animations removed for pure list */

/* ---------- Active / Press ---------- */
.big-btn:active {
  background: #005a9e !important;
  color: #fff !important;
}

/* ---------- Disabled ---------- */
.big-btn:disabled,
.big-btn[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none;
}

/* Ripple disabled to prevent click interference */
.big-btn .ripple {
  display: none !important;
}

/* RTL support */
[dir="rtl"] .big-btn {
  flex-direction: row-reverse;
  text-align: right;
}

[dir="rtl"] .menu-badge {
  margin-left: 8px;
  margin-right: 0;
}

[dir="ltr"] .menu-badge {
  margin-right: 8px;
}

/* ============================================================
   FOOTER / STATUS BAR
   ============================================================ */
.app-footer {
  position: fixed !important;
  top: 40px !important;
  right: 40px !important;
  padding: 0;
  border: none;
  background: transparent !important;
  backdrop-filter: none;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  z-index: 500;
  pointer-events: none;
  transition: all 0.3s ease;
}

/* When a section panel is open, move status to bottom-center and shrink */
.section-panel~.app-footer,
body:has(.section-panel) .app-footer {
  top: auto !important;
  bottom: 12px !important;
  right: auto !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
}

body:has(.section-panel) .app-footer #status {
  flex-direction: row !important;
  gap: 20px !important;
}

body:has(.section-panel) .app-footer #status span {
  font-size: 13px !important;
  font-weight: 400 !important;
}

#status {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
  gap: 8px !important;
}

#status span {
  font-size: 26px !important;
  font-weight: 300 !important;
  color: #fff !important;
  text-shadow: 0 4px 15px rgba(0, 0, 0, 0.5) !important;
  background: transparent !important;
  padding: 0 !important;
}

/* ============================================================
   SECTION PANELS (Store, Cook, Customers, etc.)
   ============================================================ */
.section-panel {
  background: #2c2520 !important;
  /* Dark chocolate brown */
  color: #e8e0d4 !important;
  min-height: 92vh;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-radius: 0 !important;
  padding: 0;
  width: calc(100% - 40px);
  max-width: 1000px;
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  margin: 0 !important;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.8) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  forced-color-adjust: none !important;
  font-family: 'Segoe UI', sans-serif !important;
  z-index: 10001 !important;
  animation: panel-metro-in 0.4s cubic-bezier(0.1, 0.9, 0.2, 1) forwards;
}

@keyframes panel-metro-in {
  from {
    opacity: 0;
    top: 52%;
    left: 50%;
    transform: translate(-50%, -50%);
  }

  to {
    opacity: 1;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
}

.section-body {
  overflow-y: auto;
  padding: 30px !important;
  background: #362f29 !important;
  /* Warm dark brown body */
  color: #e0d8cc !important;
  flex-grow: 1;
}

.section-panel.has-store-cashier .section-body {
  padding-bottom: 96px;
}

.store-cashier {
  left: 8px;
  right: 8px;
  bottom: 8px;
}

/* Section Header */
.section-header {
  background: linear-gradient(135deg, #1a6b5a, #0d8070) !important;
  padding: 0 10px !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  border-radius: 0;
  min-height: 48px !important;
  max-height: 48px !important;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.header-nav-container {
  flex: 1;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 100% !important;
}

.section-header .nav-combo {
  background: rgba(0, 0, 0, 0.3) !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  padding: 0 12px !important;
  font-size: 0.85rem !important;
  min-width: 160px !important;
  height: 32px !important;
  box-shadow: none !important;
  margin: 0 !important;
  border-radius: 4px !important;
}

/* Section Title removed as per user request */
.section-title {
  display: none !important;
}

/* Back button — right side of header bar */
.section-header .back-btn {
  position: relative !important;
  padding: 0 18px !important;
  height: 32px !important;
  line-height: 32px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  border-radius: 4px !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  background: rgba(0, 0, 0, 0.1) !important;
  color: #fff !important;
  cursor: pointer;
  flex: 0 0 auto !important;
  transition: all 0.2s ease;
}

.section-header .back-btn:hover {
  background: rgba(0, 0, 0, 0.4) !important;
  color: #fff !important;

}

/* ============================================================
   GRIDS (Store, Cook, General)
   ============================================================ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

/* ============================================================
   STORE CARD
   ============================================================ */
.store-card {
  padding: 16px !important;
  background: #3d352e !important;
  /* Dark warm card */
  color: #e0d8cc !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-bottom: 4px solid #1a6b5a !important;
  /* Emerald accent */
  border-radius: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  transition: transform 0.1s ease !important;
}

.store-card:hover {
  border-color: #0d8070 !important;
}

.store-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--glow);
}

.store-card .card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.select-btn {
  padding: 8px 14px;
  font-size: 14px;
  flex: 0 0 auto;
  min-width: 84px;
  min-height: auto;
}

/* Qty Controls */
.qty-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.qty-controls button {
  padding: 6px 10px;
  min-width: 36px;
  min-height: auto;
  font-size: 14px;
}

/* Cashier Bar */
.cashier-bar {
  position: sticky;
  bottom: 8px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  box-shadow: var(--shadow);
}

/* Swipe Hint */
.swipe-hint {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin-top: 4px;
}

/* ============================================================
   PANTRY & PANEL LISTS
   ============================================================ */
.pantry-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
}

.pantry-row {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 12px 18px !important;
  background: #3d352e !important;
  /* Dark warm row */
  color: #e0d8cc !important;
  border-left: 6px solid #1a6b5a !important;
  /* Emerald accent */
  margin-bottom: 4px !important;
  border-radius: 0 !important;
  font-weight: 500 !important;
}

.panel-actions {
  display: flex !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
  margin-top: 16px !important;
}

/* ============================================================
   CUSTOMER ROWS
   ============================================================ */
.customer-row {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 10px 16px !important;
  background: #3d352e !important;
  color: #e0d8cc !important;
  border-left: 5px solid #8b6914 !important;
  /* Gold accent for customers */
  margin-bottom: 4px !important;
  border-radius: 0 !important;
}

.cust-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--surface2), var(--bg));
  color: var(--accent2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  border: 1px solid var(--border-hi);
  flex-shrink: 0;
}

.customer-row .big-btn {
  padding: 8px 14px;
  font-size: 14px;
  min-width: 72px;
  min-height: auto;
}

.customer-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ============================================================
   STORE CASHIER (Fixed Bottom)
   ============================================================ */
.store-cashier {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 1200;
  background: var(--surface);
  border: 1px solid var(--border-hi);
  padding: 12px 16px;
  border-radius: var(--radius);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* Disable qty selection override */
body[data-store-qty="off"] .qty-controls {
  display: none !important;
}

/* ============================================================
   SECTION PANEL — Inner Grid Tuning
   ============================================================ */
.section-panel .grid,
.section-panel .store-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  align-items: start;
}

.section-panel .big-btn {
  white-space: normal;
  word-break: break-word;
  line-height: 1.35;
  align-items: flex-start;
  background: #3d352e !important;
  color: #e0d8cc !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.section-panel .big-btn:hover {
  background: #1a6b5a !important;
  color: #fff !important;
  border-color: #1a6b5a !important;
}

.section-panel .big-btn:active {
  background: #145a4c !important;
  color: #fff !important;
}

.section-panel .big-btn strong {
  display: block;
  font-size: 1.05em;
  color: #f0ebe3 !important;
}

.section-panel .big-btn .muted {
  display: block;
  margin-top: 6px;
  opacity: 0.6;
  color: #bfb8a8 !important;
}

/* Force dark theme on ALL text inside section panels */
.section-panel,
.section-panel div,
.section-panel span,
.section-panel p,
.section-panel label,
.section-panel h2,
.section-panel h3,
.section-panel h4 {
  color: #e0d8cc !important;
}

/* Scrollbar styling for dark panels */
.section-body::-webkit-scrollbar {
  width: 8px;
}

.section-body::-webkit-scrollbar-track {
  background: #2c2520;
}

.section-body::-webkit-scrollbar-thumb {
  background: #5a4f46;
  border-radius: 0;
}

.section-body::-webkit-scrollbar-thumb:hover {
  background: #6b5f54;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
#toast-container {
  position: fixed;
  top: 16px;
  left: 12px;
  right: 12px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  pointer-events: none;
}

.toast {
  background: rgba(18, 21, 30, 0.96);
  color: var(--fg);
  padding: 12px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border-hi);
  box-shadow: var(--shadow-lg);
  max-width: 680px;
  width: calc(100% - 40px);
  opacity: 1;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: auto;
  font-weight: 600;
  font-size: 14px;
  text-align: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ============================================================
   TABLES GRID (Customers)
   ============================================================ */
.tables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

/* ============================================================
   RESPONSIVE — Mobile
   ============================================================ */
@media (max-width: 600px) {
  .menu-list {
    grid-template-columns: 1fr 1fr;
    padding: 0 4px;
    gap: 10px;
  }

  .big-btn {
    padding: 14px 12px;
    font-size: 14px;
    min-height: 62px;
  }

  .menu-label {
    font-size: 14px;
  }

  .app-header {
    padding: 14px 16px;
  }

  h1 {
    font-size: 18px;
  }

  .section-panel {
    width: calc(100% - 12px);
    margin: 6px auto;
    padding: 8px;
  }

  .store-grid,
  .grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
  }

  .toast {
    width: calc(100% - 24px);
    padding: 10px 14px;
    font-size: 13px;
  }
}

@media (max-width: 380px) {
  .menu-list {
    grid-template-columns: 1fr;
  }

  .big-btn {
    min-height: 56px;
  }
}

/* ============================================================
   WIDE SCREENS — 3+ column layouts
   ============================================================ */
@media (min-width: 1200px) {
  .menu-list {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    padding: 0 12px;
  }

  .big-btn {
    min-height: 80px;
    font-size: 16px;
  }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}