/* Modern Analytics Styles */
:root {
  --primary: #003459;
  --secondary: #007ea7;
  --accent: #00a8e8;
  --light: #f8f9fa;
  --dark: #212529;
  --gray: #6c757d;
  --border: #dee2e6;
  --card-shadow: 0 4px 6px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.08);
  --transition: all 0.25s ease;
}

/* Base analytics card styles */
.analytics-card {
  background-color: white;
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  transition: var(--transition);
  margin-bottom: 1.5rem;
  overflow: hidden;
  border: 1px solid var(--border);
}

.analytics-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 15px rgba(0,0,0,0.08);
}

.analytics-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.analytics-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.analytics-card-title i {
  color: var(--accent);
}

.analytics-card-body {
  padding: 1.5rem;
}

.analytics-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.analytics-summary-item {
  flex: 1;
  min-width: 120px;
  background-color: var(--light);
  padding: 1rem;
  border-radius: 12px;
  text-align: center;
  border-bottom: 3px solid var(--accent);
}

.analytics-summary-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}

.analytics-summary-label {
  font-size: 0.85rem;
  color: var(--gray);
  margin-top: 0.5rem;
}

/* Empty state styles */
.empty-state-chart {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: var(--gray);
  text-align: center;
}

.empty-state-chart i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}

.empty-state-chart p {
  font-size: 1rem;
  margin: 0;
}

/* Modern heatmap styles */
.modern-heatmap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.heatmap-section {
  display: flex;
  align-items: center;
  padding: 16px;
  border-radius: 12px;
  background-color: var(--light);
  transition: var(--transition);
  position: relative;
  margin-bottom: 10px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  width: 100%; /* Ensure full width */
}

.heatmap-section:hover {
  transform: translateX(5px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.section-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--primary);
  margin-right: 16px;
  flex-shrink: 0;
}

.section-content {
  flex-grow: 1;
  max-width: calc(100% - 90px); /* Ensure content doesn't overflow */
  overflow: hidden;
}

.section-title {
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 4px;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.section-stats {
  display: flex;
  gap: 24px;
  flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.stat-item {
  display: flex;
  flex-direction: column;
  min-width: 70px;
}

.stat-value {
  font-weight: 600;
  color: var(--primary);
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--gray);
}

.interaction-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background-color: rgba(255, 255, 255, 0.9);
  color: var(--primary);
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.9rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Timeline styles */
.view-timeline {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 150px;
  padding: 20px 0;
  position: relative;
}

.view-timeline::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 60px;
  height: 2px;
  background-color: var(--border);
  z-index: 1;
}

.timeline-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
  flex: 1;
}

.timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--secondary);
  margin-bottom: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.timeline-label {
  font-size: 0.75rem;
  color: var(--gray);
  text-align: center;
  margin-bottom: 4px;
}

.timeline-count {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
}

/* Engagement scorecard styles */
.engagement-scorecard {
  background-color: white;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
}

.score-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.score-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--primary);
}

.score-icon {
  font-size: 1.8rem;
}

.score-value-container {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 1.5rem;
}

.score-value {
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1;
}

.score-level {
  font-size: 1.2rem;
  color: var(--gray);
  font-weight: 500;
}

.score-details {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.score-metric {
  flex: 1;
  text-align: center;
}

.metric-name {
  font-size: 0.85rem;
  color: var(--gray);
  margin-bottom: 4px;
}

.metric-value {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--primary);
}

.score-tips {
  background-color: var(--light);
  border-radius: 12px;
  padding: 1rem;
}

.tip-header {
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.tip-list {
  margin: 0;
  padding-left: 1.5rem;
  color: var(--gray);
  font-size: 0.9rem;
}

.tip-list li {
  margin-bottom: 0.5rem;
}

.tip-congrats {
  color: var(--gray);
  font-size: 0.9rem;
  margin: 0;
}

/* Responsive design */
@media (max-width: 768px) {
  .analytics-summary {
    flex-direction: column;
    gap: 1rem;
  }
  
  .score-details {
    flex-direction: column;
    gap: 1rem;
  }
  
  .score-value-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }
  
  .view-timeline {
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 10px;
  }
  
  .timeline-date {
    min-width: 70px;
  }
}

/* Analytics Grid */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.analytics-grid-full {
  grid-column: span 12;
}

.analytics-grid-half {
  grid-column: span 6;
}

.analytics-grid-third {
  grid-column: span 4;
}

@media (max-width: 992px) {
  .analytics-grid-half,
  .analytics-grid-third {
    grid-column: span 12;
  }
}

/* Expandable Panel */
.analytics-panel {
  overflow: hidden;
  transition: var(--transition);
}

.analytics-panel-header {
  cursor: pointer;
  padding: 1rem 1.5rem;
  background-color: var(--light);
  border-radius: 12px;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.analytics-panel-title {
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.analytics-panel-toggle i {
  transition: transform 0.3s ease;
}

.analytics-panel.expanded .analytics-panel-toggle i {
  transform: rotate(180deg);
}

.analytics-panel-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease;
}

.analytics-panel.expanded .analytics-panel-body {
  max-height: 2000px;
}

/* Animation for charts */
.animate-fade-in {
  animation: fadeIn 0.6s ease-in-out;
}

.animate-slide-up {
  animation: slideUp 0.6s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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