/* ═══════════════════════════════════════════════════════════════
   VESTA Turkey - Virtual Tour Styles
   Full VR-Ready Property Walkthrough
═══════════════════════════════════════════════════════════════ */

/* ── Tour Container ── */
.tour-container {
  position: relative;
  width: 100%;
  height: 70vh;
  min-height: 500px;
  background: var(--ink);
  overflow: hidden;
  border-radius: 4px;
  cursor: grab;
}

.tour-container:active {
  cursor: grabbing;
}

#tour-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

/* ── Loading Screen ── */
.tour-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(7, 7, 10, 0.95);
  z-index: 100;
  gap: 20px;
}

.tour-loading-spinner {
  width: 48px;
  height: 48px;
  border: 2px solid rgba(201, 168, 76, 0.1);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: tour-spin 1s linear infinite;
}

@keyframes tour-spin {
  to { transform: rotate(360deg); }
}

.tour-loading-text {
  font-size: .72rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ── Controls Bar ── */
.tour-controls {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  background: rgba(7, 7, 10, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 10px 16px;
  border-radius: 40px;
  border: 1px solid var(--border);
  z-index: 50;
}

.tour-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  transition: all .3s;
  color: rgba(240, 235, 224, 0.6);
}

.tour-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.tour-btn:hover {
  color: var(--gold);
  border-color: var(--border);
}

.tour-btn.active {
  background: rgba(201, 168, 76, 0.15);
  color: var(--gold);
}

.tour-btn-vr {
  width: auto;
  padding: 0 14px;
  gap: 6px;
  font-size: .6rem;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.tour-btn-vr.supported {
  color: var(--gold);
  border-color: rgba(201, 168, 76, 0.3);
}

.tour-btn-vr.unsupported {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Compass ── */
.tour-compass {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  background: rgba(7, 7, 10, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.tour-compass::before {
  content: 'N';
  position: absolute;
  top: 6px;
  font-size: .5rem;
  letter-spacing: .1em;
  color: var(--gold);
}

.tour-compass::after {
  content: 'S';
  position: absolute;
  bottom: 6px;
  font-size: .5rem;
  letter-spacing: .1em;
  color: rgba(240, 235, 224, 0.3);
}

.tour-compass-needle {
  width: 2px;
  height: 28px;
  background: linear-gradient(to bottom, var(--gold) 50%, rgba(240, 235, 224, 0.2) 50%);
  border-radius: 1px;
  transform-origin: center center;
  transition: transform .1s ease-out;
}

/* ── Info Panel ── */
.tour-info-panel {
  position: absolute;
  top: 24px;
  left: 24px;
  background: rgba(7, 7, 10, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  padding: 16px 20px;
  border-radius: 4px;
  z-index: 50;
}

.tour-room-name {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 300;
  color: var(--gold);
  margin-bottom: 4px;
}

.tour-room-desc {
  font-size: .72rem;
  color: rgba(240, 235, 224, 0.5);
  max-width: 200px;
}

/* ── Room Selector ── */
.tour-room-selector {
  position: absolute;
  left: 24px;
  bottom: 100px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 50;
}

.tour-room-thumb {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  background: rgba(7, 7, 10, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition: all .3s;
  overflow: hidden;
  width: 180px;
}

.tour-room-thumb:hover {
  border-color: var(--border-hover);
  background: rgba(201, 168, 76, 0.05);
}

.tour-room-thumb.active {
  border-color: var(--gold);
  background: rgba(201, 168, 76, 0.1);
}

.tour-room-thumb img {
  width: 50px;
  height: 34px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
}

.tour-room-thumb span {
  font-size: .65rem;
  letter-spacing: .1em;
  color: rgba(240, 235, 224, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tour-room-thumb.active span {
  color: var(--gold);
}

/* ── Hotspots ── */
.tour-hotspots {
  position: absolute;
  inset: 0;
  z-index: 30;
  pointer-events: none;
}

.tour-hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: pointer;
  transition: opacity .3s, transform .3s;
}

.tour-hotspot.nav {
  width: 44px;
  height: 44px;
}

.tour-hotspot.info {
  width: 32px;
  height: 32px;
}

.hotspot-icon {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(201, 168, 76, 0.9);
  border-radius: 50%;
  font-size: 1rem;
  color: var(--ink);
  animation: hotspot-pulse 2s ease infinite;
  transition: transform .3s, background .3s;
}

.tour-hotspot:hover .hotspot-icon {
  transform: scale(1.15);
  background: var(--gold-light);
}

@keyframes hotspot-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201, 168, 76, 0.4); }
  50% { box-shadow: 0 0 0 12px rgba(201, 168, 76, 0); }
}

.hotspot-label {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: .58rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(7, 7, 10, 0.9);
  padding: 4px 10px;
  border-radius: 2px;
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
}

.tour-hotspot:hover .hotspot-label {
  opacity: 1;
}

/* ── Measurement Panel ── */
.tour-measure-panel {
  position: absolute;
  top: 24px;
  right: 100px;
  width: 220px;
  background: rgba(7, 7, 10, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 4px;
  z-index: 50;
  overflow: hidden;
}

.measure-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: .65rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold);
}

.measure-close {
  background: none;
  border: none;
  color: rgba(240, 235, 224, 0.4);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  transition: color .3s;
}

.measure-close:hover {
  color: var(--cream);
}

.measure-list {
  padding: 12px 16px;
  max-height: 200px;
  overflow-y: auto;
}

.measure-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(201, 168, 76, 0.05);
}

.measure-item:last-child {
  border-bottom: none;
}

.measure-name {
  font-size: .68rem;
  color: rgba(240, 235, 224, 0.6);
}

.measure-value {
  font-family: var(--serif);
  font-size: .82rem;
  color: var(--gold);
}

.measure-btn {
  display: block;
  width: calc(100% - 32px);
  margin: 0 16px 16px;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--gold);
  font-family: var(--sans);
  font-size: .6rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all .3s;
}

.measure-btn:hover {
  background: rgba(201, 168, 76, 0.1);
  border-color: var(--gold);
}

/* ── Popup ── */
.tour-popup {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7, 7, 10, 0.8);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s;
}

.tour-popup.show {
  opacity: 1;
  pointer-events: auto;
}

.popup-content {
  position: relative;
  max-width: 480px;
  background: var(--ink-soft);
  border: 1px solid var(--border);
  padding: 32px;
  border-radius: 4px;
  transform: translateY(20px);
  transition: transform .4s;
}

.tour-popup.show .popup-content {
  transform: translateY(0);
}

.popup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: rgba(240, 235, 224, 0.5);
  cursor: pointer;
  transition: all .3s;
}

.popup-close:hover {
  color: var(--cream);
  border-color: var(--cream);
}

.popup-content img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  margin-bottom: 20px;
  border-radius: 2px;
}

.popup-content h3 {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--gold);
  margin-bottom: 12px;
}

.popup-content p {
  font-size: .85rem;
  line-height: 1.8;
  color: rgba(240, 235, 224, 0.6);
  margin-bottom: 16px;
}

.popup-details {
  font-size: .78rem;
  color: rgba(240, 235, 224, 0.4);
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ── Tour Gallery View ── */
.tour-gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.tour-gallery-item {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: 4px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all .3s;
}

.tour-gallery-item:hover {
  border-color: var(--gold);
}

.tour-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s;
}

.tour-gallery-item:hover img {
  transform: scale(1.05);
}

.tour-gallery-item .gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(7, 7, 10, 0.8), transparent);
  display: flex;
  align-items: flex-end;
  padding: 12px;
}

.tour-gallery-item .gallery-name {
  font-size: .65rem;
  letter-spacing: .1em;
  color: var(--cream);
}

/* ── VR Mode Styles ── */
.vr-active .tour-controls,
.vr-active .tour-compass,
.vr-active .tour-info-panel,
.vr-active .tour-room-selector,
.vr-active .tour-measure-panel {
  opacity: 0;
  pointer-events: none;
  transition: opacity .5s;
}

.vr-active:hover .tour-controls,
.vr-active:hover .tour-compass,
.vr-active:hover .tour-info-panel,
.vr-active:hover .tour-room-selector,
.vr-active:hover .tour-measure-panel {
  opacity: 1;
  pointer-events: auto;
}

/* ── Instructions Overlay ── */
.tour-instructions {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(7, 7, 10, 0.7);
  z-index: 80;
  opacity: 1;
  transition: opacity .5s;
  pointer-events: none;
}

.tour-instructions.hidden {
  opacity: 0;
}

.tour-instructions svg {
  width: 64px;
  height: 64px;
  stroke: var(--gold);
  fill: none;
  stroke-width: 1;
  margin-bottom: 20px;
  animation: drag-hint 2s ease infinite;
}

@keyframes drag-hint {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-20px); }
  75% { transform: translateX(20px); }
}

.tour-instructions p {
  font-size: .72rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: rgba(240, 235, 224, 0.6);
}

/* ── Responsive ── */
@media(max-width: 768px) {
  .tour-container {
    height: 50vh;
    min-height: 350px;
  }
  
  .tour-controls {
    bottom: 16px;
    padding: 8px 12px;
    gap: 4px;
  }
  
  .tour-btn {
    width: 36px;
    height: 36px;
  }
  
  .tour-btn svg {
    width: 16px;
    height: 16px;
  }
  
  .tour-compass {
    width: 44px;
    height: 44px;
    top: 12px;
    right: 12px;
  }
  
  .tour-compass-needle {
    height: 20px;
  }
  
  .tour-info-panel {
    top: 12px;
    left: 12px;
    padding: 12px;
  }
  
  .tour-room-name {
    font-size: .9rem;
  }
  
  .tour-room-selector {
    left: 12px;
    bottom: 80px;
    gap: 6px;
  }
  
  .tour-room-thumb {
    width: 140px;
  }
  
  .tour-room-thumb img {
    width: 40px;
    height: 28px;
  }
  
  .tour-measure-panel {
    top: auto;
    right: 12px;
    bottom: 80px;
    width: 180px;
  }
  
  .tour-gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}
