/**
 * CarHub Kenya — 360° Virtual Showroom Stylesheet
 */

.carhub-360-stage {
  position: relative;
  background: radial-gradient(circle at 50% 20%, #1e293b 0%, #0f172a 60%, #020617 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg, 16px);
  overflow: hidden;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.6);
  user-select: none;
  font-family: inherit;
}

/* 360 Stage Header */
.c360-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
  gap: 0.75rem;
  z-index: 10;
  position: relative;
}

.c360-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.c360-pill {
  font-size: 0.76rem;
  padding: 0.3rem 0.65rem;
  border-radius: 9999px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.c360-pill-verified {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.c360-pill-vin {
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.25);
  letter-spacing: 0.5px;
}

.c360-pill-plate {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Mode Switch Toggle */
.c360-mode-switch {
  display: inline-flex;
  background: rgba(2, 6, 23, 0.6);
  padding: 3px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.c360-switch-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.45rem 0.9rem;
  border-radius: 9999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.c360-switch-btn:hover {
  color: #ffffff;
}

.c360-switch-btn.active {
  background: var(--primary, #059669);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.4);
}

/* 360 Viewport */
.c360-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 380px;
  max-height: 580px;
  cursor: grab;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.c360-viewport:active {
  cursor: grabbing;
}

/* Layers */
.c360-exterior-layer,
.c360-interior-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
}

.c360-exterior-layer.active,
.c360-interior-layer.active {
  display: block;
}

.c360-frame-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.c360-frame-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

/* Angle HUD Indicator */
.c360-angle-hud {
  position: absolute;
  bottom: 1rem;
  right: 1.25rem;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.4rem 0.75rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #f8fafc;
  font-size: 0.82rem;
  pointer-events: none;
}

.c360-angle-compass {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--primary, #059669);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.c360-compass-arrow {
  width: 2px;
  height: 9px;
  background: var(--primary, #059669);
  position: absolute;
  top: 2px;
  transform-origin: center 9px;
  border-radius: 1px;
}

/* Interior Canvas & Hotspots */
.c360-interior-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.c360-hotspots-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.c360-hotspot-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: pointer;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.c360-hotspot-pulse {
  position: absolute;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.4);
  animation: c360Pulse 2s infinite ease-out;
}

.c360-hotspot-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #10b981;
  border: 2.5px solid #ffffff;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.8);
  transition: transform 0.2s ease;
}

.c360-hotspot-pin:hover .c360-hotspot-dot {
  transform: scale(1.35);
  background: #34d399;
}

.c360-hotspot-label {
  font-size: 0.72rem;
  background: rgba(15, 23, 42, 0.85);
  color: #f8fafc;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  margin-top: 5px;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.15);
  pointer-events: none;
  font-weight: 600;
}

@keyframes c360Pulse {
  0% { transform: scale(0.6); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

.c360-interior-hint {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  font-size: 0.76rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  pointer-events: none;
}

/* Hotspot Popover Tooltip */
.c360-hotspot-popover {
  position: absolute;
  width: 290px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.5);
  z-index: 20;
  color: #ffffff;
  animation: c360FadeIn 0.25s ease-out;
}

@keyframes c360FadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.c360-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.c360-popover-icon {
  color: #10b981;
  font-size: 1rem;
}

.c360-popover-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  flex: 1;
  padding-left: 0.5rem;
  color: #f8fafc;
}

.c360-popover-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0 0.25rem;
}

.c360-popover-close:hover {
  color: #ffffff;
}

.c360-popover-desc {
  font-size: 0.82rem;
  color: #cbd5e1;
  line-height: 1.45;
  margin: 0 0 0.75rem 0;
}

.c360-popover-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 0.5rem;
  display: flex;
  justify-content: flex-end;
}

.c360-popover-tag {
  font-size: 0.7rem;
  color: #34d399;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Bottom Controls */
.c360-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
  gap: 0.75rem;
  z-index: 10;
  position: relative;
}

.c360-left-tools,
.c360-right-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.c360-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm, 8px);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.c360-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.c360-btn.active {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #34d399;
}

.c360-angle-shortcuts {
  display: inline-flex;
  gap: 0.3rem;
}

.c360-shortcut-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  font-size: 0.74rem;
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.c360-shortcut-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

.c360-spec-callout {
  font-size: 0.8rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.c360-spec-callout strong {
  color: #ffffff;
}

.c360-spec-divider {
  color: #475569;
}

@media (max-width: 768px) {
  .c360-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .c360-spec-callout {
    justify-content: center;
  }
  .c360-left-tools,
  .c360-right-tools {
    justify-content: center;
    flex-wrap: wrap;
  }
}
