:root {
  --vt-primary: #5b4bff;
  --vt-primary-dark: #4338ca;
}

body {
  font-family: "Segoe UI", system-ui, sans-serif;
}

.tour-card {
  transition: transform .15s ease, box-shadow .15s ease;
  border: 0;
  box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, .06);
}

.tour-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, .08);
}

/* Editor */
.editor-body {
  margin: 0;
  overflow: hidden;
  background: #111;
}

.editor-topbar {
  height: 56px;
  background: linear-gradient(90deg, var(--vt-primary), #7c3aed);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
}

.editor-layout {
  display: grid;
  grid-template-columns: 260px 1fr 300px;
  height: calc(100vh - 56px);
}

.editor-sidebar {
  background: #fff;
  overflow-y: auto;
  border-right: 1px solid #e5e7eb;
}

.editor-sidebar-right {
  border-right: 0;
  border-left: 1px solid #e5e7eb;
}

.sidebar-section {
  padding: 1rem;
}

.sidebar-title {
  font-weight: 600;
  margin-bottom: .75rem;
}

.editor-canvas-wrap {
  position: relative;
  background: #0f172a;
}

.panorama-container,
.viewer-panorama {
  width: 100%;
  height: 100%;
}

.editor-toolbar {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: .75rem;
  background: rgba(15, 23, 42, .85);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  padding: .4rem .85rem;
  z-index: 5;
}

.toolbar-hint {
  color: #e2e8f0;
  font-size: .85rem;
}

.editor-alert {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  min-width: 280px;
}

.empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  text-align: center;
  padding: 2rem;
}

.scenes-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.scene-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem;
  border: 1px solid #e5e7eb;
  border-radius: .5rem;
  cursor: pointer;
  background: #fff;
}

.scene-item.active {
  border-color: var(--vt-primary);
  background: #eef2ff;
}

.scene-thumb {
  width: 48px;
  height: 32px;
  object-fit: cover;
  border-radius: .35rem;
  background: #e5e7eb;
}

.icon-picker {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

.icon-option {
  width: 36px;
  height: 36px;
  border: 1px solid #dee2e6;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: #fff;
}

.icon-option.active {
  border-color: var(--vt-primary);
  background: #eef2ff;
  color: var(--vt-primary);
}

/* Hotspot custom styles in Pannellum */
.pnlm-hotspot.custom-hotspot {
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  box-shadow: none !important;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.pnlm-hotspot.custom-hotspot:active {
  cursor: grabbing;
}

body.vt-dragging-hotspot {
  cursor: grabbing !important;
  user-select: none;
}

body.vt-dragging-hotspot .pnlm-container {
  cursor: grabbing !important;
}

body.vt-dragging-hotspot .pnlm-hotspot.custom-hotspot {
  pointer-events: none;
}

.custom-hotspot-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hotspot-icon-only {
  font-size: 36px;
  line-height: 1;
  display: block;
}

.pnlm-hotspot.custom-hotspot .hotspot-label-plain {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  transform: none;
  margin-top: 4px;
  background: transparent !important;
  font-size: 12px;
  font-weight: 600;
  padding: 0;
  border-radius: 0;
  text-align: center;
  display: block;
  width: max-content;
  max-width: 160px;
  white-space: normal;
  line-height: 1.15;
}

.color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}

.color-swatch.active {
  border-color: var(--vt-primary);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--vt-primary);
}

/* Viewer */
.viewer-body {
  margin: 0;
  overflow: hidden;
  background: #000;
}

.viewer-header {
  height: 56px;
  background: rgba(17, 24, 39, .95);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.viewer-scene-select {
  min-width: 180px;
}

.viewer-quality-banner {
  position: absolute;
  top: .75rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  max-width: min(640px, 92vw);
  margin: 0;
  font-size: .85rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .25);
}

.viewer-panorama {
  height: calc(100vh - 56px);
  position: relative;
}

.viewer-loading {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .65);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 20;
  transition: opacity .4s ease;
}

.viewer-loading.d-none {
  opacity: 0;
  pointer-events: none;
}

.info-modal-body {
  text-align: center;
  padding: 0.5rem 1.25rem 1.25rem;
}

.modal-dialog.info-modal-dialog {
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.modal-header.info-modal-header {
  justify-content: center;
  position: relative;
  border-bottom: 0;
  padding-bottom: 0.25rem;
}

.modal-header.info-modal-header .modal-title {
  width: 100%;
  text-align: center;
  font-weight: 600;
  padding: 0 2rem;
}

.modal-header.info-modal-header .btn-close {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
}

.info-modal-media {
  margin-bottom: 0.85rem;
}

.info-modal-img {
  display: block;
  max-width: 100%;
  width: auto !important;
  height: auto !important;
  max-height: min(45vh, 360px);
  margin: 0 auto;
  object-fit: contain;
  border-radius: 0.5rem;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .12);
  image-rendering: auto;
}

.info-modal-text {
  text-align: center;
  max-width: 100%;
  margin: 0 auto;
  line-height: 1.55;
  color: #4b5563;
  font-size: 0.95rem;
}

.info-editor-preview {
  max-height: 160px;
  width: 100%;
  object-fit: contain;
  background: #f8f9fa;
}

/* Transición suave del visor Pannellum */
.pnlm-container {
  background: #0f172a !important;
}

.pnlm-load-box {
  display: none !important;
}

@media (max-width: 992px) {
  .editor-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    height: auto;
    min-height: calc(100vh - 56px);
  }

  .editor-sidebar-left,
  .editor-sidebar-right {
    max-height: 240px;
  }

  .editor-canvas-wrap {
    min-height: 55vh;
  }
}
