/* ==========================================================================
   CLIQ AI SIZING STUDIO — STYLESHEET
   Neuromorphic Coin Reference & Hand Computer Vision Calibrator
   ========================================================================== */

.sizing-hero-section {
  padding: 120px 0 50px;
  text-align: center;
}

.sizing-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-espresso-muted);
  margin-bottom: 24px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-pill);
  background: var(--color-base);
  transition: all 0.2s ease;
}

.sizing-back-link:hover {
  color: var(--color-espresso);
  box-shadow: var(--shadow-pill-hover);
  transform: translateX(-3px);
}

/* 3-Step Protocol Guide */
.protocol-steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 48px;
}

.protocol-card {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--color-base);
  box-shadow: var(--shadow-card);
  text-align: left;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.protocol-num {
  font-family: var(--font-display);
  font-size: 1.8rem;
  line-height: 1;
  color: var(--color-espresso);
  background: var(--color-base-dark);
  box-shadow: var(--shadow-inset-subtle);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.protocol-text h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-espresso);
  margin-bottom: 6px;
}

.protocol-text p {
  font-size: 0.8rem;
  color: var(--color-espresso-muted);
  line-height: 1.5;
}

/* Main Studio Layout: Controls on Left, Canvas/Results on Right */
.studio-main-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 36px;
  align-items: flex-start;
  margin-bottom: 80px;
}

.studio-panel {
  padding: 32px;
  border-radius: var(--radius-xl);
  background: var(--color-base);
  box-shadow: var(--shadow-card);
}

.panel-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  color: var(--color-espresso);
  margin-bottom: 6px;
}

.panel-desc {
  font-size: 0.82rem;
  color: var(--color-espresso-muted);
  line-height: 1.5;
  margin-bottom: 24px;
}

/* Coin Reference Selector */
.coin-selector-wrap {
  margin-bottom: 24px;
}

.coin-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.coin-pill-btn {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--color-base);
  box-shadow: var(--shadow-pill);
  color: var(--color-espresso-muted);
  font-size: 0.76rem;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.coin-pill-btn span.coin-diam {
  font-size: 0.68rem;
  font-weight: 400;
  opacity: 0.75;
}

.coin-pill-btn.active {
  box-shadow: var(--shadow-inset);
  background: var(--color-base-dark);
  color: var(--color-espresso);
}

.coin-pill-btn:hover:not(.active) {
  box-shadow: var(--shadow-pill-hover);
  color: var(--color-espresso);
}

/* Upload Dropzone */
.upload-dropzone {
  border: 2px dashed rgba(75, 52, 47, 0.25);
  border-radius: var(--radius-lg);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  background: var(--color-base-dark);
  box-shadow: var(--shadow-inset-subtle);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.upload-dropzone.dragover {
  border-color: var(--color-espresso);
  background: rgba(75, 52, 47, 0.05);
  box-shadow: var(--shadow-inset);
}

.dropzone-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--color-base);
  box-shadow: var(--shadow-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-espresso);
}

.dropzone-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--color-espresso);
  margin-bottom: 4px;
}

.dropzone-sub {
  font-size: 0.76rem;
  color: var(--color-espresso-muted);
}

.demo-sample-row {
  margin-top: 18px;
  text-align: center;
}

.btn-demo-sample {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--color-espresso);
  background: var(--color-base);
  box-shadow: var(--shadow-pill);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-demo-sample:hover {
  box-shadow: var(--shadow-pill-hover);
  transform: translateY(-1px);
}

/* Interactive Canvas Stage */
.canvas-stage-wrapper {
  position: relative;
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  background: #1a1614;
  min-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#measureCanvas {
  max-width: 100%;
  max-height: 580px;
  display: block;
  margin: 0 auto;
  cursor: crosshair;
}

/* AI Scanning HUD */
.scanning-hud-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: none;
  background: rgba(22, 16, 14, 0.4);
  backdrop-filter: blur(2px);
  z-index: 10;
}

.scanning-hud-overlay.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.scan-laser-line {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #22d3ee, #fff, #22d3ee, transparent);
  box-shadow: 0 0 15px #22d3ee, 0 0 30px #22d3ee;
  animation: scanLaser 2s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}

@keyframes scanLaser {
  0% { top: 5%; opacity: 0.4; }
  50% { opacity: 1; }
  100% { top: 95%; opacity: 0.4; }
}

.scan-status-card {
  background: rgba(26, 22, 20, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  padding: 24px 32px;
  border-radius: var(--radius-lg);
  text-align: center;
  max-width: 320px;
}

.scan-status-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: #22d3ee;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.scan-status-text {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}

.scan-status-sub {
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.6);
}

/* Calibrator Tool Bar */
.calibrator-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: var(--color-base-dark);
  border-radius: var(--radius-md);
  margin-top: 14px;
  font-size: 0.8rem;
  box-shadow: var(--shadow-inset-subtle);
}

.toolbar-scale-display {
  font-weight: 700;
  color: var(--color-espresso);
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar-actions {
  display: flex;
  gap: 8px;
}

.tool-action-btn {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--color-base);
  box-shadow: var(--shadow-pill);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--color-espresso);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tool-action-btn:hover {
  box-shadow: var(--shadow-pill-hover);
}

/* Finger Calipers Tuning List */
.calipers-tuning-list {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.caliper-card {
  padding: 14px 10px;
  border-radius: var(--radius-md);
  background: var(--color-base);
  box-shadow: var(--shadow-card-subtle);
  text-align: center;
}

.caliper-finger-name {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-espresso-muted);
  margin-bottom: 4px;
}

.caliper-mm-val {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--color-espresso);
  margin-bottom: 6px;
}

.caliper-nudge-btns {
  display: flex;
  justify-content: center;
  gap: 4px;
}

.btn-nudge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: var(--color-base-dark);
  box-shadow: var(--shadow-pill);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--color-espresso);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-nudge:active {
  box-shadow: var(--shadow-inset-subtle);
}

/* Results Card & Matched Sizing Profile */
.results-card-container {
  margin-top: 32px;
  padding: 32px;
  border-radius: var(--radius-xl);
  background: var(--color-base);
  box-shadow: var(--shadow-card);
  display: none;
}

.results-card-container.active {
  display: block;
  animation: fadeInUp 0.4s ease;
}

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

.results-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.matched-size-badge {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--color-espresso);
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.matched-size-badge span.confidence {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  background: #10b981;
  color: #fff;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.04em;
}

.results-table-wrap {
  margin: 20px 0;
  overflow-x: auto;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.results-table th, .results-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(75, 52, 47, 0.1);
}

.results-table th {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-espresso-muted);
  font-size: 0.72rem;
}

.results-table td.highlight {
  font-weight: 700;
  color: var(--color-espresso);
}

.results-cta-row {
  display: flex;
  gap: 16px;
  margin-top: 24px;
}

.btn-shop-size {
  flex: 1;
  padding: 16px 24px;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-save-profile {
  padding: 16px 24px;
  font-size: 0.86rem;
}

/* Empty State / Initial Stage */
.empty-stage-state {
  text-align: center;
  padding: 60px 20px;
  color: rgba(255, 255, 255, 0.6);
}

.empty-stage-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.8;
}

@media (max-width: 980px) {
  .studio-main-grid {
    grid-template-columns: 1fr;
  }
  .protocol-steps-grid {
    grid-template-columns: 1fr;
  }
  .calipers-tuning-list {
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
  }
  .caliper-card {
    padding: 10px 4px;
  }
  .caliper-mm-val {
    font-size: 1.05rem;
  }
  .results-cta-row {
    flex-direction: column;
  }
}
