/* KDPika Luxury Theme & High-Impact Strobe Alert System */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #111827;
  color: #172033;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.top {
  height: 66px;
  background: #111827;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(22px, calc((100% - 1120px) / 2));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand, .customer-brand {
  font-weight: 850;
  font-size: 21px;
  letter-spacing: -0.7px;
  color: #fff;
}

.brand span, .customer-brand span {
  font-size: 11px;
  letter-spacing: 2px;
  color: #fbbf24;
}

.muted {
  color: #697386;
}

.top .muted {
  color: #c5cad5;
  font-size: 13px;
}

.wrap {
  max-width: 1120px;
  margin: 38px auto;
  padding: 0 20px;
}

.heading, .tablehead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #667085;
  text-transform: uppercase;
}

h1 {
  font-size: 28px;
  letter-spacing: -0.8px;
  margin: 7px 0;
}

h2 {
  font-size: 19px;
  margin: 8px 0 16px;
}

/* Panels */
.panel {
  background: #fff;
  border: 1px solid #e5e9f0;
  border-radius: 18px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(24, 36, 58, 0.04);
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.login {
  max-width: 440px;
  margin: 8vh auto;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin: 15px 0 7px;
}

input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #d9deea;
  border-radius: 12px;
  font-size: 15px;
  outline: none;
  background: #fbfcfe;
  transition: all 0.2s;
}

input:focus {
  border-color: #6366f1;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

button {
  border: 0;
  border-radius: 12px;
  padding: 13px 18px;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.primary {
  background: #4f46e5;
  color: white;
}

.primary:hover {
  background: #4338ca;
}

.primary:active {
  transform: scale(0.98);
}

.ghost {
  background: #eef0f6;
  color: #263047;
}

.ghost:hover {
  background: #e2e5ee;
}

.alert {
  background: #fff0f0;
  color: #a12b2b;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 14px 0;
  font-size: 14px;
}

.success-banner {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.success {
  background: #f0fdf6;
  border-color: #bbf7d0;
  padding: 20px;
}

.share {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 10px;
}

.share a, .textlink {
  color: #4338ca;
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 600;
}

#qrcode {
  margin-top: 18px;
  background: white;
  padding: 14px;
  display: inline-block;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

/* Recall Button (Admin) */
.recall-btn {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  color: white !important;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
}

.recall-btn:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
}

/* Filter Tabs */
.filter-tabs {
  display: flex;
  gap: 8px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 12px;
}

.filter-tab {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #475467;
  text-decoration: none;
  transition: all 0.2s;
}

.filter-tab.active {
  background: white;
  color: #0f172a;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

/* Customer Ack Badge in Admin */
.customer-ack-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ecfdf5;
  color: #166534;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  margin-top: 5px;
  border: 1px solid #bbf7d0;
  animation: pulseGreen 1.5s infinite;
}

@keyframes pulseGreen {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

.wait-badge {
  background: #f1f5f9;
  color: #475467;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}

.wait-med {
  background: #fef3c7;
  color: #b45309;
}

.wait-late {
  background: #fee2e2;
  color: #b91c1c;
}

/* Orders List */
.pill {
  background: #eef0ff;
  color: #4f46e5;
  padding: 6px 12px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 700;
}

.order {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 16px 0;
  border-top: 1px solid #edf0f4;
}

.order-main {
  display: flex;
  align-items: center;
  gap: 14px;
}

.order-no {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #f0efff;
  color: #4f46e5;
  display: grid;
  place-items: center;
  font-weight: 850;
  font-size: 18px;
}

.small {
  font-size: 13px;
  margin-top: 3px;
}

.tiny {
  font-size: 11px;
  margin-top: 4px;
}

.order-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status {
  font-size: 11px;
  font-weight: 800;
  border-radius: 30px;
  padding: 6px 12px;
}

.s-preparing {
  background: #fff6df;
  color: #9a6700;
}

.s-ready {
  background: #dcfce7;
  color: #167443;
}

.s-collected {
  background: #e9edf4;
  color: #526071;
}

.s-cancelled {
  background: #fee2e2;
  color: #a12b2b;
}

.smallbtn {
  padding: 9px 13px;
  font-size: 12px;
}

.textlink {
  text-decoration: none;
}

.textlink:hover {
  text-decoration: underline;
}

footer {
  text-align: center;
  color: #9aa2b1;
  font-size: 12px;
  padding: 24px 15px;
}

/* =======================================================
   High-Impact Flashing Strobe Effect (وميض الشاشة القوي)
   ======================================================= */
body.strobe-flash-active {
  animation: bgFlashStrobe 0.35s infinite !important;
}

@keyframes bgFlashStrobe {
  0% { background-color: #00e676 !important; }
  25% { background-color: #ffffff !important; }
  50% { background-color: #ff9100 !important; }
  75% { background-color: #0f172a !important; }
  100% { background-color: #00e676 !important; }
}

body.strobe-flash-active .customer-card {
  border: 4px solid #ffffff !important;
  box-shadow: 0 0 50px rgba(0, 230, 118, 0.9), 0 0 100px rgba(255, 255, 255, 0.8) !important;
  animation: cardStrobePulse 0.35s infinite !important;
}

@keyframes cardStrobePulse {
  0%, 100% { transform: scale(1.02); }
  50% { transform: scale(0.98); }
}

/* Fullscreen flashing border / vignette */
.flash-strobe-border {
  position: fixed;
  inset: 0;
  border: 14px solid #00e676;
  box-shadow: inset 0 0 80px rgba(0, 230, 118, 0.9);
  pointer-events: none;
  z-index: 99998;
  animation: borderFlash 0.35s infinite alternate;
}

@keyframes borderFlash {
  0% { border-color: #00e676; opacity: 1; }
  50% { border-color: #ffffff; opacity: 0.9; }
  100% { border-color: #ff9100; opacity: 1; }
}

/* Top Urgent Heads-Up Banner */
.ready-banner-wrap {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 440px;
  z-index: 99999;
  animation: slideDownBanner 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideDownBanner {
  from { transform: translate(-50%, -100%); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

.ready-banner-card {
  background: #ffffff;
  border: 3px solid #16a34a;
  border-radius: 22px;
  padding: 18px 16px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.banner-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 2px solid #f59e0b;
}

.banner-texts h3 {
  margin: 0;
  font-size: 17px;
  color: #0f172a;
  font-weight: 850;
}

.banner-texts p {
  margin: 3px 0 0;
  font-size: 13px;
  color: #475467;
}

.banner-actions {
  display: flex;
  gap: 8px;
  width: 100%;
}

.ack-btn {
  flex: 1;
  padding: 13px 8px;
  font-size: 14px;
  border-radius: 12px;
  font-weight: 800;
  cursor: pointer;
  border: 0;
  transition: transform 0.15s;
}

.ack-btn:active {
  transform: scale(0.97);
}

.ack-primary {
  background: #16a34a;
  color: white;
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.4);
}

.ack-secondary {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.ack-confirmed-box {
  background: #f0fdf4;
  border: 2px solid #86efac;
  color: #166534;
  border-radius: 16px;
  padding: 12px;
  margin: 14px 0;
  font-size: 13px;
}

/* =========================================
   Customer Mobile View & Stepper
   ========================================= */
.customer-body {
  background: #111827;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background 0.3s;
}

.customer-wrap {
  max-width: 440px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 18px 40px;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo-img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid #f59e0b;
}

.brand-text {
  font-weight: 850;
  font-size: 18px;
  color: white;
}

.brand-text span {
  font-size: 10px;
  color: #fbbf24;
  letter-spacing: 1.5px;
}

.lang-switch {
  display: flex;
  gap: 6px;
}

.lang-btn {
  background: rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  border: 0;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 20px;
  cursor: pointer;
}

.lang-btn.active {
  background: #4f46e5;
  color: white;
}

.customer-card {
  background: #ffffff;
  border-radius: 28px;
  padding: 30px 22px;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
  position: relative;
  overflow: hidden;
  transition: all 0.3s;
}

.big-number-wrap {
  position: relative;
  display: inline-block;
  margin: 6px 0;
}

.big-number {
  font-size: 60px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -2px;
  color: #4f46e5;
}

.order-item-badge {
  display: inline-block;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  margin: 8px 0 14px;
}

.radar-ripple {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90px;
  height: 90px;
  border: 3px solid #10b981;
  border-radius: 50%;
  animation: rippleSpread 1.2s infinite ease-out;
  pointer-events: none;
}

@keyframes rippleSpread {
  0% { width: 40px; height: 40px; opacity: 1; }
  100% { width: 140px; height: 140px; opacity: 0; }
}

/* Stepper Progress Bar */
.order-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 22px;
  padding: 0 10px;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  z-index: 2;
}

.step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #64748b;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  transition: all 0.3s;
}

.step-label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
}

.step-done .step-dot {
  background: #16a34a;
  color: white;
}

.step-done .step-label {
  color: #16a34a;
}

.step-active .step-dot {
  background: #4f46e5;
  color: white;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.2);
}

.step-active .step-label {
  color: #4f46e5;
}

.step-ready .step-dot {
  background: #16a34a !important;
  color: white !important;
  box-shadow: 0 0 0 6px rgba(22, 163, 74, 0.3) !important;
  animation: pulseDot 1.2s infinite;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.step-line {
  flex: 1;
  height: 3px;
  background: #e2e8f0;
  margin: 0 4px;
  margin-bottom: 18px;
  transition: background 0.3s;
}

.line-active {
  background: #4f46e5;
}

.line-done {
  background: #16a34a;
}

.recall-indicator {
  background: #fee2e2;
  color: #b91c1c;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 8px;
  border: 1px solid #fca5a5;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  animation: pulseBadge 1.5s infinite;
}

@keyframes pulseBadge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Status Banner */
.customer-status {
  margin: 16px 0 16px;
  padding: 20px 16px;
  border-radius: 20px;
  transition: all 0.3s ease;
}

.status-preparing {
  background: #fff8e6;
  color: #8b5b00;
  border: 1px solid #fef08a;
}

.status-ready {
  background: #ecfdf5;
  color: #065f46;
  border: 2px solid #34d399;
  animation: pulseReady 1.6s infinite ease-in-out;
}

.status-collected {
  background: #f1f5f9;
  color: #334155;
}

.status-cancelled {
  background: #fef2f2;
  color: #991b1b;
}

.status-icon {
  font-size: 38px;
  font-weight: 900;
  line-height: 1;
}

.customer-status h2 {
  font-size: 18px;
  margin: 8px 0 6px;
  font-weight: 800;
}

.customer-status p {
  font-size: 13px;
  margin: 0;
  line-height: 1.5;
  opacity: 0.9;
}

.elapsed-timer {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 700;
  opacity: 0.75;
}

.notify {
  width: 100%;
  padding: 16px;
  font-size: 15px;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}

.live {
  font-size: 12px;
  color: #64748b;
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  margin-right: 6px;
  animation: blink 1.5s infinite;
}

.customer-foot {
  text-align: center;
  color: #94a3b8;
  font-size: 12px;
  margin-top: 24px;
}

/* =========================================
   iOS Instructions Modal
   ========================================= */
.ios-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.25s ease;
}

.ios-modal-content {
  background: #ffffff;
  width: 100%;
  max-width: 480px;
  border-radius: 28px 28px 0 0;
  padding: 24px 22px 34px;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.3);
  animation: slideUp 0.3s ease;
}

.ios-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.close-btn {
  background: #f1f5f9;
  border: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #64748b;
}

.ios-step-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 14px;
  margin: 14px 0;
}

.ios-step-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.ios-step-item:last-child {
  margin-bottom: 0;
}

.step-badge {
  background: #4f46e5;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}

.step-text {
  font-size: 14px;
  line-height: 1.5;
  color: #334155;
}

.instant-tip {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
  margin-top: 12px;
}

.ios-modal-footer {
  margin-top: 14px;
}

/* Animations */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

@keyframes pulseReady {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.4); }
  50% { transform: scale(1.02); box-shadow: 0 0 0 10px rgba(52, 211, 153, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@media (max-width: 700px) {
  .grid { grid-template-columns: 1fr; }
  .heading { align-items: flex-start; }
  h1 { font-size: 24px; }
  .order { align-items: flex-start; flex-direction: column; }
  .order-actions { justify-content: flex-start; }
  .top { padding: 0 18px; }
  .wrap { margin: 20px auto; }
  .panel { padding: 18px; }
}
