body {
  margin: 0;
}

.example-container {
  overflow: hidden;
  position: absolute;
  width: 100%;
  height: 100%;
}

/* ── Scanning Overlay ──────────────────────────────────────────────────── */
#example-scanning-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  background: radial-gradient(circle at center, transparent 35%, rgba(10, 8, 20, 0.45) 100%);
  z-index: 2;
}

@media (min-aspect-ratio: 1/1) {
  #example-scanning-overlay .inner {
    width: 50vh;
    height: 50vh;
  }
}

@media (max-aspect-ratio: 1/1) {
  #example-scanning-overlay .inner {
    width: 80vw;
    height: 80vw;
  }
}

#example-scanning-overlay .inner {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-radius: 24px;
  /* Glowing corners using a premium neon-indigo gradient */
  background:
    linear-gradient(to right, #a5b4fc 12px, transparent 12px) 0 0,
    linear-gradient(to right, #a5b4fc 12px, transparent 12px) 0 100%,
    linear-gradient(to left, #a5b4fc 12px, transparent 12px) 100% 0,
    linear-gradient(to left, #a5b4fc 12px, transparent 12px) 100% 100%,
    linear-gradient(to bottom, #a5b4fc 12px, transparent 12px) 0 0,
    linear-gradient(to bottom, #a5b4fc 12px, transparent 12px) 100% 0,
    linear-gradient(to top, #a5b4fc 12px, transparent 12px) 0 100%,
    linear-gradient(to top, #a5b4fc 12px, transparent 12px) 100% 100%;
  background-repeat: no-repeat;
  background-size: 32px 32px;
  box-shadow: 0 0 20px rgba(165, 180, 252, 0.15), inset 0 0 15px rgba(165, 180, 252, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

#example-scanning-overlay.hidden {
  display: none;
}

#example-scanning-overlay img {
  opacity: 0.6;
  width: 90%;
  align-self: center;
}

#example-scanning-overlay .inner .scanline {
  position: absolute;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent 10%, #a5b4fc 50%, transparent 90%);
  box-shadow: 0 0 10px #818cf8, 0 0 20px #6366f1;
  animation: move 2.5s ease-in-out infinite;
}

.scan-instruction {
  position: absolute;
  bottom: -45px;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 16px;
  font-style: italic;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.5px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  animation: pulse 2s ease-in-out infinite;
  white-space: nowrap;
  text-align: center;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; transform: scale(0.98); }
  50% { opacity: 1; transform: scale(1); }
}

@keyframes move {
  0%, 100% { top: 4%; opacity: 0.3; }
  50% { top: 96%; opacity: 1; }
}

/* ── Premium Loader Overlay ────────────────────────────────────────────── */
#experience-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at center, #0c0a1a 0%, #030207 100%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', Georgia, serif;
  color: #ffffff;
  transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), visibility 0.8s;
  overflow: hidden;
}

#experience-loader.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 85%;
  max-width: 360px;
  padding: 40px 30px;
  border-radius: 28px;
  background: rgba(10, 8, 20, 0.4);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  position: relative;
}

.loader-content::before {
  content: '';
  position: absolute;
  top: -20px;
  left: -20px;
  right: -20px;
  bottom: -20px;
  background: radial-gradient(circle, rgba(129, 140, 248, 0.1) 0%, transparent 70%);
  z-index: -1;
  filter: blur(30px);
  pointer-events: none;
}

.loader-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 30px;
  text-align: center;
}

.logo-text {
  font-size: 38px;
  font-weight: 500;
  font-style: italic;
  letter-spacing: 1px;
  background: linear-gradient(135deg, #fefeff 0%, #e0e7ff 40%, #c7d2fe 70%, #a5b4fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 4px 30px rgba(165, 180, 252, 0.15);
  margin-bottom: 5px;
}

.loader-status {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.5px;
}

#loader-status-text {
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 250px;
}

#loader-percentage {
  color: #a5b4fc;
  font-weight: 500;
}

.progress-container {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 25px;
  position: relative;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #c7d2fe 0%, #a5b4fc 50%, #818cf8 100%);
  box-shadow: 0 0 10px rgba(165, 180, 252, 0.4);
  border-radius: 10px;
  transition: width 0.3s cubic-bezier(0.1, 0.8, 0.25, 1);
}

.loader-footer {
  font-size: 11px;
  font-weight: 400;
  font-style: italic;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.3);
  text-transform: capitalize;
}

/* Custom Spinner */
.loader-spinner-container {
  margin-bottom: 25px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.loader-spinner {
  width: 32px;
  height: 32px;
  border: 2px solid rgba(165, 180, 252, 0.15);
  border-left-color: #a5b4fc;
  border-right-color: #a5b4fc;
  border-radius: 50%;
  animation: spinner-spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  filter: drop-shadow(0 0 8px rgba(165, 180, 252, 0.4));
}

@keyframes spinner-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Customize/Override MindAR default loading spinner */
.mindar-ui-loading {
  background: radial-gradient(circle at center, #0c0a1a 0%, #030207 100%) !important;
  font-family: 'Playfair Display', Georgia, serif !important;
  z-index: 99999 !important;
}

.mindar-ui-loading .mindar-ui-spinner {
  border: 2px solid rgba(165, 180, 252, 0.15) !important;
  border-top-color: #a5b4fc !important;
  border-radius: 50% !important;
  width: 40px !important;
  height: 40px !important;
  animation: mindar-spin 1s linear infinite !important;
  box-shadow: 0 0 15px rgba(165, 180, 252, 0.4) !important;
}

@keyframes mindar-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ── Confession Overlay ──────────────────────────────────────────────────── */
#confession-overlay {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: 300px;
  max-width: 90vw;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s cubic-bezier(0.25, 1, 0.5, 1), transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  transform: translateX(-50%) translateY(20px);
}

/* When signing, expand width for larger pads */
#confession-overlay.signing-mode {
  width: 340px;
}

#confession-overlay.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.confession-card {
  background: rgba(12, 10, 26, 0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(165, 180, 252, 0.15);
  border-radius: 16px;
  padding: 4px 16px 10px 16px;
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 30px rgba(129, 140, 248, 0.08);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.confession-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(165, 180, 252, 0.3), transparent);
}

.confession-question {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 15px;
  font-style: italic;
  font-weight: 500;
  color: #fff;
  letter-spacing: 0.3px;
  line-height: 1.3;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #fefeff 0%, #e0e7ff 50%, #c7d2fe 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.confession-btn {
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.5) 0%, rgba(129, 140, 248, 0.4) 100%);
  border: 1px solid rgba(165, 180, 252, 0.25);
  border-radius: 12px;
  padding: 6px 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
  position: relative;
  overflow: hidden;
}

.confession-btn::before {
  content: '';
  position: absolute;
  top: 0; left: -100%; right: 100%; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transition: left 0.5s, right 0.5s;
}

.confession-btn:hover::before,
.confession-btn:active::before {
  left: 100%; right: -100%;
}

.confession-btn:hover,
.confession-btn:active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.7) 0%, rgba(129, 140, 248, 0.6) 100%);
  border-color: rgba(165, 180, 252, 0.4);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
  transform: translateY(-1px);
}

.confession-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Gradient Animated 'Yes Bibi' Button */
#btn-sign {
  background: linear-gradient(90deg, #2563eb, #3b82f6, #facc15, #3b82f6, #2563eb);
  background-size: 200% auto;
  animation: gradient-shift 3s linear infinite;
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

#btn-sign:hover,
#btn-sign:active {
  background: linear-gradient(90deg, #2563eb, #3b82f6, #facc15, #3b82f6, #2563eb);
  background-size: 200% auto;
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 6px 18px rgba(250, 204, 21, 0.4), 0 0 10px rgba(37, 99, 235, 0.3);
  transform: translateY(-1.5px) scale(1.02);
}

@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* ── Signature Panel ───────────────────────────────────────────────────── */
#signature-panel {
  display: none;
  margin-top: 14px;
}

#signature-panel.active {
  display: block;
  animation: fadeSlideIn 0.4s ease;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.sig-section {
  margin-bottom: 8px;
}

.sig-label {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 12px;
  font-style: italic;
  color: rgba(199, 210, 254, 0.8);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.sig-canvas-wrap {
  position: relative;
  border: 1px solid rgba(165, 180, 252, 0.12);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
}

.sig-canvas {
  display: block;
  width: 100%;
  height: 180px; /* Increased from 120px */
  touch-action: none;
  cursor: crosshair;
}

.sig-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  margin-top: 5px;
}

.sig-action-btn {
  font-family: 'Outfit', sans-serif;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: rgba(199, 210, 254, 0.6);
  background: transparent;
  border: 1px solid rgba(165, 180, 252, 0.1);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sig-action-btn:hover,
.sig-action-btn:active {
  color: rgba(199, 210, 254, 0.9);
  border-color: rgba(165, 180, 252, 0.3);
  background: rgba(99, 102, 241, 0.15);
}

.sig-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(165, 180, 252, 0.12), transparent);
  margin: 10px 0;
}

/* ── Love Timer ────────────────────────────────────────────────────────── */
.love-timer-label {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 13px;
  font-style: italic;
  color: rgba(199, 210, 254, 0.7);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease;
}

.love-timer-label:hover {
  color: rgba(199, 210, 254, 0.95);
}

.love-timer-value {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 300;
  color: #fff;
  letter-spacing: 2px;
  margin-bottom: 4px;
  line-height: 1.5;
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.love-timer-value:hover {
  transform: scale(1.02);
  opacity: 0.9;
}

.love-timer-value.original-date-active {
  letter-spacing: 0.6px;
}

.love-timer-value.original-date-active .timer-num {
  font-size: 13.5px;
}

.love-timer-value .timer-num {
  font-weight: 500;
  font-size: 20px;
  background: linear-gradient(135deg, #fefeff, #c7d2fe);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.love-timer-value .timer-unit {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(165, 180, 252, 0.5);
  margin: 0 2px;
}

.love-replay-btn {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 11px;
  font-style: italic;
  color: rgba(165, 180, 252, 0.5);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  margin-top: 6px;
  transition: color 0.2s;
  letter-spacing: 0.3px;
}

.love-replay-btn:hover {
  color: rgba(165, 180, 252, 0.9);
}

/* ── Replay overlay in timer mode ─────────────────────────────────────── */
#timer-replay-panel {
  display: none;
  margin-top: 12px;
}

#timer-replay-panel.active {
  display: block;
  animation: fadeSlideIn 0.4s ease;
}

.replay-canvas-readonly {
  display: block;
  width: 100%;
  aspect-ratio: 1.7;
  pointer-events: auto;
  cursor: pointer;
  transition: filter 0.2s ease;
}

.replay-canvas-readonly:hover {
  filter: drop-shadow(0 0 6px rgba(165, 180, 252, 0.3));
}

/* ── Heart pulse animation on question ────────────────────────────────── */
.heart-icon {
  display: inline-block;
  font-size: 16px;
  animation: heartPulse 1.2s ease-in-out infinite;
  filter: drop-shadow(0 0 6px rgba(248, 113, 113, 0.4));
}

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

/* ── Loading dots for submit ──────────────────────────────────────────── */
.submitting .confession-btn::after {
  content: '...';
  animation: dots 1.2s steps(3) infinite;
}

@keyframes dots {
  0% { content: '.'; }
  33% { content: '..'; }
  66% { content: '...'; }
}
