/* ==========================================================================
   QR Type Result Card
   Displays the detected QR code type (WiFi, Contact, Phone, SMS, Email, URL…)
   with copyable fields. Loaded on index-new.blade.php.
   ========================================================================== */

:root {
  --qr-teal: #0f9d8f;
  --qr-teal-dark: #0b7d72;
  --qr-teal-soft: #d6f1ec;
  --qr-ink: #0f172a;
  --qr-muted: #64748b;
  --qr-border: #e5e9f0;
}

.qr-type-card {
  display: none;
  margin: 18px auto 0;
  max-width: 560px;
  width: 100%;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.12);
  overflow: hidden;
  text-align: left;
  animation: qrTypeFadeIn 0.35s ease;
  color: var(--qr-ink);
}

.qr-type-card.is-visible {
  display: block;
}

@keyframes qrTypeFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Header -------------------------------------------------------------- */
.qr-type-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--qr-border);
}

.qr-type-icon {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--qr-teal-soft);
  color: var(--qr-teal);
}

.qr-type-icon svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
}

.qr-type-heading {
  min-width: 0;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
}

.qr-type-label {
  color: var(--qr-ink);
  margin-right: 8px;
}

.qr-type-name {
  color: var(--qr-teal);
}

/* ---- Body / fields ------------------------------------------------------- */
.qr-type-body {
  padding: 6px 24px;
}

.qr-type-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--qr-border);
}

.qr-type-row:last-child {
  border-bottom: none;
}

.qr-type-field-icon {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--qr-teal-soft);
  color: var(--qr-teal);
}

.qr-type-field-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
}

.qr-type-field {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.qr-type-key {
  flex: 0 0 auto;
  min-width: 130px;
  font-size: 16px;
  font-weight: 700;
  color: var(--qr-ink);
}

.qr-type-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--qr-teal);
  word-break: break-word;
  overflow-wrap: anywhere;
}

.qr-type-value a {
  color: var(--qr-teal);
  text-decoration: none;
}

.qr-type-value a:hover {
  text-decoration: underline;
}

.qr-type-card[data-type="url"] .qr-type-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
}

.qr-type-card[data-type="text"] .qr-type-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
}

/* ---- Copy button --------------------------------------------------------- */
.qr-type-copy {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--qr-border);
  border-radius: 12px;
  background: #ffffff;
  color: var(--qr-teal-dark);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

.qr-type-copy:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.qr-type-copy:active {
  transform: scale(0.92);
}

.qr-type-copy.is-copied {
  background: var(--qr-teal);
  border-color: var(--qr-teal);
  color: #ffffff;
}

.qr-type-copy svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

.qr-type-copy .qr-type-copy-badge {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--qr-teal-dark);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

.qr-type-copy .qr-type-copy-badge svg {
  width: 10px;
  height: 10px;
}

.qr-type-copy.is-copied .qr-type-copy-badge {
  display: flex;
}

/* ---- Footer -------------------------------------------------------------- */
.qr-type-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 18px 24px 22px;
}

.qr-type-action {
  flex: 1 1 140px;
  min-width: 140px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 16px;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.2s ease, background 0.2s ease, transform 0.1s ease;
}

.qr-type-action svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

.qr-type-action:active {
  transform: scale(0.97);
}

.qr-type-action--primary {
  color: #fff;
  background: var(--qr-teal);
}

.qr-type-action--primary:hover {
  filter: brightness(1.06);
}

.qr-type-action--ghost {
  color: var(--qr-teal-dark);
  background: var(--qr-teal-soft);
}

.qr-type-action--ghost:hover {
  filter: brightness(0.97);
}

/* ---- Toast --------------------------------------------------------------- */
.qr-type-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: var(--qr-ink);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 9999;
}

.qr-type-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 600px) {
  .qr-type-card { border-radius: 16px; }
  .qr-type-heading { font-size: 20px; }
  .qr-type-header { padding: 18px; }
  .qr-type-body { padding: 4px 18px; }
  .qr-type-footer { padding: 16px 18px 18px; }
  .qr-type-action { flex-basis: 100%; min-width: 0; }
  .qr-type-field { flex-direction: column; gap: 2px; }
  .qr-type-key { min-width: 0; }
}
