/* Statistics Page Styles */

/* CRITICAL: Override card hover effects from application.css */
.stats-container .card:hover,
.stats-container .card:hover:not(.content-card):not(.question-card):not(.result-main-card) {
  transform: none !important;
  box-shadow: var(--shadow-card) !important;
}

/* SVG Icons Styling */
svg.inline-icon {
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.5rem;
  color: currentColor;
}

.chart-title svg {
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.5rem;
  color: currentColor;
}

.section-title svg {
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.5rem;
  color: currentColor;
}

.card-icon svg {
  width: 100%;
  height: 100%;
  color: currentColor;
}

h1 svg {
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.5rem;
  color: currentColor;
}

.milestone-name svg,
.insight-card h4 svg {
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.5rem;
  color: currentColor;
  width: 20px;
  height: 20px;
}

.activity-icon svg {
  display: inline-block;
  vertical-align: middle;
  color: currentColor;
}

.stats-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  position: relative;
  min-height: 100vh;
}

/* Header */
.stats-header {
  margin-bottom: 2rem;
  text-align: center;
}

.stats-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.stats-header h1 .title-foreground {
  color: hsl(220, 25%, 25%);
}

.stats-header h1 .title-primary {
  color: hsl(18, 95%, 60%);
}

.stats-subtitle {
  font-size: 1.125rem;
  color: #64748b;
  margin-bottom: 1.5rem;
}

.btn-back {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, hsl(240, 50%, 20%) 0%, hsl(213, 50%, 35%) 100%);
  color: white;
  text-decoration: none;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
  font-weight: 500;
}

.btn-back:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 60px -15px hsl(240, 50%, 20%, 0.35);
}

/* Summary Cards */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.summary-card {
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
}

.summary-card:hover {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.summary-card .card-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  width: 2.5rem;
  height: 2.5rem;
}

.summary-card h3 {
  font-size: 2rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0.5rem 0;
}

.summary-card p {
  font-size: 0.875rem;
  color: #64748b;
  margin: 0;
}

/* Score-based coloring for average score card */
.summary-card.score-high h3 {
  color: #22c55e;
}

.summary-card.score-medium h3 {
  color: #eab308;
}

.summary-card.score-low h3 {
  color: #ef4444;
}

/* Charts Grid */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.chart-container {
  padding: 2rem;
}

.chart-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chart-wrapper {
  position: relative;
  height: 300px;
  margin-bottom: 1rem;
}

.chart-note {
  font-size: 0.875rem;
  color: #64748b;
  font-style: italic;
  text-align: center;
  margin-top: 1rem;
}

.chart-legend {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #475569;
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

.legend-color.high {
  background: rgba(34, 197, 94, 0.8);
}

.legend-color.medium {
  background: rgba(234, 179, 8, 0.8);
}

.legend-color.low {
  background: rgba(239, 68, 68, 0.8);
}

/* Projections Section */
.projections-section {
  padding: 2rem;
  margin-bottom: 3rem;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 1rem;
}

.section-description {
  font-size: 1rem;
  color: #64748b;
  margin-bottom: 1.5rem;
}

.projection-toggle {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  justify-content: center;
  flex-wrap: wrap;
}

.toggle-btn {
  padding: 0.75rem 1.5rem;
  background: #f1f5f9;
  border: 2px solid #e2e8f0;
  border-radius: 0.5rem;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  transition: all 0.3s ease;
}

.toggle-btn:hover {
  background: #e2e8f0;
}

.toggle-btn.active {
  background: linear-gradient(135deg, hsl(240, 50%, 20%) 0%, hsl(213, 50%, 35%) 100%);
  color: white;
  border-color: hsl(240, 50%, 20%);
}

.projection-content {
  background: linear-gradient(135deg, hsl(45, 15%, 95%) 0%, hsl(207, 12%, 91%) 100%);
  border-radius: 0.5rem;
  padding: 2rem;
  margin-bottom: 1.5rem;
  border: 1px solid hsl(210, 20%, 90%);
}

.projection-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.projection-stat {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.projection-label {
  font-size: 0.875rem;
  color: #64748b;
  font-weight: 500;
}

.projection-value {
  font-size: 1.25rem;
  color: #1e293b;
  font-weight: 600;
}

.consistency-high {
  color: #22c55e;
}

.consistency-medium {
  color: #eab308;
}

.consistency-low {
  color: #ef4444;
}

.projection-insufficient-data {
  text-align: center;
  padding: 3rem 2rem;
  color: #64748b;
}

.projection-insufficient-data svg {
  margin: 0 auto 1rem;
  color: #94a3b8;
}

.projection-insufficient-data h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #475569;
  margin: 0 0 1rem 0;
}

.projection-insufficient-data p {
  font-size: 1rem;
  color: #64748b;
  margin: 0;
  line-height: 1.6;
}

.projection-explanation {
  background: #fef3c7;
  border-left: 4px solid #f59e0b;
  padding: 1rem;
  border-radius: 0.25rem;
}

.projection-explanation p {
  margin: 0.5rem 0;
  font-size: 0.875rem;
  color: #78350f;
}

.projection-explanation strong {
  color: #92400e;
}

/* Milestones Section */
.milestones-section {
  padding: 2rem;
  margin-bottom: 3rem;
}

.milestones-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.milestone-card {
  background: linear-gradient(135deg, hsl(240, 50%, 20%) 0%, hsl(213, 50%, 35%) 100%);
  padding: 1.5rem;
  border-radius: 0.75rem;
  color: white;
}

.milestone-card:nth-child(2) {
  background: linear-gradient(135deg, hsl(18, 95%, 60%) 0%, hsl(18, 100%, 70%) 100%);
}

.milestone-card:nth-child(3) {
  background: linear-gradient(135deg, hsl(45, 15%, 95%) 0%, hsl(207, 12%, 91%) 100%);
  color: hsl(220, 25%, 25%);
}

.milestone-card:nth-child(4) {
  background: linear-gradient(135deg, hsl(240, 50%, 20%) 0%, hsl(213, 50%, 35%) 100%);
}

.milestone-name {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.milestone-progress {
  margin-top: 1rem;
}

.milestone-card .progress-bar-container {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 1rem;
  overflow: hidden;
  height: 12px;
  margin-bottom: 0.5rem;
}

.milestone-card .progress-bar {
  height: 100%;
}

.milestone-card .progress-fill {
  background: white;
  height: 100%;
  border-radius: 1rem;
  transition: width 0.5s ease;
}

/* Special styling for marble white card progress */
.milestone-card:nth-child(3) .progress-bar-container {
  background: rgba(0, 0, 0, 0.1);
}

.milestone-card:nth-child(3) .progress-fill {
  background: hsl(18, 95%, 60%);
}

.milestone-card .progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.9);
}

/* Special styling for marble white card text - use dark text instead */
.milestone-card:nth-child(3) .progress-text {
  color: hsl(220, 25%, 25%);
}

/* Recent Activity */
.recent-activity-section {
  padding: 2rem;
  margin-bottom: 3rem;
}

.activity-timeline {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
}

.activity-item:hover {
  background: #f1f5f9;
}

.activity-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.activity-icon.high {
  background: rgba(34, 197, 94, 0.2);
}

.activity-icon.medium {
  background: rgba(234, 179, 8, 0.2);
}

.activity-icon.low {
  background: rgba(239, 68, 68, 0.2);
}

.activity-content {
  flex: 1;
}

.activity-content h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 0.25rem 0;
}

.activity-topic {
  font-size: 0.875rem;
  color: #64748b;
  margin: 0 0 0.25rem 0;
}

.activity-date {
  font-size: 0.75rem;
  color: #94a3b8;
  margin: 0;
}

.activity-score {
  font-size: 1.5rem;
  font-weight: 700;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
}

.activity-score.high {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
}

.activity-score.medium {
  color: #eab308;
  background: rgba(234, 179, 8, 0.1);
}

.activity-score.low {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

/* Insights Section */
.insights-section {
  padding: 2rem;
  margin-bottom: 3rem;
}

.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.insight-card {
  padding: 1.5rem;
  border-radius: 0.75rem;
  border-left: 4px solid;
}

.insight-card h4 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
}

.insight-card p {
  font-size: 0.875rem;
  margin: 0;
  line-height: 1.5;
}

.insight-card.positive {
  background: #f0fdf4;
  border-color: #22c55e;
  color: #166534;
}

.insight-card.neutral {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1e40af;
}

.insight-card.encouraging {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #78350f;
}

/* Footer */
.stats-footer {
  text-align: center;
  padding: 2rem 0;
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

/* Button Styles */
.btn-stats {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-stats:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
  .stats-container {
    padding: 1rem;
  }

  .stats-header h1 {
    font-size: 1.75rem;
  }

  .summary-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .charts-grid {
    grid-template-columns: 1fr;
  }

  .chart-wrapper {
    height: 250px;
  }

  .projection-stats {
    grid-template-columns: 1fr;
  }

  .milestones-grid {
    grid-template-columns: 1fr;
  }

  .insights-grid {
    grid-template-columns: 1fr;
  }

  .activity-item {
    flex-direction: column;
    text-align: center;
  }

  .activity-content {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .summary-cards {
    grid-template-columns: 1fr;
  }

  .chart-legend {
    flex-direction: column;
    align-items: flex-start;
  }

  .projection-toggle {
    flex-direction: column;
  }

  .toggle-btn {
    width: 100%;
  }
}

/* Print Styles */
@media print {
  .btn-back,
  .stats-footer {
    display: none;
  }

  .stats-container {
    padding: 0;
  }

  .chart-container {
    page-break-inside: avoid;
  }
}

/* Loading State */
.chart-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 300px;
  color: #94a3b8;
  font-size: 1rem;
}

/* Animation for cards */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.summary-card,
.chart-container,
.projections-section,
.milestones-section,
.recent-activity-section,
.insights-section {
  animation: fadeInUp 0.6s ease-out;
}

