/* ═══════════════════════════════════════════════════════════
   DOOH SPATIAL VISUALIZER — Zero-Edit Cinematic CSS
   ═══════════════════════════════════════════════════════════ */

/* ── Hero ── */
.dooh-hero {
  text-align: center;
  padding: 100px 24px 60px;
  background: radial-gradient(ellipse at 50% 30%, rgba(0,200,255,.06) 0%, transparent 70%);
  position: relative;
}
.dooh-hero h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 12px;
}
.dooh-hero h1 .ai-badge {
  display: inline-block;
  background: linear-gradient(135deg, #00c6ff, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.dooh-hero p {
  color: var(--text-secondary, #888);
  max-width: 620px;
  margin: 0 auto 28px;
  font-size: 1.05rem;
  line-height: 1.6;
}
.dooh-hero .tech-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.dooh-hero .tech-chips span {
  font-size: .72rem;
  padding: 4px 12px;
  border-radius: 50px;
  background: var(--card-bg, rgba(255,255,255,.06));
  border: 1px solid var(--border, rgba(255,255,255,.1));
  color: var(--text-secondary, #aaa);
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
}

/* ── Main Container ── */
.dooh-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ── Upload Section ── */
.dooh-upload-section {
  margin-bottom: 40px;
}
.dooh-upload-zone {
  border: 2px dashed var(--border, rgba(255,255,255,.15));
  border-radius: 20px;
  padding: 60px 30px;
  text-align: center;
  cursor: pointer;
  transition: all .3s ease;
  background: var(--card-bg, rgba(255,255,255,.03));
  position: relative;
  overflow: hidden;
}
.dooh-upload-zone:hover,
.dooh-upload-zone.drag-over {
  border-color: #00c6ff;
  background: rgba(0,198,255,.04);
  box-shadow: 0 0 30px rgba(0,198,255,.08);
}
.dooh-upload-zone .upload-icon {
  font-size: 2.2rem;
  margin-bottom: 12px;
  color: #00c6ff;
}
.dooh-upload-zone h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.dooh-upload-zone p {
  color: var(--text-secondary, #888);
  font-size: .88rem;
}
.dooh-upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* ── Preview uploaded photo ── */
.dooh-photo-preview {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #111;
  margin-bottom: 20px;
  display: none;
}
.dooh-photo-preview img {
  width: 100%;
  display: block;
}
.dooh-photo-preview .preview-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.55);
  opacity: 0;
  transition: opacity .3s;
}
.dooh-photo-preview:hover .preview-overlay {
  opacity: 1;
}
.dooh-photo-preview .change-photo-btn {
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  padding: 10px 22px;
  border-radius: 50px;
  cursor: pointer;
  font-weight: 600;
  font-size: .85rem;
}

/* ── AI Processing Pipeline Status ── */
.dooh-pipeline {
  display: none;
  margin-bottom: 30px;
}
.dooh-pipeline.active {
  display: block;
}
.pipeline-steps {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.pipeline-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--card-bg, rgba(255,255,255,.04));
  border: 1px solid var(--border, rgba(255,255,255,.08));
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-secondary, #888);
  transition: all .4s;
  flex: 1;
  min-width: 150px;
}
.pipeline-step .step-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.06);
  font-size: .72rem;
  flex-shrink: 0;
}
.pipeline-step.processing {
  border-color: #00c6ff;
  color: #00c6ff;
}
.pipeline-step.processing .step-icon {
  background: rgba(0,198,255,.15);
  animation: pulse-glow 1.2s infinite;
}
.pipeline-step.done {
  border-color: #22c55e;
  color: #22c55e;
}
.pipeline-step.done .step-icon {
  background: rgba(34,197,94,.15);
}
.pipeline-step.error {
  border-color: #ef4444;
  color: #ef4444;
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,198,255,.3); }
  50% { box-shadow: 0 0 10px 4px rgba(0,198,255,.15); }
}
.pipeline-log {
  background: rgba(0,0,0,.25);
  border-radius: 10px;
  padding: 12px 16px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: .75rem;
  color: var(--text-secondary, #888);
  max-height: 120px;
  overflow-y: auto;
  line-height: 1.7;
}
.pipeline-log .log-line {
  display: block;
}
.pipeline-log .log-line::before {
  content: "›  ";
  color: #00c6ff;
}
.pipeline-log .log-line.error::before {
  content: "✗  ";
  color: #ef4444;
}
.pipeline-log .log-line.success::before {
  content: "✓  ";
  color: #22c55e;
}

/* ── LED Content Upload ── */
.dooh-led-section {
  display: none;
  margin-bottom: 30px;
}
.dooh-led-section.active {
  display: block;
}
.dooh-led-upload {
  border: 2px dashed var(--border, rgba(255,255,255,.12));
  border-radius: 14px;
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  transition: all .3s;
  background: var(--card-bg, rgba(255,255,255,.03));
  position: relative;
}
.dooh-led-upload:hover {
  border-color: #7c3aed;
  background: rgba(124,58,237,.04);
}
.dooh-led-upload input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.dooh-led-upload .upload-icon {
  font-size: 1.6rem;
  margin-bottom: 8px;
  color: #7c3aed;
}
.dooh-led-upload h4 {
  font-size: .95rem;
  margin-bottom: 4px;
}
.dooh-led-upload p {
  font-size: .78rem;
  color: var(--text-secondary, #888);
}

/* ── Options Panel ── */
.dooh-options {
  display: none;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.dooh-options.active {
  display: flex;
}
.dooh-option-group {
  flex: 1;
  min-width: 180px;
  background: var(--card-bg, rgba(255,255,255,.04));
  border: 1px solid var(--border, rgba(255,255,255,.08));
  border-radius: 14px;
  padding: 16px;
}
.dooh-option-group label {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text-secondary, #888);
  margin-bottom: 8px;
}
.dooh-option-group select,
.dooh-option-group input[type="range"] {
  width: 100%;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text-primary, #fff);
  font-size: .85rem;
  outline: none;
}
.dooh-option-group select:focus {
  border-color: #00c6ff;
}
.dooh-option-group input[type="range"] {
  -webkit-appearance: none;
  height: 4px;
  border-radius: 4px;
  background: rgba(255,255,255,.12);
  border: none;
  padding: 0;
  margin-top: 4px;
}
.dooh-option-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #00c6ff;
  cursor: pointer;
}
.dooh-option-value {
  text-align: center;
  font-size: .78rem;
  color: var(--text-secondary, #aaa);
  margin-top: 4px;
}

/* ── Three.js Canvas Container ── */
.dooh-canvas-wrap {
  display: none;
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #0a0a0e;
  min-height: 200px;
  margin-bottom: 24px;
  box-shadow: 0 8px 40px rgba(0,0,0,.3);
}
.dooh-canvas-wrap.active {
  display: block;
}
.dooh-canvas-wrap canvas {
  width: 100%;
  height: auto;
  display: block;
}
.dooh-canvas-label {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(8px);
  padding: 6px 14px;
  border-radius: 50px;
  font-size: .7rem;
  font-weight: 700;
  color: #00c6ff;
  letter-spacing: .5px;
  text-transform: uppercase;
  pointer-events: none;
  z-index: 5;
}

/* ── Wall corner overlay (for manual adjust) ── */
.dooh-corner-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: none;
  cursor: crosshair;
}
.dooh-corner-overlay.active {
  display: block;
}
.dooh-corner-dot {
  position: absolute;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  margin-top: -7px;
  background: #00c6ff;
  border: 2px solid #fff;
  border-radius: 50%;
  cursor: grab;
  z-index: 11;
  box-shadow: 0 0 12px rgba(0,198,255,.5);
  transition: transform .15s;
}
.dooh-corner-dot:hover {
  transform: scale(1.3);
}
.dooh-corner-dot:active {
  cursor: grabbing;
}

/* ── Action Buttons ── */
.dooh-actions {
  display: none;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}
.dooh-actions.active {
  display: flex;
}
.dooh-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 700;
  font-size: .88rem;
  cursor: pointer;
  border: none;
  transition: all .25s;
}
.dooh-btn-primary {
  background: linear-gradient(135deg, #00c6ff, #0072ff);
  color: #fff;
  box-shadow: 0 4px 20px rgba(0,114,255,.25);
}
.dooh-btn-primary:hover {
  box-shadow: 0 6px 30px rgba(0,114,255,.35);
  transform: translateY(-1px);
}
.dooh-btn-secondary {
  background: var(--card-bg, rgba(255,255,255,.06));
  border: 1px solid var(--border, rgba(255,255,255,.12));
  color: var(--text-primary, #fff);
}
.dooh-btn-secondary:hover {
  background: rgba(255,255,255,.1);
}
.dooh-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none !important;
}
.dooh-btn-success {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
}

/* ── Detected Surfaces Panel ── */
.dooh-surfaces {
  display: none;
  margin-bottom: 24px;
}
.dooh-surfaces.active {
  display: block;
}
.dooh-surfaces h3 {
  font-size: .95rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.surface-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.surface-card {
  border: 1px solid var(--border, rgba(255,255,255,.1));
  border-radius: 12px;
  padding: 12px;
  background: var(--card-bg, rgba(255,255,255,.04));
  cursor: pointer;
  transition: all .25s;
  text-align: center;
}
.surface-card:hover,
.surface-card.selected {
  border-color: #00c6ff;
  box-shadow: 0 0 16px rgba(0,198,255,.12);
}
.surface-card .surface-thumb {
  width: 100%;
  aspect-ratio: 16/10;
  border-radius: 8px;
  background: rgba(0,0,0,.3);
  margin-bottom: 8px;
  overflow: hidden;
  position: relative;
}
.surface-card .surface-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.surface-card .surface-label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-secondary, #aaa);
}
.surface-card .surface-conf {
  font-size: .68rem;
  color: var(--text-tertiary, #666);
  margin-top: 2px;
}

/* ── Download Progress ── */
.dooh-progress {
  display: none;
  margin-bottom: 20px;
}
.dooh-progress.active {
  display: block;
}
.dooh-progress-bar {
  height: 4px;
  border-radius: 4px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
}
.dooh-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #00c6ff, #7c3aed);
  border-radius: 4px;
  transition: width .3s;
}
.dooh-progress-label {
  font-size: .78rem;
  color: var(--text-secondary, #888);
  margin-top: 6px;
  text-align: center;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .dooh-hero { padding: 80px 16px 40px; }
  .dooh-container { padding: 0 16px 60px; }
  .dooh-upload-zone { padding: 40px 16px; }
  .pipeline-steps { flex-direction: column; }
  .pipeline-step { min-width: unset; }
  .dooh-option-group { min-width: unset; }
  .dooh-actions { flex-direction: column; }
  .dooh-btn { justify-content: center; }
}

/* ── Dark/Light compat ── */
[data-theme="light"] .dooh-upload-zone {
  border-color: rgba(0,0,0,.15);
  background: rgba(0,0,0,.02);
}
[data-theme="light"] .dooh-upload-zone:hover {
  background: rgba(0,198,255,.04);
}
[data-theme="light"] .pipeline-log {
  background: rgba(0,0,0,.04);
}
[data-theme="light"] .dooh-canvas-wrap {
  background: #f0f0f4;
}
