/* Analytics Page Styles */

/* Overview Cards */
.analytics-overview {
  margin-bottom: 30px;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.overview-card {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(99, 102, 241, 0.1);
  border-radius: 16px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.overview-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 40px rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
}

.overview-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
}

.overview-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.overview-content h3 {
  font-size: 36px;
  font-weight: 700;
  color: #e2e8f0;
  margin: 0;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.overview-content p {
  color: #64748b;
  font-size: 14px;
  margin: 4px 0 0 0;
}

.overview-trend {
  position: absolute;
  top: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
}

.overview-trend.up {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
}

.overview-trend.down {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

/* Charts Section */
.charts-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 30px;
}

.chart-row {
  display: grid;
  gap: 24px;
}

.chart-row:first-child {
  grid-template-columns: 1fr;
}

.chart-row:not(:first-child) {
  grid-template-columns: repeat(2, 1fr);
}

.chart-container {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(99, 102, 241, 0.1);
  border-radius: 16px;
  padding: 24px;
  transition: all 0.3s ease;
}

.chart-container:hover {
  border-color: rgba(99, 102, 241, 0.2);
}

.chart-container.large {
  grid-column: span 2;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.chart-header h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  color: #e2e8f0;
  margin: 0;
}

.chart-header h3 i {
  color: #6366f1;
}

.chart-filters {
  display: flex;
  gap: 10px;
}

.filter-select {
  padding: 6px 12px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #94a3b8;
  font-size: 12px;
  outline: none;
  cursor: pointer;
}

.filter-select:focus {
  border-color: #6366f1;
}

.chart-body {
  position: relative;
  height: 300px;
}

.chart-container.large .chart-body {
  height: 350px;
}

/* Weak Areas Section */
.weak-areas-section {
  margin-bottom: 30px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-header h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 600;
  color: #e2e8f0;
  margin: 0;
}

.section-header h3 i {
  color: #f59e0b;
}

.badge {
  padding: 4px 12px;
  background: rgba(99, 102, 241, 0.1);
  border-radius: 20px;
  font-size: 12px;
  color: #818cf8;
}

.weak-areas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.weak-area-card {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.2s ease;
}

.weak-area-card:hover {
  border-color: rgba(239, 68, 68, 0.4);
  transform: translateX(4px);
}

.weak-area-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.weak-area-content {
  flex: 1;
}

.weak-area-title {
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 4px;
}

.weak-area-subtitle {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 8px;
}

.weak-area-progress {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.weak-area-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ef4444, #f59e0b);
  border-radius: 3px;
  transition: width 0.5s ease;
}

.weak-area-score {
  font-size: 24px;
  font-weight: 700;
  color: #ef4444;
}

/* Recent Tests Table */
.recent-tests-section {
  margin-bottom: 30px;
}

.tests-table-container {
  overflow-x: auto;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(99, 102, 241, 0.1);
  border-radius: 16px;
  overflow: hidden;
}

.tests-table {
  width: 100%;
  border-collapse: collapse;
}

.tests-table th {
  text-align: left;
  padding: 16px 20px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tests-table td {
  padding: 16px 20px;
  font-size: 14px;
  color: #cbd5e1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.tests-table tr:hover td {
  background: rgba(99, 102, 241, 0.05);
}

.tests-table tr:last-child td {
  border-bottom: none;
}

.test-name-cell {
  font-weight: 600;
  color: #e2e8f0;
}

.score-cell {
  font-weight: 700;
}

.score-cell.high { color: #22c55e; }
.score-cell.medium { color: #f59e0b; }
.score-cell.low { color: #ef4444; }

.accuracy-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.accuracy-fill {
  width: 60px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.accuracy-fill-inner {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

.accuracy-fill-inner.high { background: #22c55e; }
.accuracy-fill-inner.medium { background: #f59e0b; }
.accuracy-fill-inner.low { background: #ef4444; }

.rank-cell {
  font-weight: 600;
}

.rank-cell.top { color: #f59e0b; }
.rank-cell.good { color: #22c55e; }

.action-btn-sm {
  padding: 6px 12px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 6px;
  color: #818cf8;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-btn-sm:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
}

/* Recommendations Section */
.recommendations-section {
  margin-bottom: 30px;
}

.recommendations-section .section-header h3 i {
  color: #6366f1;
}

.recommendations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.recommendation-card {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(99, 102, 241, 0.1);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.2s ease;
}

.recommendation-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-2px);
}

.recommendation-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.recommendation-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.recommendation-type {
  font-size: 11px;
  font-weight: 600;
  color: #818cf8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.recommendation-title {
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 8px;
}

.recommendation-desc {
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.5;
  margin-bottom: 12px;
}

.recommendation-action {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #6366f1;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s ease;
}

.recommendation-action:hover {
  color: #8b5cf6;
}

/* Strengths Section */
.strengths-section .section-header h3 i {
  color: #22c55e;
}

.strengths-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.strength-card {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.2s ease;
}

.strength-card:hover {
  border-color: rgba(34, 197, 94, 0.4);
  transform: translateY(-2px);
}

.strength-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(34, 197, 94, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.strength-content {
  flex: 1;
}

.strength-title {
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 4px;
}

.strength-subtitle {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 8px;
}

.strength-score {
  font-size: 24px;
  font-weight: 700;
  color: #22c55e;
}

/* Modal Large */
.modal-large {
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
}

.test-detail-section {
  margin-bottom: 24px;
}

.test-detail-section h4 {
  font-size: 14px;
  font-weight: 600;
  color: #818cf8;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.test-detail-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.detail-stat-card {
  text-align: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
}

.detail-stat-value {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
}

.detail-stat-label {
  font-size: 12px;
  color: #64748b;
}

.subject-breakdown {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.subject-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.subject-name {
  width: 120px;
  font-weight: 500;
  color: #cbd5e1;
}

.subject-bar-container {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.subject-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.subject-score {
  width: 60px;
  text-align: right;
  font-weight: 600;
}

/* Responsive */
@media (max-width: 1200px) {
  .overview-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .chart-row:not(:first-child) {
    grid-template-columns: 1fr;
  }
  
  .chart-container.large {
    grid-column: span 1;
  }
}

@media (max-width: 768px) {
  .overview-grid {
    grid-template-columns: 1fr;
  }
  
  .test-detail-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .weak-areas-grid,
  .recommendations-grid,
  .strengths-grid {
    grid-template-columns: 1fr;
  }
}