/* ============================================================
   QR Menu Maker — Modern UI  (Cairo font, vibrant palette)
   ============================================================ */

/* ---------- Google Font ---------- */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&display=swap');

/* ---------- CSS Variables ---------- */
:root {
  --primary:       #6c63ff;
  --primary-dark:  #574fd6;
  --primary-light: #ede9ff;
  --accent:        #ff6584;
  --accent-dark:   #e0455f;
  --success:       #00c896;
  --success-dark:  #00a87e;
  --warning:       #ffb703;
  --warning-dark:  #e09e00;
  --info:          #0dcaf0;
  --danger:        #ef233c;
  --dark:          #1a1a2e;
  --dark2:         #16213e;
  --sidebar-bg:    #1a1a2e;
  --body-bg:       #f0f2ff;
  --card-bg:       #ffffff;
  --text:          #2d2d44;
  --text-muted:    #7b7b9a;
  --border:        #e8e8f0;
  --radius:        16px;
  --radius-sm:     10px;
  --radius-lg:     24px;
  --shadow:        0 4px 24px rgba(108,99,255,.10);
  --shadow-hover:  0 8px 32px rgba(108,99,255,.18);
  --transition:    all .25s cubic-bezier(.4,0,.2,1);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Cairo', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  background: var(--body-bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 { font-family: 'Cairo', sans-serif; font-weight: 700; color: var(--dark); }
h1 { font-size: 2.2rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.3rem; }
h5 { font-size: 1.15rem; }
h6 { font-size: 1rem; }
p  { font-size: 1rem; }
small, .small { font-size: .875rem; }
.text-muted { color: var(--text-muted) !important; }

/* ---------- Navbar ---------- */
.navbar {
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark2) 100%) !important;
  padding: .9rem 0;
  box-shadow: 0 2px 20px rgba(0,0,0,.25);
  border-bottom: 3px solid var(--primary);
}
.navbar-brand {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -.5px;
  color: #fff !important;
}
.navbar-brand span { color: var(--primary); }
.navbar .nav-link {
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255,255,255,.82) !important;
  padding: .45rem .9rem !important;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.navbar .nav-link:hover,
.navbar .nav-link.active {
  color: #fff !important;
  background: rgba(108,99,255,.35);
}
.navbar .nav-link i { font-size: 1.05rem; }
.navbar .dropdown-menu {
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  font-size: 1rem;
  min-width: 180px;
}
.navbar .dropdown-item { font-weight: 600; padding: .6rem 1.2rem; }
.navbar .dropdown-item:hover { background: var(--primary-light); color: var(--primary); }

/* ---------- Cards ---------- */
.card {
  background: var(--card-bg);
  border: none !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.card-header {
  border-radius: var(--radius) var(--radius) 0 0 !important;
  border-bottom: none;
  padding: 1.1rem 1.4rem;
  font-size: 1.05rem;
  font-weight: 700;
}

/* ---------- Stat Cards ---------- */
.stat-card {
  border-radius: var(--radius-lg) !important;
  overflow: hidden;
  position: relative;
}
.stat-card .stat-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem;
  flex-shrink: 0;
}
.stat-card .stat-value { font-size: 2rem; font-weight: 900; line-height: 1; }
.stat-card .stat-label { font-size: .9rem; font-weight: 600; opacity: .8; }
.stat-card::after {
  content: '';
  position: absolute;
  bottom: -20px; left: -20px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
}

/* Gradient variants */
.stat-purple  { background: linear-gradient(135deg,#6c63ff,#a78bfa); color:#fff; }
.stat-green   { background: linear-gradient(135deg,#00c896,#34d399); color:#fff; }
.stat-orange  { background: linear-gradient(135deg,#ffb703,#fb923c); color:#fff; }
.stat-pink    { background: linear-gradient(135deg,#ff6584,#f472b6); color:#fff; }
.stat-blue    { background: linear-gradient(135deg,#0dcaf0,#38bdf8); color:#fff; }
.stat-red     { background: linear-gradient(135deg,#ef233c,#f87171); color:#fff; }

/* ---------- Buttons ---------- */
.btn {
  font-family: 'Cairo', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  border-radius: var(--radius-sm);
  padding: .55rem 1.4rem;
  transition: var(--transition);
  border: none;
}
.btn-lg { font-size: 1.1rem; padding: .75rem 2rem; border-radius: var(--radius); }
.btn-sm { font-size: .9rem; padding: .35rem .9rem; }

.btn-primary   { background: var(--primary);  color:#fff; }
.btn-primary:hover { background: var(--primary-dark); transform:translateY(-2px); box-shadow:0 6px 20px rgba(108,99,255,.4); color:#fff; }

.btn-success   { background: var(--success);  color:#fff; }
.btn-success:hover { background: var(--success-dark); transform:translateY(-2px); box-shadow:0 6px 20px rgba(0,200,150,.4); color:#fff; }

.btn-warning   { background: var(--warning);  color:#fff; }
.btn-warning:hover { background: var(--warning-dark); transform:translateY(-2px); color:#fff; }

.btn-danger    { background: var(--danger);   color:#fff; }
.btn-danger:hover  { background: #c81a2e; transform:translateY(-2px); color:#fff; }

.btn-info      { background: var(--info);     color:#fff; }
.btn-info:hover    { background: #0aa8cc; transform:translateY(-2px); color:#fff; }

.btn-outline-primary { border: 2px solid var(--primary) !important; color: var(--primary); background: transparent; }
.btn-outline-primary:hover { background: var(--primary); color:#fff; }

.btn-outline-success { border: 2px solid var(--success) !important; color: var(--success); background: transparent; }
.btn-outline-success:hover { background: var(--success); color:#fff; }

.btn-outline-warning { border: 2px solid var(--warning) !important; color: var(--warning-dark); background: transparent; }
.btn-outline-warning:hover { background: var(--warning); color:#fff; }

.btn-outline-danger  { border: 2px solid var(--danger) !important; color: var(--danger); background: transparent; }
.btn-outline-danger:hover  { background: var(--danger); color:#fff; }

.btn-outline-secondary { border: 2px solid #aaa !important; color: #666; background: transparent; }
.btn-outline-secondary:hover { background: #666; color:#fff; }

/* ---------- Forms ---------- */
.form-control, .form-select {
  font-family: 'Cairo', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  padding: .7rem 1rem;
  border: 2px solid var(--border);
  background: #fafafe;
  color: var(--text);
  transition: var(--transition);
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(108,99,255,.12);
  background: #fff;
}
.form-label { font-weight: 700; font-size: 1rem; color: var(--text); margin-bottom: .4rem; }
.form-text  { font-size: .875rem; }

/* ---------- Tables ---------- */
.table {
  font-size: 1rem;
  font-family: 'Cairo', sans-serif;
  border-radius: var(--radius);
  overflow: hidden;
}
.table thead th {
  font-weight: 800;
  font-size: .95rem;
  background: #f4f4fb;
  color: var(--text);
  border: none;
  padding: .9rem 1rem;
  white-space: nowrap;
}
.table tbody td {
  padding: .85rem 1rem;
  vertical-align: middle;
  border-color: var(--border);
  font-size: 1rem;
}
.table-hover tbody tr:hover { background: var(--primary-light); }

/* ---------- Badges ---------- */
.badge {
  font-family: 'Cairo', sans-serif;
  font-size: .85rem;
  font-weight: 700;
  padding: .45em 1em;
  border-radius: 50px;
}

/* ---------- Alerts ---------- */
.alert {
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  padding: 1rem 1.3rem;
}
.alert-warning { background: #fff8e1; color: #7a5c00; }
.alert-info    { background: #e3f6ff; color: #0a5a7a; }
.alert-success { background: #e6faf5; color: #006b50; }
.alert-danger  { background: #fde8ec; color: #8b0020; }

/* ---------- Toast / Flash ---------- */
.toast-container { z-index: 9999; }
.toast {
  border-radius: var(--radius) !important;
  font-size: 1rem;
  font-weight: 600;
  min-width: 280px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
}

/* ---------- Nav Pills ---------- */
.nav-pills .nav-link {
  font-family: 'Cairo', sans-serif;
  font-weight: 700;
  font-size: .95rem;
  border-radius: 50px;
  padding: .45rem 1.2rem;
  color: var(--text-muted);
  transition: var(--transition);
}
.nav-pills .nav-link:hover { background: var(--primary-light); color: var(--primary); }
.nav-pills .nav-link.active { color: #fff !important; }

/* ---------- Modals ---------- */
.modal-content {
  border: none !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.modal-header { border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important; padding: 1.2rem 1.5rem; }
.modal-footer { border-top: 1px solid var(--border); padding: 1rem 1.5rem; }
.modal-body   { padding: 1.5rem; }
.btn-close-white { filter: invert(1); }

/* ---------- Page Header ---------- */
.page-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 1.5rem 2rem;
  margin-bottom: 1.8rem;
  box-shadow: 0 6px 24px rgba(108,99,255,.3);
}
.page-header h2 { color: #fff; margin: 0; font-size: 1.6rem; }
.page-header .text-muted { color: rgba(255,255,255,.75) !important; }

/* ---------- Quick Action Buttons ---------- */
.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: 1.4rem 1rem;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  transition: var(--transition);
  border: 2.5px solid transparent;
}
.quick-action i { font-size: 1.8rem; }
.quick-action:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }

/* ---------- Auto-refresh countdown ---------- */
.refresh-bar {
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
  animation: shrink 15s linear forwards;
}
@keyframes shrink { from { width: 100%; } to { width: 0%; } }
.refresh-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 50px;
  padding: .3rem .9rem;
  font-size: .9rem;
  font-weight: 700;
}
.refresh-badge .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%,100% { opacity:1; transform:scale(1); }
  50%      { opacity:.5; transform:scale(1.4); }
}

/* ---------- Public Menu Layout ---------- */
.restaurant-header {
  background: linear-gradient(135deg, var(--dark) 0%, #2d2b6e 100%);
  color: #fff;
  padding: 2.2rem 0 2.5rem;
  border-radius: 0 0 40px 40px;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
}
.restaurant-logo {
  width: 110px; height: 110px;
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,.9);
  object-fit: cover;
  background: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
}
.menu-item-card {
  border: 2px solid var(--border) !important;
  border-radius: var(--radius) !important;
  transition: var(--transition);
  background: #fff;
  overflow: hidden;
}
.menu-item-card:hover {
  border-color: var(--primary) !important;
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(108,99,255,.18);
}
.price-badge {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  padding: .3rem 1rem;
  border-radius: 50px;
  font-weight: 800;
  font-size: .95rem;
}
.add-to-cart-btn {
  background: linear-gradient(135deg, var(--dark), #2d2b6e);
  color: #fff;
  border: none;
  padding: .45rem 1.2rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: .9rem;
  transition: var(--transition);
}
.add-to-cart-btn:hover {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  transform: scale(1.05);
  color: #fff;
}
.cart-float {
  position: fixed;
  bottom: 24px; left: 24px;
  z-index: 1050;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  padding: 1rem 1.8rem;
  border-radius: 50px;
  box-shadow: 0 8px 32px rgba(108,99,255,.45);
  display: none;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.05rem;
  transition: var(--transition);
}
.cart-float.show { display: flex; align-items: center; gap: 12px; }
.cart-float:hover { transform: translateY(-3px) scale(1.03); color: #fff; }
.category-tab {
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 50px;
  padding: .4rem 1.2rem;
  font-weight: 700;
  font-size: .95rem;
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
}
.category-tab:hover, .category-tab.active {
  background: var(--primary);
  color: #fff;
}

/* ---------- Auth Pages ---------- */
.auth-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--dark) 0%, #2d2b6e 50%, var(--primary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.auth-card {
  background: #fff;
  border-radius: var(--radius-lg) !important;
  box-shadow: 0 24px 64px rgba(0,0,0,.25) !important;
  overflow: hidden;
  width: 100%;
  max-width: 440px;
}
.auth-card .auth-header {
  padding: 2.2rem 2rem 1.5rem;
  text-align: center;
}
.auth-card .auth-header .auth-icon {
  width: 80px; height: 80px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  margin-bottom: 1rem;
}
.auth-card .auth-body { padding: 1.5rem 2rem 2rem; }
.auth-card .form-control {
  background: #f8f8ff;
  border: 2px solid #e8e8f5;
  font-size: 1.05rem;
  padding: .75rem 1.1rem;
}
.auth-card .form-control:focus { background: #fff; }
.auth-card .btn { font-size: 1.1rem; padding: .75rem; }

/* ---------- Home / Landing ---------- */
.hero-section {
  background: linear-gradient(135deg, var(--dark) 0%, #2d2b6e 60%, var(--primary) 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 4rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 250px; height: 250px;
  border-radius: 50%;
  background: rgba(255,255,255,.05);
}
.hero-section::after {
  content: '';
  position: absolute;
  bottom: -80px; left: -40px;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: rgba(255,255,255,.04);
}
.hero-section h1 { color: #fff; font-size: 2.8rem; font-weight: 900; }
.hero-section p  { font-size: 1.2rem; opacity: .85; }
.feature-card {
  border-radius: var(--radius-lg) !important;
  padding: 2rem 1.5rem;
  text-align: center;
  transition: var(--transition);
}
.feature-card .feature-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 1rem;
}

/* ---------- Order Success ---------- */
.success-circle {
  width: 120px; height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--success), #34d399);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  color: #fff;
  box-shadow: 0 8px 32px rgba(0,200,150,.35);
  animation: popIn .5s cubic-bezier(.175,.885,.32,1.275);
}
@keyframes popIn {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* ---------- Sidebar (owner/admin) ---------- */
.sidebar {
  width: 260px;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--dark) 0%, var(--dark2) 100%);
  position: fixed;
  top: 0; right: 0;
  z-index: 1040;
  padding-top: 70px;
  transition: var(--transition);
  box-shadow: -4px 0 24px rgba(0,0,0,.2);
}
.sidebar .sidebar-brand {
  position: absolute;
  top: 0; right: 0; left: 0;
  height: 70px;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  background: rgba(108,99,255,.2);
  border-bottom: 1px solid rgba(255,255,255,.08);
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
}
.sidebar .nav-link {
  color: rgba(255,255,255,.72);
  font-size: 1rem;
  font-weight: 600;
  padding: .75rem 1.5rem;
  border-radius: 0;
  display: flex;
  align-items: center;
  gap: .75rem;
  transition: var(--transition);
  border-right: 3px solid transparent;
}
.sidebar .nav-link i { font-size: 1.2rem; width: 24px; text-align: center; }
.sidebar .nav-link:hover { color: #fff; background: rgba(108,99,255,.2); border-right-color: var(--primary); }
.sidebar .nav-link.active { color: #fff; background: rgba(108,99,255,.3); border-right-color: var(--primary); }
.main-content { margin-right: 260px; padding: 1.5rem; min-height: 100vh; }

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
  .sidebar { transform: translateX(100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-right: 0; }
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.5rem; }
  .hero-section h1 { font-size: 2rem; }
}
@media (max-width: 576px) {
  .stat-card .stat-value { font-size: 1.6rem; }
  .cart-float { bottom: 16px; left: 16px; padding: .8rem 1.2rem; font-size: .95rem; }
}

/* ---------- Misc Utilities ---------- */
.rounded-xl  { border-radius: var(--radius) !important; }
.rounded-2xl { border-radius: var(--radius-lg) !important; }
.shadow-colored { box-shadow: 0 8px 32px rgba(108,99,255,.2) !important; }
.bg-gradient-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }
.bg-gradient-success { background: linear-gradient(135deg, var(--success), var(--success-dark)); }
.bg-gradient-warning { background: linear-gradient(135deg, var(--warning), var(--warning-dark)); }
.bg-gradient-danger  { background: linear-gradient(135deg, var(--danger), #c81a2e); }
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning-dark) !important; }
.text-danger  { color: var(--danger) !important; }
.border-primary { border-color: var(--primary) !important; }

/* ---------- has-sidebar body adjustments ---------- */
body.has-sidebar { background: var(--body-bg); }
body.has-sidebar .navbar {
  margin-right: 260px;
  border-bottom: none;
  border-right: 1px solid rgba(255,255,255,.06);
}
@media (max-width: 991px) {
  body.has-sidebar .navbar { margin-right: 0; }
}

/* ---------- Sidebar overlay on mobile ---------- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1039;
}
.sidebar-overlay.show { display: block; }

/* ---------- Input group fix for RTL ---------- */
[dir="rtl"] .input-group > .input-group-text:first-child {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  border-right: 2px solid #e8e8f5;
  border-left: none;
}
[dir="rtl"] .input-group > .form-control:last-child {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  border-left: 2px solid #e8e8f5;
  border-right: none;
}

/* ---------- fw-600 utility ---------- */
.fw-600 { font-weight: 600 !important; }

/* ---------- Scrollbar hide for category nav ---------- */
.overflow-auto::-webkit-scrollbar { display: none; }

/* ---------- Menu Slider ---------- */
#menuSlider {
  border-radius: 0;          /* flush with restaurant header */
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,.15);
}
#menuSlider .carousel-item img {
  transition: transform .6s ease;
}
#menuSlider .carousel-item.active img {
  transform: scale(1.01);
}
#menuSlider .carousel-indicators [data-bs-target] {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,.6);
  border: none;
  margin: 0 4px;
  transition: all .3s;
}
#menuSlider .carousel-indicators .active {
  background: var(--primary);
  width: 28px;
  border-radius: 5px;
}
#menuSlider .carousel-control-prev,
#menuSlider .carousel-control-next {
  width: 48px; height: 48px;
  top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,.35);
  border-radius: 50%;
  margin: 0 12px;
  opacity: 1;
}
#menuSlider .carousel-control-prev-icon,
#menuSlider .carousel-control-next-icon {
  width: 20px; height: 20px;
}
@media (max-width: 576px) {
  #menuSlider .carousel-item img { height: 180px !important; }
}
