:root {
  --bg-primary: #0a0b10;
  --panel-bg: rgba(16, 20, 32, 0.78);
  --panel-border: rgba(255, 255, 255, 0.12);
  --accent-cyan: #00f0ff;
  --accent-purple: #9d4edd;
  --accent-blue: #0077ff;
  --text-main: #f0f4fc;
  --text-muted: #8b9bb4;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-primary);
  font-family: var(--font-stack);
  color: var(--text-main);
  user-select: none;
}

#viewer-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  cursor: grab;
}

#viewer-container:active {
  cursor: grabbing;
}

/* Glassmorphism styling */
.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--panel-border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  border-radius: var(--radius-lg);
}

/* Header HUD */
.hud-header {
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 10;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pulse-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--accent-cyan);
  box-shadow: 0 0 12px var(--accent-cyan);
  animation: pulse 2s infinite;
}

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

.logo-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1.5px;
}

.highlight {
  color: var(--accent-cyan);
}

.badge {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  background: rgba(0, 240, 255, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 240, 255, 0.3);
  letter-spacing: 0.5px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.current-scene-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.25);
  padding: 6px 14px;
  border-radius: var(--radius-md);
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.glass-select {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  padding: 8px 16px;
  font-size: 13px;
  outline: none;
  cursor: pointer;
  transition: all 0.2s;
}

.glass-select:focus {
  border-color: var(--accent-cyan);
}

.glass-select option {
  background: #101420;
  color: #fff;
}

.glass-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.glass-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.glass-btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, #00d2ff, #0077ff);
  color: #fff;
  border: none;
  box-shadow: 0 4px 15px rgba(0, 119, 255, 0.4);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #26dcff, #1a88ff);
  box-shadow: 0 6px 20px rgba(0, 119, 255, 0.6);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
}

.w-full {
  width: 100%;
  justify-content: center;
}

/* Sidebar Panel */
#side-panel {
  position: absolute;
  top: 95px;
  right: 20px;
  width: 360px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding: 22px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 22px;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s;
}

#side-panel.hidden {
  transform: translateX(400px);
  opacity: 0;
  pointer-events: none;
}

/* Scrollbar */
#side-panel::-webkit-scrollbar {
  width: 6px;
}
#side-panel::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.panel-section {
  display: flex;
  flex-direction: column;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.section-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(0, 240, 255, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 240, 255, 0.25);
  margin-bottom: 8px;
  width: fit-content;
}

.panel-section h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #fff;
}

.section-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.45;
}

/* Form Styles */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.form-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.required-star {
  color: #f43f5e;
}

.glass-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  padding: 10px 14px;
  font-size: 13px;
  outline: none;
  transition: all 0.2s ease;
  font-family: inherit;
}

.glass-input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.glass-input:focus {
  border-color: var(--accent-cyan);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.25);
}

/* Dropzone */
.dropzone {
  width: 100%;
  min-height: 130px;
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  overflow: hidden;
  position: relative;
  background: rgba(0, 0, 0, 0.25);
  margin-bottom: 14px;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.06);
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  color: var(--text-muted);
  padding: 14px;
}

.dropzone-content p {
  font-size: 13px;
  color: var(--text-main);
}

.drop-hint {
  font-size: 10px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.preview-container {
  width: 100%;
  position: relative;
}

.preview-img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: var(--radius-md);
  display: block;
}

.remove-img-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.remove-img-btn:hover {
  background: #f43f5e;
  border-color: #f43f5e;
}

/* Request Feedback Alert */
.request-feedback {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  line-height: 1.45;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.request-feedback.success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #a7f3d0;
}

.request-feedback.error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

/* Direct Contact Buttons */
.direct-contact-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 14px 0 10px 0;
}

.direct-contact-divider::before,
.direct-contact-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.direct-contact-divider span {
  padding: 0 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}

.social-contact-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.instagram-btn {
  background: linear-gradient(135deg, rgba(225, 48, 108, 0.2), rgba(131, 58, 180, 0.2));
  border-color: rgba(225, 48, 108, 0.4);
  color: #fda4af;
}

.instagram-btn:hover {
  background: linear-gradient(135deg, rgba(225, 48, 108, 0.35), rgba(131, 58, 180, 0.35));
  border-color: #e1306c;
  color: #fff;
  transform: translateY(-1px);
}

/* Scene Chips */
.chip-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sample-chip {
  font-size: 11px;
  padding: 6px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--panel-border);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s;
}

.sample-chip:hover {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--accent-cyan);
}

.sample-chip.active {
  background: var(--accent-cyan);
  color: #000;
  font-weight: 700;
  border-color: var(--accent-cyan);
}

/* Controls */
.control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 12px;
}

.control-row label {
  color: var(--text-muted);
}

.control-row input[type="range"] {
  width: 140px;
  accent-color: var(--accent-cyan);
}

/* Bottom HUD Navigation Hints */
.hud-controls {
  position: absolute;
  bottom: 20px;
  left: 20px;
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  z-index: 10;
}

.hud-pill {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

kbd {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  font-size: 10px;
  font-family: inherit;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.4);
}

/* Loading Overlay */
.scene-loader {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 11, 16, 0.85);
  backdrop-filter: blur(10px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-card {
  padding: 32px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner.large {
  width: 44px;
  height: 44px;
  border-width: 3px;
  border-top-color: var(--accent-cyan);
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
  .hud-header {
    top: 10px;
    left: 10px;
    right: 10px;
    height: 52px;
    padding: 0 12px;
  }
  .badge { display: none; }
  .current-scene-badge { max-width: 120px; }
  #side-panel {
    top: 70px;
    right: 10px;
    left: 10px;
    width: auto;
    max-height: calc(100vh - 85px);
  }
  .hud-controls {
    bottom: 10px;
    left: 10px;
    right: 10px;
    flex-wrap: wrap;
    font-size: 11px;
    padding: 8px 12px;
  }
}
