/* QR Code Studio - Production Stylesheet */

/* Typography & Base */
body {
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  letter-spacing: -0.015em;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* SPA View Transitions */
@keyframes viewFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.spa-view:not(.hidden) {
  animation: viewFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Toast Notifications */
#toast {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

/* Advertisement Slot - Completely Hidden Unless Approved & Filled by AdSense */
.ad-slot-wrapper {
  display: none;
  margin: 0;
  padding: 0;
}

/* Shows seamlessly ONLY when Google AdSense fills the ad slot */
.ad-slot-wrapper.ad-filled,
.ad-slot-wrapper:has(ins[data-ad-status="filled"]),
.ad-slot-wrapper:has(iframe:not([height="0"])) {
  display: block;
  margin: 2.5rem auto;
  text-align: center;
}

.ad-slot-wrapper .ad-label {
  display: none;
}

.ad-slot-wrapper.ad-filled .ad-label,
.ad-slot-wrapper:has(ins[data-ad-status="filled"]) .ad-label,
.ad-slot-wrapper:has(iframe:not([height="0"])) .ad-label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.15em;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

/* Smooth Interactive Focus */
input:focus, textarea:focus, select:focus, button:focus-visible {
  outline: none;
}

/* ================================================= */
/* UNIQUE LIVE QR STUDIO STAGE & OPTICAL VIEWFINDER  */
/* ================================================= */

/* Viewfinder Corner Target Brackets */
.viewfinder-bracket {
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: #6366f1;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.85;
}
.viewfinder-tl {
  top: 10px;
  left: 10px;
  border-top-width: 2.5px;
  border-left-width: 2.5px;
  border-top-left-radius: 6px;
}
.viewfinder-tr {
  top: 10px;
  right: 10px;
  border-top-width: 2.5px;
  border-right-width: 2.5px;
  border-top-right-radius: 6px;
}
.viewfinder-bl {
  bottom: 10px;
  left: 10px;
  border-bottom-width: 2.5px;
  border-left-width: 2.5px;
  border-bottom-left-radius: 6px;
}
.viewfinder-br {
  bottom: 10px;
  right: 10px;
  border-bottom-width: 2.5px;
  border-right-width: 2.5px;
  border-bottom-right-radius: 6px;
}

#qr-stage:hover .viewfinder-bracket {
  border-color: #4f46e5;
  width: 18px;
  height: 18px;
  opacity: 1;
}

/* Stage Backdrop Modes */
#qr-stage.stage-mode-white {
  background-color: #ffffff;
  background-image: radial-gradient(#e2e8f0 1.2px, transparent 1.2px);
  background-size: 16px 16px;
  border-color: #e2e8f0;
}

#qr-stage.stage-mode-dark {
  background-color: #0f172a;
  background-image: radial-gradient(#334155 1.2px, transparent 1.2px);
  background-size: 16px 16px;
  border-color: #1e293b;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
}
#qr-stage.stage-mode-dark .viewfinder-bracket {
  border-color: #818cf8;
}

#qr-stage.stage-mode-blueprint {
  background-color: #f8fafc;
  background-image: 
    linear-gradient(to right, rgba(99, 102, 241, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(99, 102, 241, 0.08) 1px, transparent 1px);
  background-size: 20px 20px;
  border-color: #c7d2fe;
}
#qr-stage.stage-mode-blueprint .viewfinder-bracket {
  border-color: #4338ca;
}

/* Laser Scan Animation */
@keyframes scanlineAnim {
  0% {
    top: 5%;
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    top: 92%;
    opacity: 0;
  }
}

.scan-laser-line {
  position: absolute;
  left: 12px;
  right: 12px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #6366f1 20%, #a855f7 50%, #6366f1 80%, transparent);
  box-shadow: 0 0 12px 2px rgba(99, 102, 241, 0.65);
  pointer-events: none;
  display: none;
  z-index: 25;
}
.scan-laser-active .scan-laser-line {
  display: block;
  animation: scanlineAnim 1.4s ease-in-out infinite alternate;
}

/* ================================================= */
/* QR CODE EXTRACTOR & DROPZONE STYLING              */
/* ================================================= */

.dropzone-dragover {
  border-color: #6366f1 !important;
  background-color: #eef2ff !important;
  transform: scale(1.01);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

@keyframes pulseBorder {
  0%, 100% {
    border-color: #c7d2fe;
  }
  50% {
    border-color: #6366f1;
  }
}

.dropzone-pulsing {
  animation: pulseBorder 1.8s infinite ease-in-out;
}

/* Optical Scanner HUD Elements */
.hud-target-reticle {
  position: absolute;
  width: 120px;
  height: 120px;
  border: 1.5px dashed rgba(99, 102, 241, 0.4);
  border-radius: 50%;
  pointer-events: none;
  animation: spinSlow 12s linear infinite;
}

@keyframes spinSlow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.hud-crosshair-h {
  position: absolute;
  left: 20%;
  right: 20%;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.5), transparent);
  pointer-events: none;
}

.hud-crosshair-v {
  position: absolute;
  top: 20%;
  bottom: 20%;
  left: 50%;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(99, 102, 241, 0.5), transparent);
  pointer-events: none;
}

/* Ingestion Mode Switcher Tabs (Segmented Control) */
.extractor-tab-btn {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  border: 1px solid transparent;
}
.extractor-tab-btn.active {
  background-color: #ffffff;
  color: #4338ca;
  border-color: rgba(226, 232, 240, 0.8);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
  font-weight: 700;
}
.extractor-tab-btn.active svg {
  color: #4f46e5;
}
.extractor-tab-btn:not(.active) {
  color: #64748b;
  font-weight: 600;
}
.extractor-tab-btn:not(.active) svg {
  color: #94a3b8;
  transition: color 0.15s ease;
}
.extractor-tab-btn:not(.active):hover {
  color: #0f172a;
  background-color: rgba(255, 255, 255, 0.65);
}
.extractor-tab-btn:not(.active):hover svg {
  color: #64748b;
}

/* ================================================= */
/* TACTILE COLOR PICKER CONTROLLERS & SWATCHES       */
/* ================================================= */
.color-picker-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.color-picker-native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 10;
}

.color-swatch-disk {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  border: 2.5px solid #ffffff;
  box-shadow: 0 0 0 1px #cbd5e1, 0 1px 3px 0 rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.color-swatch-disk:hover {
  transform: scale(1.08);
  box-shadow: 0 0 0 2px #6366f1, 0 2px 6px 0 rgba(99, 102, 241, 0.3);
}

.quick-color-dot {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border: 1.5px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 1px rgba(203, 213, 225, 0.8), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.quick-color-dot:hover {
  transform: scale(1.25);
  box-shadow: 0 0 0 2px #6366f1, 0 2px 5px rgba(0, 0, 0, 0.2);
}


