/* ============================================================
   CodeLens — Report Card Styles
   Grade circle, score bars, issue cards, animations
   ============================================================ */

/* --- Report Container --- */
.report {
  padding: 28px 24px;
  animation: reportFadeIn 0.5s ease forwards;
}

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

/* --- Summary Section --- */
.report-summary {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 24px;
  font-size: 0.925rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

/* --- Grade Section --- */
.report-grade-section {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-bottom: 32px;
}

.grade-circle {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  position: relative;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
}

.grade-circle::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: inherit;
  opacity: 0.25;
  filter: blur(12px);
}

/* Grade color variants */
.grade-a-plus, .grade-a { background: linear-gradient(135deg, #2ea043, #3fb950); }
.grade-a-minus, .grade-b-plus { background: linear-gradient(135deg, #3fb950, #56d364); }
.grade-b { background: linear-gradient(135deg, #56d364, #7ee787); }
.grade-b-minus, .grade-c-plus { background: linear-gradient(135deg, #d29922, #e3b341); }
.grade-c { background: linear-gradient(135deg, #e3b341, #d29922); }
.grade-c-minus, .grade-d { background: linear-gradient(135deg, #db6d28, #f0883e); }
.grade-f { background: linear-gradient(135deg, #da3633, #f85149); }

.grade-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.grade-info h2 {
  font-size: 1.5rem;
  margin-bottom: 4px;
}

.grade-info p {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* --- Category Scores --- */
.report-scores {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 32px;
}

@media (max-width: 600px) {
  .report-scores {
    grid-template-columns: 1fr;
  }
}

.score-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
}

.score-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.score-card-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.score-card-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.score-bar {
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  width: 0;
}

.score-bar-fill.score-high { background: linear-gradient(90deg, #2ea043, #3fb950); }
.score-bar-fill.score-mid { background: linear-gradient(90deg, #d29922, #e3b341); }
.score-bar-fill.score-low { background: linear-gradient(90deg, #da3633, #f85149); }

/* --- Issues Section --- */
.report-issues {
  margin-bottom: 28px;
}

.report-issues-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.report-issues-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

.issues-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 3px 10px;
  border-radius: 20px;
}

.issue-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 12px;
  transition: border-color var(--transition-fast);
}

.issue-card:hover {
  border-color: var(--text-muted);
}

.issue-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.severity-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.severity-critical {
  background: rgba(248, 81, 73, 0.15);
  color: var(--danger);
  border: 1px solid rgba(248, 81, 73, 0.3);
}

.severity-warning {
  background: rgba(210, 153, 34, 0.15);
  color: var(--warning);
  border: 1px solid rgba(210, 153, 34, 0.3);
}

.severity-info {
  background: rgba(88, 166, 255, 0.15);
  color: var(--info);
  border: 1px solid rgba(88, 166, 255, 0.3);
}

.issue-title {
  font-size: 0.925rem;
  font-weight: 600;
  color: var(--text-primary);
}

.issue-line-ref {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  background: var(--bg-tertiary);
  padding: 2px 8px;
  border-radius: 4px;
}

.issue-description {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}

.issue-suggestion {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.issue-suggestion-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg-tertiary);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.issue-suggestion pre {
  margin: 0;
  padding: 14px;
  overflow-x: auto;
  font-size: 0.8rem;
  line-height: 1.55;
  background: var(--bg-primary) !important;
}

.issue-suggestion code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: none !important;
}

/* --- Report Actions --- */
.report-actions {
  display: flex;
  gap: 12px;
  padding-top: 8px;
}

@media (max-width: 480px) {
  .report-actions {
    flex-direction: column;
  }

  .report-actions .btn {
    justify-content: center;
  }
}

/* --- No Issues State --- */
.no-issues {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px;
  text-align: center;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.no-issues-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.no-issues p {
  font-size: 0.875rem;
}

/* --- Loading State for Report Panel --- */
.report-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 40px;
  text-align: center;
}

.report-loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 20px;
}

.report-loading h3 {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.report-loading p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* --- Error State for Report Panel --- */
.report-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 40px;
  text-align: center;
}

.report-error-icon {
  font-size: 3rem;
  margin-bottom: 14px;
}

.report-error h3 {
  font-size: 1.1rem;
  color: var(--danger);
  margin-bottom: 8px;
}

.report-error p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  max-width: 320px;
  line-height: 1.5;
}
