/* ================================
   FOAID Brand QR Scanner – Dark Glow Theme
   File: assets/css/foaid-brand-qr.css
   ================================ */

.faoid-reset,
.faoid-reset * {
  box-sizing: border-box;
}

/* ---------- COLOR TOKENS ---------- */

.foaid-brand-qr-wrapper {
  --bg-page: #050506;
  --bg-panel: #0b0c10;
  --bg-panel-soft: #14151b;
  --bg-input: #050509;
  --border-subtle: #272937;
  --border-strong: #ff8b3d;

  --accent-orange: #ff8b3d;
  --accent-gold: #ffd85c;
  --accent-red: #ff4f4f;
  --accent-teal: #2ddca3;

  --text-main: #ffffff;
  --text-soft: #c8c9d6;
  --text-muted: #808294;

  --radius-card: 16px;
  --radius-pill: 999px;
  --shadow-heavy: 0 18px 40px rgba(0, 0, 0, 0.9);
  --shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.7);
}

/* ---------- WRAPPER ---------- */

.foaid-brand-qr-wrapper {
  max-width: 540px;
  margin: 24px auto;
  padding: 18px 16px 24px;
  background: radial-gradient(circle at top, #211109 0, #050506 55%, #020205 100%);
  border-radius: 20px;
  box-shadow: var(--shadow-heavy);
  color: var(--text-main);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
}

/* Make it breathe on small screens */
@media (max-width: 600px) {
  .foaid-brand-qr-wrapper {
    margin: 12px auto;
    padding: 14px 12px 18px;
    border-radius: 18px;
  }
}

/* ---------- BRAND LOGIN PANEL ---------- */

#foaid-brand-login {
  background: var(--bg-panel);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-subtle);
  padding: 14px 14px 16px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 12px;
}

#foaid-brand-login h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-gold);
}

.foaid-helper-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* Manual login block */

.foaid-brand-login-manual label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-soft);
  display: block;
  margin-bottom: 6px;
}

#foaid-brand-code-input {
  width: 100%;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-main);
  padding: 8px 12px;
  font-size: 0.86rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#foaid-brand-code-input::placeholder {
  color: var(--text-muted);
}

#foaid-brand-code-input:focus {
  border-color: var(--accent-orange);
  box-shadow: 0 0 0 1px rgba(255, 139, 61, 0.5);
}

/* Primary button */

#foaid-brand-start-btn {
  margin-top: 8px;
  width: 100%;
  border-radius: var(--radius-pill);
  border: none;
  padding: 9px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(90deg, var(--accent-orange), var(--accent-gold));
  color: #2a1308;
  box-shadow: 0 10px 24px rgba(255, 157, 87, 0.85);
  transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.1s ease;
}

#foaid-brand-start-btn:hover {
  filter: brightness(1.03);
}

#foaid-brand-start-btn:active {
  transform: translateY(1px);
  box-shadow: 0 6px 18px rgba(255, 157, 87, 0.9);
}

#foaid-brand-login hr {
  border: none;
  border-top: 1px solid #1f202a;
  margin: 12px 0 6px;
}

/* ---------- SCANNER SECTION ---------- */

#foaid-scanner-section {
  margin-top: 8px;
  background: var(--bg-panel);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-subtle);
  padding: 14px 14px 16px;
  box-shadow: var(--shadow-soft);
}

/* Header row: brand info + change button */

.foaid-brand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.82rem;
}

.foaid-brand-header span {
  color: var(--text-soft);
}

.foaid-brand-header strong {
  color: #ffffff;
}

/* “View Brands Ranking” link */

a.brands-ranking {
  font-size: 0.78rem;
  text-decoration: none;
  background: rgba(18, 22, 35, 0.9);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  border: 1px solid #343751;
  color: #cfd3ff;
  box-shadow: 0 0 0 1px rgba(59, 63, 94, 0.4);
}

a.brands-ranking:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

/* Change brand button */

#foaid-change-brand-btn {
  border-radius: var(--radius-pill);
  border: 1px solid #3a3337;
  background: #111018;
  color: var(--text-soft);
  padding: 4px 10px;
  font-size: 0.78rem;
  cursor: pointer;
}

#foaid-change-brand-btn:hover {
  border-color: var(--accent-orange);
  color: #ffd7b1;
}

/* QR Reader container (html5-qrcode library) */

#foaid-qr-reader {
  margin-top: 6px;
  border-radius: 14px;
  overflow: hidden;
  background: radial-gradient(circle at top, #1a141f 0, #050508 55%);
  border: 1px solid #2f3145;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.9);
}

/* Try to tame the default html5-qrcode styles */
#foaid-qr-reader video,
#foaid-qr-reader img,
#foaid-qr-reader div {
  max-width: 100%;
}

/* Status line */

#foaid-scan-status {
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--text-soft);
}

/* You can add classes via JS like: success / error / info */
#foaid-scan-status.foaid-status-success {
  color: #7fffd4;
}
#foaid-scan-status.foaid-status-error {
  color: #ff9b9b;
}
#foaid-scan-status.foaid-status-info {
  color: var(--text-soft);
}

/* ---------- MODALS ---------- */

.foaid-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, rgba(0, 0, 0, 0.95) 0, rgba(0, 0, 0, 0.85) 45%, rgba(0, 0, 0, 0.9) 100%);
}

.foaid-modal-content {
  background: var(--bg-panel-soft);
  border-radius: 18px;
  border: 1px solid var(--border-subtle);
  padding: 14px 14px 12px;
  width: 100%;
  max-width: 420px;
  color: var(--text-main);
  box-shadow: var(--shadow-heavy);
}

/* Brand QR popup slightly wider if needed */
.foaid-brand-qr-popup-content {
  max-width: 460px;
}

.foaid-modal-content h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-gold);
}

.foaid-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.foaid-modal-close {
  background: transparent;
  border: none;
  color: var(--text-soft);
  font-size: 1.2rem;
  cursor: pointer;
}

/* Visitor data text */

.foaid-visitor-data,
.foaid-visitor-existing {
  font-size: 0.8rem;
  color: var(--text-soft);
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(12, 13, 20, 0.9);
  border: 1px solid #2b2c3a;
  margin-bottom: 8px;
}

/* Form groups inside modal */

.foaid-form-group {
  margin-bottom: 10px;
}

.foaid-form-group label {
  font-size: 0.82rem;
  color: var(--text-soft);
}

.foaid-form-group > label:first-child {
/*   display: block; */
  margin-bottom: 4px;
}

/* Priority radio layout */
.foaid-form-group input[type="radio"] {
  margin-right: 4px;
}

/* Make each priority option on its own line */
.foaid-form-group label {
  display: block;
  margin-bottom: 4px;
}

/* Title label "Priority:" a bit bolder / spaced */
.foaid-form-group > label:first-child {
  margin-bottom: 6px;
  font-weight: 500;
}

/* Space between radio and text */
.foaid-form-group label input[type="radio"] {
  margin-right: 6px;
  vertical-align: middle;
}


/* Notes box */

#foaid-notes {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-main);
  padding: 7px 9px;
  font-size: 0.84rem;
  resize: vertical;
}

#foaid-notes::placeholder {
  color: var(--text-muted);
}

/* Modal button row */

.foaid-modal-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Generic secondary button (Cancel, Close, etc.) */

#foaid-cancel-btn,
#foaid-existing-cancel-btn,
#foaid-brand-qr-popup-close,
#foaid-brand-qr-popup-close-x {
  border-radius: var(--radius-pill);
  border: 1px solid #3b3a45;
  background: #101018;
  color: var(--text-soft);
  padding: 6px 10px;
  font-size: 0.78rem;
  cursor: pointer;
}

#foaid-cancel-btn:hover,
#foaid-existing-cancel-btn:hover,
#foaid-brand-qr-popup-close:hover,
#foaid-brand-qr-popup-close-x:hover {
  border-color: var(--accent-red);
  color: #ffb3b3;
}

/* Primary save / new priority buttons */

#foaid-save-btn,
#foaid-new-priority-btn {
  border-radius: var(--radius-pill);
  border: none;
  padding: 7px 14px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(90deg, var(--accent-teal), var(--accent-gold));
  color: #06130f;
  box-shadow: 0 8px 22px rgba(45, 220, 163, 0.7);
}

#foaid-save-btn:active,
#foaid-new-priority-btn:active {
  transform: translateY(1px);
}

/* QR popup reader container */

#foaid-brand-qr-popup-reader {
  margin: 8px 0;
  border-radius: 14px;
  overflow: hidden;
  background: radial-gradient(circle at top, #1c1222 0, #050509 55%);
  border: 1px solid #313254;
}

/* ---------- SUCCESS TOAST ---------- */

#foaid-success-toast {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(4, 18, 14, 0.98);
  border: 1px solid #27d89b;
  color: #d9fff2;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.9);
  font-size: 0.82rem;
  z-index: 10000;
}

.foaid-toast-icon {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #27d89b;
  color: #04110b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
}

.foaid-toast-text {
  white-space: nowrap;
}

/* ---------- SMALL RESPONSIVE TWEAKS ---------- */

@media (max-width: 480px) {
  /* Keep everything on one line for the brand header */
  .foaid-brand-header {
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 4px;
  }

  /* Brand: XYZ – take remaining space, truncate if too long */
  .foaid-brand-header span {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.78rem;
  }

  /* Make both buttons a bit smaller so they fit */
  a.brands-ranking,
  #foaid-change-brand-btn {
    white-space: nowrap;
    padding: 3px 6px;
    font-size: 0.7rem;
  }

  /* Keep modal / brand lockup tweaks from before */
  .foaid-modal-content {
    margin: 0 10px;
  }

  .brand-lockup {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* Visitor data -> stacked rows */
.foaid-visitor-data,
.foaid-visitor-existing {
  display: flex;
  flex-direction: column;
  gap: 8px;
  line-height: 1.45;
  padding: 10px 10px; /* a little more breathing room */
}

/* Row */
.foaid-visitor-data .foaid-vrow,
.foaid-visitor-existing .foaid-vrow {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 6px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}

.foaid-visitor-data .foaid-vrow:last-child,
.foaid-visitor-existing .foaid-vrow:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.foaid-vlabel {
  color: var(--text-muted);
  min-width: 90px;
}

.foaid-vvalue {
  color: var(--text-main);
  text-align: right;
  word-break: break-word;
}

/* Visitor row: Label: Value (same line, left aligned) */
.foaid-vrow {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

/* Label (Code:, Name:, Phone:) */
.foaid-vlabel {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
}

/* Value */
.foaid-vvalue {
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 500;
  word-break: break-word;
}

/* FORCE Label: Value to stay together (LEFT aligned) */
.foaid-vrow {
  display: flex;
  justify-content: flex-start !important; /* ⬅ override space-between */
  align-items: baseline;
  gap: 6px;
}

/* Label */
.foaid-vlabel {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
}

/* Value — remove right push completely */
.foaid-vvalue {
  text-align: left !important;
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 500;
  word-break: break-word;
}
