/* assets/app.css */
:root{
  --card-radius: 18px;
  --soft-shadow: 0 10px 25px rgba(17,24,39,.06);
}

/* Base */
html, body { height: 100%; }
body{
  background: #f7f8fb;
}

.app-shell{ max-width: 1100px; }

/* Cards */
.card{
  border-radius: var(--card-radius);
  box-shadow: var(--soft-shadow);
  border: 0;
}

/* Pills */
.nav-pills .nav-link{
  border-radius: 14px;
}

/* Badges / text helpers */
.badge-soft{
  background: rgba(13,110,253,.08);
  color: #0d6efd;
}
.mono{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
}
.muted{ color: #6b7280; }

/* Inputs / Buttons */
.btn-lg{ border-radius: 14px; }
.form-control, .form-select{ border-radius: 14px; }

/* Scanner box */
.scanner-box{
  border: 1px dashed rgba(0,0,0,.15);
  border-radius: 18px;
  background: #fff;
}

/* Result box animation */
.success-flash{ animation: flash 0.8s ease-in-out; }
@keyframes flash{
  0%{ transform:scale(.98); opacity:.7; }
  100%{ transform:scale(1); opacity:1; }
}

/* =========================
   Scan Modal (Popup) styling
   ========================= */
/* تأكد أن المودال أعلى من الكاميرا */
.modal {
  z-index: 2000 !important;
}

.modal-backdrop {
  z-index: 1990 !important;
}

/* منع فيديو الكاميرا من تغطية الصفحة */
#qrReader video {
  position: relative !important;
  z-index: 1 !important;
}

/* إصلاح حساب الارتفاع على الموبايل */
html, body {
  height: 100%;
  min-height: 100%;
}
/* make modal feel like the same design system */
.modal-content{
  border: 0;
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(17,24,39,.16);
}

.modal-header{
  border-bottom: 1px solid rgba(0,0,0,.06);
}

.modal-footer{
  border-top: 1px solid rgba(0,0,0,.06);
}

/* guest data card inside modal */
#scanModal .card{
  box-shadow: none;
}

#scanName{
  line-height: 1.2;
}

/* barcode badge wrap on small screens */
#scanBarcode{
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Improve alert inside modal */
#scanAlert{
  border-radius: 14px;
}

/* =========================
   Small screens tuning
   ========================= */
@media (max-width: 576px){
  .scanner-box{ padding: 6px !important; }

  /* slightly smaller modal spacing on mobile */
  .modal-body{ padding: 12px; }
  .modal-header, .modal-footer{ padding: 12px; }

  /* keep long text readable */
  #scanName{ font-size: 1.1rem; }
}
/* ===== Fix modal on mobile (RTL) ===== */
#scanModal .modal-dialog{
  margin: 12px auto;
  max-width: 520px;
  width: calc(100% - 24px);
}

#scanModal .modal-content{
  max-height: calc(100dvh - 24px);
  overflow: hidden;
}

#scanModal .modal-body{
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

/* keep modal centered even on small screens */
@media (max-width: 576px){
  #scanModal .modal-dialog{
    margin: 10px auto;
    width: calc(100% - 20px);
  }

  #scanModal .modal-content{
    max-height: calc(100dvh - 20px);
  }

  /* prevent text overflow */
  #scanName, #scanCompany{
    word-break: break-word;
  }

  #scanBarcode{
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}