/* Scene Editor overlay — Phase 5 Session 5a */

/* ── Placement mode hint pill ──────────────────────────────────── */
/* Appended to #scene-editor-overlay during click-to-place; removed on exit */

.se-placement-hint {
  position: absolute;
  top: 46%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  background: rgba(0, 10, 18, 0.88);
  border: 1px solid rgba(0, 255, 255, 0.45);
  border-radius: 6px;
  padding: 9px 22px;
  color: #00ffff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 0 24px rgba(0, 255, 255, 0.12);
}

.se-placement-hint .se-hint-esc {
  color: rgba(0, 200, 200, 0.55);
  font-weight: 400;
  letter-spacing: 0.04em;
}

/* ── Overlay container ─────────────────────────────────────────── */

#scene-editor-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 600;
  pointer-events: none; /* Cesium camera controls pass through center */
}

body[data-playback-mode="editor"] #scene-editor-overlay {
  display: flex;
  flex-direction: column;
}

/* ── Top bar ─────────────────────────────────────────────────────── */

.se-top-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: rgba(10, 14, 20, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  pointer-events: auto;
  flex-shrink: 0;
}

.se-top-bar .se-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #e0e8f0;
  text-transform: uppercase;
  flex: 1 1 0;
}

.se-top-bar .se-scene-name {
  font-size: 11px;
  color: #7a9ab0;
  letter-spacing: 0.06em;
  flex: 2 1 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.se-top-bar .se-dirty-badge {
  display: none;
  font-size: 10px;
  color: #ff8040;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 6px;
  border: 1px solid rgba(255, 128, 64, 0.4);
  border-radius: 3px;
}

.se-top-bar.is-dirty .se-dirty-badge {
  display: inline-block;
}

.se-btn {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: #c0ccd8;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.se-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
  color: #e8f0f8;
}

.se-btn.se-btn-primary {
  background: rgba(0, 180, 80, 0.18);
  border-color: rgba(0, 200, 80, 0.45);
  color: #60e890;
}

.se-btn.se-btn-primary:hover {
  background: rgba(0, 200, 80, 0.28);
  border-color: rgba(0, 220, 100, 0.65);
}

.se-btn.se-btn-danger {
  background: rgba(200, 40, 40, 0.15);
  border-color: rgba(220, 60, 60, 0.4);
  color: #f08080;
}

.se-btn.se-btn-danger:hover {
  background: rgba(220, 60, 60, 0.25);
}

.se-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Main area: globe region + right panel ──────────────────────── */

.se-main {
  display: flex;
  flex: 1 1 0;
  overflow: hidden;
  pointer-events: none;
}

.se-globe-region {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  pointer-events: none;
}

/* ── Playback controls (above bottom bar, inside globe region) ──── */

.se-playback-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  margin-bottom: 6px;
  background: rgba(10, 14, 20, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  pointer-events: auto;
}

.se-playback-controls .se-time-display {
  font-size: 11px;
  font-family: var(--font-mono);
  color: #a0c8e8;
  letter-spacing: 0.06em;
  min-width: 180px;
}

.se-playback-controls .se-play-btn {
  font-size: 14px;
  background: none;
  border: none;
  color: #c0d8f0;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.se-playback-controls .se-play-btn:hover {
  color: #ffffff;
}

.se-add-card-btn {
  background: rgba(30, 100, 200, 0.2);
  border-color: rgba(60, 140, 255, 0.4);
  color: #80b8ff;
}

.se-add-card-btn:hover {
  background: rgba(40, 120, 220, 0.32);
  border-color: rgba(80, 160, 255, 0.6);
}

/* ── Timeline scrubber (bottom bar) ─────────────────────────────── */

.se-bottom-bar {
  pointer-events: auto;
  background: rgba(10, 14, 20, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding: 8px 14px 10px;
  flex-shrink: 0;
}

.se-timeline {
  position: relative;
  width: 100%;
  height: 28px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  cursor: pointer;
  overflow: visible;
}

.se-timeline-track {
  position: absolute;
  inset: 0;
  border-radius: 4px;
}

.se-timeline-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: rgba(0, 140, 255, 0.18);
  border-radius: 4px 0 0 4px;
  pointer-events: none;
  transition: width 0.1s linear;
}

.se-playhead {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  background: #00aaff;
  border-radius: 1px;
  pointer-events: none;
  transform: translateX(-50%);
  box-shadow: 0 0 6px rgba(0, 170, 255, 0.6);
}

/* Card markers on timeline */
.se-card-marker {
  position: absolute;
  top: 2px;
  bottom: 2px;
  width: 3px;
  background: #ffaa00;
  border-radius: 1px;
  transform: translateX(-50%);
  cursor: pointer;
  pointer-events: auto;
}

.se-card-marker:hover {
  background: #ffd060;
  box-shadow: 0 0 6px rgba(255, 200, 0, 0.7);
}

.se-card-marker.selected {
  background: #ff6060;
  box-shadow: 0 0 8px rgba(255, 80, 80, 0.8);
}

.se-timeline-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 9px;
  color: rgba(160, 180, 200, 0.5);
  letter-spacing: 0.04em;
  pointer-events: none;
}

/* ── Right panel ─────────────────────────────────────────────────── */

.se-right-panel {
  width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: rgba(10, 14, 20, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  pointer-events: auto;
}

.se-panel-header {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7a9ab0;
  padding: 8px 12px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

/* Card list */
.se-card-list {
  flex: 0 0 auto;
  max-height: 40%;
  overflow-y: auto;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.se-card-list-empty {
  font-size: 10px;
  color: rgba(160, 180, 200, 0.35);
  padding: 10px 12px;
  font-style: italic;
}

.se-card-list-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.1s;
}

.se-card-list-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.se-card-list-row.selected {
  background: rgba(0, 140, 255, 0.12);
  border-left: 2px solid #00aaff;
  padding-left: 10px;
}

.se-card-list-row .se-row-time {
  font-size: 9px;
  font-family: var(--font-mono);
  color: #ffaa00;
  flex-shrink: 0;
  min-width: 48px;
}

.se-card-list-row .se-row-title {
  font-size: 10px;
  color: #c0ccd8;
  flex: 1 1 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.se-card-list-row .se-row-del {
  font-size: 13px;
  color: rgba(200, 80, 80, 0.5);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.1s;
}

.se-card-list-row:hover .se-row-del {
  opacity: 1;
}

.se-card-list-row .se-row-del:hover {
  color: #ff6060;
}

/* Card editor form */
.se-card-editor {
  flex: 1 1 0;
  overflow-y: auto;
  padding: 10px 12px;
}

.se-card-editor-empty {
  font-size: 10px;
  color: rgba(160, 180, 200, 0.35);
  padding: 10px 0;
  font-style: italic;
}

.se-field {
  margin-bottom: 10px;
}

.se-label {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #7a9ab0;
  margin-bottom: 4px;
}

.se-input,
.se-select,
.se-textarea {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  color: #d0dce8;
  font-size: 11px;
  padding: 5px 8px;
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
}

.se-input:focus,
.se-select:focus,
.se-textarea:focus {
  border-color: rgba(0, 150, 255, 0.45);
  background: rgba(255, 255, 255, 0.07);
}

.se-textarea {
  resize: vertical;
  min-height: 60px;
}

.se-select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%237a9ab0'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 24px;
}

.se-select option {
  background: #0e1420;
  color: #d0dce8;
}

/* ── AI Generate button ──────────────────────────────────────────── */

.se-btn-generate {
  display: block;
  width: 100%;
  margin-bottom: 8px;
  background: rgba(160, 80, 255, 0.14);
  border-color: rgba(180, 100, 255, 0.4);
  color: #c89cff;
  font-size: 11px;
  text-align: center;
}

.se-btn-generate:hover:not(:disabled) {
  background: rgba(180, 100, 255, 0.24);
  border-color: rgba(200, 120, 255, 0.6);
  color: #dbb8ff;
}

.se-btn-generate:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.se-generate-status {
  font-size: 10px;
  color: #a0b8d0;
  min-height: 14px;
  margin-bottom: 6px;
  letter-spacing: 0.04em;
  padding: 0 2px;
}

.se-generate-status.se-generate-error {
  color: #ff8080;
}

/* ── Review dialog ───────────────────────────────────────────────── */

.se-review-dialog {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  background: rgba(0, 0, 0, 0.55);
  z-index: 10;
  pointer-events: auto;
}

.se-review-panel {
  width: 300px;
  max-height: 85%;
  display: flex;
  flex-direction: column;
  background: rgba(12, 18, 28, 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(160, 100, 255, 0.3);
  border-radius: 6px 0 0 6px;
  overflow: hidden;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.6);
}

.se-review-header {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #c89cff;
  padding: 10px 14px 8px;
  border-bottom: 1px solid rgba(160, 100, 255, 0.2);
  flex-shrink: 0;
}

.se-review-body {
  flex: 1 1 0;
  overflow-y: auto;
  padding: 8px 14px;
}

.se-review-field {
  margin-bottom: 9px;
}

.se-review-field label {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #7a9ab0;
  margin-bottom: 2px;
}

.se-review-field .se-review-value {
  font-size: 11px;
  color: #d0dce8;
  line-height: 1.45;
  word-break: break-word;
}

.se-review-actions {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
}

.se-review-actions .se-btn {
  flex: 1 1 0;
  text-align: center;
}

.se-review-body::-webkit-scrollbar { width: 4px; }
.se-review-body::-webkit-scrollbar-track { background: transparent; }
.se-review-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* ── Scrollbar styling ─────────────────────────────────────────── */

.se-card-list::-webkit-scrollbar,
.se-card-editor::-webkit-scrollbar {
  width: 4px;
}

.se-card-list::-webkit-scrollbar-track,
.se-card-editor::-webkit-scrollbar-track {
  background: transparent;
}

.se-card-list::-webkit-scrollbar-thumb,
.se-card-editor::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}
