/**
 * WooPanel Shopify-Style Live View Hero Stylesheet
 * 3D WebGL Earth Backdrop, Glassmorphic Floating Metric Cards, Legend & Zoom Controls.
 */

/* Live View Hero Stage Container - Open, unboxed standalone stage */
.live-view-hero {
  position: relative;
  width: 100%;
  height: 480px;
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
  margin-bottom: 20px;
}

/* 3D WebGL Canvas Layer (Full Backdrop) */
.live-view-canvas-stage {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: block;
  cursor: grab;
}

.live-view-canvas-stage:active {
  cursor: grabbing;
}

/* Live View Top Header Bar Overlay */
.live-view-header-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0.6) 80%, rgba(255, 255, 255, 0) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 20;
}

.live-view-title-group {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.live-view-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--brand-deep, #2D085A);
  letter-spacing: -0.02em;
}

.live-view-timestamp {
  font-size: 13px;
  color: var(--text-secondary, #6B7280);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

/* Legend items */
.live-view-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: 16px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary, #4B5563);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-dot.visitor {
  background: #008060;
  box-shadow: 0 0 6px rgba(0, 128, 96, 0.6);
}

.legend-dot.order {
  background: var(--brand-purple, #721DEA);
  box-shadow: 0 0 8px rgba(114, 29, 234, 0.7);
  animation: pulseBeacon 2s infinite;
}

@keyframes pulseBeacon {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

/* Center Search Input */
.live-view-search {
  position: relative;
  display: flex;
  align-items: center;
  width: 260px;
}

.live-view-search input {
  width: 100%;
  padding: 6px 12px 6px 32px;
  border-radius: 20px;
  border: 1px solid var(--border-subtle, #E5E7EB);
  background: rgba(255, 255, 255, 0.85);
  font-family: inherit;
  font-size: 13px;
  color: var(--text-primary, #111827);
  outline: none;
  transition: all 0.2s ease;
}

.live-view-search input:focus {
  background: #FFFFFF;
  border-color: var(--brand-purple, #721DEA);
  box-shadow: 0 0 0 2px var(--brand-mist, #F7F0FF);
}

.live-view-search svg {
  position: absolute;
  left: 10px;
  width: 14px;
  height: 14px;
  color: var(--text-secondary, #9CA3AF);
  pointer-events: none;
}

/* Right Controls (Fullscreen) */
.live-view-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-live-fullscreen {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle, #E5E7EB);
  background: rgba(255, 255, 255, 0.9);
  color: var(--brand-deep, #2D085A);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-live-fullscreen:hover {
  background: #FFFFFF;
  border-color: var(--brand-purple, #721DEA);
  box-shadow: 0 2px 8px rgba(114, 29, 234, 0.12);
}

/* Zoom Controls (+ / -) in bottom-right of canvas */
.live-view-zoom-controls {
  position: absolute;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
  border: 1px solid var(--border-subtle, #E5E7EB);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  z-index: 15;
}

.btn-zoom {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-primary, #374151);
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-zoom:hover {
  background: var(--surface-hover, #F3F4F6);
  color: var(--brand-purple, #721DEA);
}

.btn-zoom:first-child {
  border-bottom: 1px solid var(--border-subtle, #E5E7EB);
}

/* Executive Metric Cards Grid directly below the 3D globe stage */
.live-view-metric-cards-grid,
.live-view-floating-cards {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  margin-bottom: 24px;
  position: relative;
  z-index: 5;
}

.floating-metric-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(229, 231, 235, 0.85);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 98px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.floating-metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.card-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary, #6B7280);
}

.card-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  background: #F3F4F6;
  color: #4B5563;
}

.card-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary, #111827);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  margin: 2px 0 6px 0;
}

/* Micro Accent Visuals */
.card-micro-bar {
  height: 4px;
  width: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #008060 0%, #10B981 50%, var(--brand-purple, #721DEA) 100%);
}

.card-micro-progress {
  height: 4px;
  width: 100%;
  border-radius: 2px;
  background: #E5E7EB;
  overflow: hidden;
}

.card-micro-progress .fill {
  height: 100%;
  background: #008060;
  width: 68%;
  border-radius: 2px;
}

/* 10-Minute Mini Bar Chart inside Page Views Card */
.mini-barchart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 3px;
  height: 36px;
  margin-top: 4px;
}

.mini-bar {
  flex: 1;
  background: #D1D5DB;
  border-radius: 2px 2px 0 0;
  transition: height 0.3s ease, background 0.2s ease;
}

.mini-bar:hover {
  background: var(--brand-purple, #721DEA);
}

.mini-bar.active {
  background: #4B5563;
}

.barchart-time-row {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: var(--text-secondary, #9CA3AF);
  margin-top: 4px;
}

/* Customer Behavior Funnel: 3 Connected Circles */
.funnel-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.funnel-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.funnel-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid #9CA3AF;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #374151;
}

.funnel-circle.highlight {
  background: #008060;
  border-color: #008060;
  color: #FFFFFF;
  box-shadow: 0 0 8px rgba(0, 128, 96, 0.4);
}

.funnel-line {
  height: 1.5px;
  flex: 1;
  background: #D1D5DB;
  margin: 0 2px 14px 2px;
}

.funnel-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary, #111827);
  font-variant-numeric: tabular-nums;
}

.funnel-label {
  font-size: 9px;
  color: var(--text-secondary, #6B7280);
  white-space: nowrap;
}

/* Bottom Attribution Row */
.live-view-attribution-bar {
  position: absolute;
  bottom: 8px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-secondary, #9CA3AF);
  z-index: 20;
}

.live-view-attribution-bar a {
  color: var(--brand-purple, #721DEA);
  text-decoration: none;
  font-weight: 500;
}

.live-view-attribution-bar a:hover {
  text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .live-view-metric-cards-grid,
  .live-view-floating-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .live-view-metric-cards-grid,
  .live-view-floating-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .live-view-search {
    display: none;
  }
}
