/* ==========================================================================
   ZTL 360° Virtual Tour Styling
   ========================================================================== */

:root {
  --ztl-blue: #0090d7;
  --ztl-blue-hover: #007bb8;
  --ztl-blue-light: #38bdf8;
  --ztl-blue-glow: rgba(0, 144, 215, 0.4);
}

.ztl-tour-wrapper {
  position: relative;
  width: 100%;
  margin: 1.5rem 0;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.08);
  background-color: #0f172a;
  font-family: inherit;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

html.dark .ztl-tour-wrapper {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5), 0 0 15px 1px rgba(0, 144, 215, 0.08);
}

/* Header bar above the viewer */
.ztl-tour-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  z-index: 10;
  position: relative;
}

.ztl-tour-header-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.ztl-tour-header-title svg {
  color: var(--ztl-blue);
}

.ztl-tour-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 9999px;
  background: rgba(0, 144, 215, 0.15);
  color: var(--ztl-blue-light);
  border: 1px solid rgba(0, 144, 215, 0.35);
}

.ztl-tour-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ztl-tour-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.5rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  line-height: 1;
}

.ztl-tour-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

.ztl-tour-btn-primary {
  background: var(--ztl-blue);
  border-color: var(--ztl-blue);
  color: #ffffff;
}

.ztl-tour-btn-primary:hover {
  background: var(--ztl-blue-hover);
  border-color: var(--ztl-blue-hover);
  color: #ffffff;
}

/* Panorama Container */
.ztl-tour-container {
  width: 100%;
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
}

/* Loading Overlay */
.ztl-tour-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.9);
  color: #f8fafc;
  z-index: 20;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.ztl-tour-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.ztl-tour-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(0, 144, 215, 0.2);
  border-top-color: var(--ztl-blue);
  border-radius: 50%;
  animation: ztl-tour-spin 0.8s linear infinite;
  margin-bottom: 0.85rem;
}

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

.ztl-tour-hint {
  position: absolute;
  bottom: 3.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #cbd5e1;
  font-size: 0.78rem;
  padding: 0.3rem 0.8rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: none;
  z-index: 5;
  opacity: 0.85;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: opacity 0.5s ease;
}

/* Marker Styling */
.ztl-tour-marker-pin {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ztl-blue);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 3px rgba(0, 144, 215, 0.35), 0 4px 10px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s ease;
  animation: ztl-pin-pulse 2.2s infinite;
}

.ztl-tour-marker-pin:hover {
  transform: scale(1.18);
  background: var(--ztl-blue-hover);
}

@keyframes ztl-pin-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 144, 215, 0.6), 0 4px 10px rgba(0, 0, 0, 0.35);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(0, 144, 215, 0), 0 4px 10px rgba(0, 0, 0, 0.35);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 144, 215, 0), 0 4px 10px rgba(0, 0, 0, 0.35);
  }
}

/* Tooltip & Popover Enhancements */
.psv-tooltip {
  background: rgba(15, 23, 42, 0.95) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  color: #f8fafc !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 0.6rem !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5) !important;
  font-size: 0.85rem !important;
  padding: 0.5rem 0.8rem !important;
}

.psv-tooltip h3, .psv-tooltip h4 {
  margin: 0 0 0.3rem 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ztl-blue-light);
}

.psv-tooltip p {
  margin: 0 0 0.4rem 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: #cbd5e1;
}

.ztl-marker-link {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ztl-blue-light) !important;
  text-decoration: none;
}

.ztl-marker-link:hover {
  text-decoration: underline;
}

/* Notice for preparation */
.ztl-tour-notice {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1rem;
  background: rgba(245, 158, 11, 0.12);
  border-top: 1px solid rgba(245, 158, 11, 0.25);
  color: #fbbf24;
  font-size: 0.82rem;
}

.ztl-tour-notice svg {
  flex-shrink: 0;
}

/* Virtual tour gallery styling */
.psv-gallery-item {
  border-radius: 0.5rem !important;
  overflow: hidden !important;
  border: 2px solid transparent !important;
  transition: all 0.2s ease !important;
}

.psv-gallery-item--active {
  border-color: var(--ztl-blue) !important;
  box-shadow: 0 0 12px rgba(0, 144, 215, 0.6) !important;
}

/* Navbar adjustments */
.psv-navbar {
  background: rgba(15, 23, 42, 0.85) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #f8fafc !important;
}

.psv-caption {
  font-size: 0.85rem !important;
  color: #e2e8f0 !important;
}

.psv-button:hover {
  color: var(--ztl-blue-light) !important;
}

.psv-virtual-tour-link {
  color: var(--ztl-blue) !important;
}
