/* Performance Monitoring Dashboard */
.analytics-dashboard {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  background: linear-gradient(135deg, rgba(7, 18, 35, 0.95), rgba(0, 51, 102, 0.95));
  backdrop-filter: blur(20px);
  border: 1px solid rgba(120, 200, 255, 0.2);
  border-radius: 16px;
  padding: 30px;
  max-width: 800px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  z-index: 99999 !important;
  display: none;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  /* Force center positioning - override everything */
  margin: 0 auto !important;
  float: none !important;
  clear: both !important;
  right: auto !important;
  bottom: auto !important;
  /* Ensure no other positioning affects it */
  position: fixed !important;
  /* Reset any potential layout issues */
  text-align: left !important;
  direction: ltr !important;
}

.analytics-dashboard.show {
  display: block;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(120, 200, 255, 0.2);
}

.dashboard-header h2 {
  color: #00aaff;
  font-size: 1.5rem;
  margin: 0;
}

.dashboard-close {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.dashboard-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.metric-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: all 0.3s ease;
}

.metric-card:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

.metric-value {
  font-size: 2rem;
  font-weight: 700;
  color: #00aaff;
  margin-bottom: 8px;
}

.metric-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.metric-change {
  margin-top: 8px;
  font-size: 0.8rem;
  font-weight: 600;
}

.metric-change.positive {
  color: #20ff88;
}

.metric-change.negative {
  color: #ff6b6b;
}

.dashboard-section {
  margin-bottom: 30px;
}

.dashboard-section h3 {
  color: #ffcc66;
  margin-bottom: 15px;
  font-size: 1.2rem;
}

.event-list {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 15px;
  max-height: 300px;
  overflow-y: auto;
}

.event-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.event-item:last-child {
  border-bottom: none;
}

.event-name {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
}

.event-time {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
}

.event-properties {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8rem;
  margin-top: 4px;
}

.performance-chart {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 20px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
}

.dashboard-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: linear-gradient(135deg, #00aaff, #0088cc);
  color: white;
  border: none;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  cursor: pointer;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 170, 255, 0.3);
  transition: all 0.3s ease;
  z-index: 9999;
}

.dashboard-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(0, 170, 255, 0.4);
}

.dashboard-toggle:focus {
  outline: 2px solid #00aaff;
  outline-offset: 2px;
}

/* Conversion Goals */
.goal-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
}

.goal-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 15px;
}

.goal-name {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  margin-bottom: 8px;
}

.goal-progress {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
  margin-bottom: 8px;
}

.goal-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #00aaff, #00ffff);
  transition: width 0.3s ease;
}

.goal-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
}

/* Heat Map Preview */
.heatmap-preview {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.heatmap-stats {
  display: flex;
  gap: 20px;
  margin-top: 15px;
}

.heatmap-stat {
  text-align: center;
}

.heatmap-stat-value {
  font-size: 1.2rem;
  font-weight: 600;
  color: #00aaff;
}

.heatmap-stat-label {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 4px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .analytics-dashboard {
    width: 95%;
    padding: 20px;
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .metric-value {
    font-size: 1.5rem;
  }
  
  .dashboard-toggle {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }
}
