
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.astro-analysis-container {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333!important;
}
select{
  color:#1a202c!important;
}

.dashboard-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

/* Header Styles */
.dashboard-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.header-left h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #1a202c;
  margin-bottom: 4px;
}

.header-left p {
  color: #718096;
  font-size: 1rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.school-select {
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  background: white;
  min-width: 200px;
  cursor: pointer;
  transition: all 0.2s;
}

.school-select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.export-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.export-btn:hover:not(:disabled) {
  background: #5a67d8;
  transform: translateY(-1px);
}

.export-btn:disabled {
  background: #a0aec0;
  cursor: not-allowed;
  transform: none;
}

/* Loading Spinner */
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  backdrop-filter: blur(10px);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e2e8f0;
  border-top: 4px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Welcome Screen */
.welcome-screen {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 60px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.welcome-content svg {
  color: #a0aec0;
  margin-bottom: 24px;
}

.welcome-content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 12px;
}

.welcome-content p {
  color: #718096;
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Analysis Controls */
.analysis-controls {
  margin-bottom: 24px;
}

.analysis-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.analysis-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 8px;
}

.analysis-card p {
  color: #718096;
  margin-bottom: 20px;
}

.analysis-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.analysis-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px;
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  font-weight: 500;
  color: #4a5568;
}

.analysis-btn:hover {
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.analysis-btn.active {
  background: #667eea;
  border-color: #667eea;
  color: white;
}

.analysis-btn svg {
  transition: all 0.2s;
}

/* Analysis Content */
.analysis-content {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.analysis-section.hidden {
  display: none;
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.metric-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s;
}

.metric-card:hover {
  transform: translateY(-2px);
}

.metric-icon {
  width: 48px;
  height: 48px;
  background: #f7fafc;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #667eea;
}

.metric-content h3 {
  font-size: 2rem;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 4px;
}

.metric-content p {
  color: #718096;
  font-size: 0.875rem;
}

/* Cards */
.card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 24px;
}

.card-header {
  padding: 24px 24px 0 24px;
}

.card-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 8px;
}

.card-header p {
  color: #718096;
  font-size: 0.875rem;
}

.card-content {
  padding: 24px;
}

/* Overview Cards */
.overview-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 24px;
}

.grade-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.grade-badge {
  background: #edf2f7;
  color: #4a5568;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
}

.teams-list {
  max-height: 400px;
  overflow-y: auto;
}

.team-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 12px;
}

.team-info h4 {
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 4px;
}

.team-info p {
  color: #718096;
  font-size: 0.875rem;
}

.team-badge {
  background: #f7fafc;
  color: #4a5568;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  border: 1px solid #e2e8f0;
}

/* Question Accuracy Styles */
.question-accuracy {
  padding: 0;
}

.accuracy-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.accuracy-card {
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  transition: transform 0.2s;
}

.accuracy-card:hover {
  transform: translateY(-2px);
}

.accuracy-card.overall {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.accuracy-card.correct {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.accuracy-card.incorrect {
  background: #fef2f2;
  border-color: #fecaca;
}

.accuracy-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.accuracy-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.accuracy-icon.overall {
  background: #10b981;
}

.accuracy-icon.correct {
  background: #22c55e;
}

.accuracy-icon.incorrect {
  background: #ef4444;
}

.accuracy-title h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.accuracy-title p {
  margin: 0;
  color: #64748b;
  font-size: 14px;
}

.accuracy-value {
  font-size: 24px;
  font-weight: 700;
}

.accuracy-value.overall {
  color: #10b981;
}

.accuracy-value.correct {
  color: #16a34a;
}

.accuracy-value.incorrect {
  color: #dc2626;
}

.question-insights {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.insight-card {
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.insight-card.most-correct {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.insight-card.most-incorrect {
  background: #fef2f2;
  border-color: #fecaca;
}

.insight-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
}

.insight-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.insight-icon.correct {
  background: #22c55e;
}

.insight-icon.incorrect {
  background: #ef4444;
}

.insight-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.insight-title.correct {
  color: #16a34a;
}

.insight-title.incorrect {
  color: #dc2626;
}

.insight-detail {
  margin-bottom: 8px;
}

.insight-detail:last-child {
  margin-bottom: 0;
}

.insight-label {
  font-size: 14px;
  color: #64748b;
}

.insight-value {
  font-weight: 600;
  margin-left: 8px;
}

.insight-value.correct {
  color: #16a34a;
}

.insight-value.incorrect {
  color: #dc2626;
}

/* Performance Section */
.performance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 24px;
}

.performers-list {
  max-height: 500px;
  overflow-y: auto;
}

.performer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 12px;
}

.performer-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.performer-rank {
  width: 32px;
  height: 32px;
  background: #edf2f7;
  color: #667eea;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
}

.performer-info h4 {
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 4px;
}

.performer-info p {
  color: #718096;
  font-size: 0.875rem;
}

.performer-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.performer-score {
  text-align: right;
}

.performer-score .score {
  font-size: 1.125rem;
  font-weight: 700;
  color: #2d3748;
}

.performer-score .quizzes {
  font-size: 0.75rem;
  color: #718096;
}

.performance-badge {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

.performance-badge.excellent {
  background: #c6f6d5;
  color: #22543d;
}

.performance-badge.good {
  background: #bee3f8;
  color: #2a4365;
}

.performance-badge.average {
  background: #faf089;
  color: #744210;
}

.performance-badge.below-average {
  background: #fed7aa;
  color: #9c4221;
}

.performance-badge.needs-improvement {
  background: #fed7d7;
  color: #742a2a;
}

/* Quiz Breakdown */
.quiz-breakdown {
  max-height: 400px;
  overflow-y: auto;
}

.quiz-item {
  margin-bottom: 20px;
}

.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.quiz-title {
  font-weight: 600;
  color: #2d3748;
}

.quiz-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.875rem;
  color: #718096;
}

.quiz-score {
  font-weight: 700;
  color: #2d3748;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #edf2f7;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #667eea;
  transition: width 0.3s ease;
}

.quiz-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.75rem;
  color: #718096;
}

/* Detailed Reports */
.detailed-reports {
  max-height: 600px;
  overflow-y: auto;
}

.report-item {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 20px;
  overflow: hidden;
}

.report-header {
  background: #f7fafc;
  padding: 16px;
  border-bottom: 1px solid #e2e8f0;
}

.report-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.report-title h4 {
  font-weight: 600;
  color: #2d3748;
}

.report-meta {
  color: #718096;
  font-size: 0.875rem;
}

.report-content {
  padding: 16px;
}

.report-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.stat-item {
  text-align: center;
  padding: 12px;
  background: #f7fafc;
  border-radius: 8px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2d3748;
}

.stat-label {
  font-size: 0.75rem;
  color: #718096;
  margin-top: 4px;
}

.quiz-details {
  margin-top: 16px;
}

.quiz-attempt {
  background: #f7fafc;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}

.attempt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.attempt-title {
  font-weight: 600;
  color: #2d3748;
  font-size: 0.875rem;
}

.attempt-score {
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
}

.attempt-score.good {
  background: #c6f6d5;
  color: #22543d;
}

.attempt-score.poor {
  background: #fed7d7;
  color: #742a2a;
}

.attempt-details {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #718096;
}

/* Trends Section */
.trends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 24px;
}

.coming-soon {
  text-align: center;
  color: #718096;
  font-style: italic;
  padding: 40px;
}

/* Utility Classes */
.hidden {
  display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
  .dashboard-container {
    padding: 12px;
  }

  .header-content {
    flex-direction: column;
    align-items: stretch;
  }

  .header-right {
    justify-content: space-between;
  }

  .school-select {
    min-width: auto;
    flex: 1;
  }

  .analysis-buttons {
    grid-template-columns: repeat(2, 1fr);
  }

  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .overview-cards {
    grid-template-columns: 1fr;
  }

  .performance-grid {
    grid-template-columns: 1fr;
  }

  .trends-grid {
    grid-template-columns: 1fr;
  }

  .accuracy-overview {
    grid-template-columns: 1fr;
  }

  .question-insights {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .analysis-buttons {
    grid-template-columns: 1fr;
  }

  .performer-item {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .performer-right {
    justify-content: space-between;
  }

  .accuracy-overview {
    grid-template-columns: 1fr;
  }

  .question-insights {
    grid-template-columns: 1fr;
  }
}
