/**
 * MI – App overrides (theme.css + Semantic UI for components)
 */
* { box-sizing: border-box; }

/* Session page waveform animation */
.session-page .waveform span { animation: wave 0.8s ease-in-out infinite; }
.session-page .waveform span:nth-child(2) { animation-delay: 0.1s; }
.session-page .waveform span:nth-child(3) { animation-delay: 0.2s; }
.session-page .waveform span:nth-child(4) { animation-delay: 0.3s; }
.session-page .waveform span:nth-child(5) { animation-delay: 0.4s; }
@keyframes wave { 0%, 100% { transform: scaleY(0.5); } 50% { transform: scaleY(1); } }

/* Transcript: conversation chat UI */
.chat-conversation {
  max-height: 28rem;
  overflow-y: auto;
  padding: 0.5rem 0;
}
.chat-message {
  display: flex;
  align-items: flex-end;
  margin-bottom: 1rem;
  gap: 0.5rem;
}
.chat-message--agent {
  flex-direction: row;
}
.chat-message--candidate {
  flex-direction: row-reverse;
}
.chat-message__avatar {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.06);
  border-radius: 50%;
  font-size: 1rem;
}
.chat-message__avatar .icon { margin: 0; }
.chat-message--agent .chat-message__avatar { color: #666; }
.chat-message--candidate .chat-message__avatar { color: var(--mi-primary, #0d9488); }
.chat-message__bubble {
  max-width: 75%;
  padding: 0.6rem 1rem;
  border-radius: 1rem;
  line-height: 1.4;
}
.chat-message--agent .chat-message__bubble {
  background: #f0f0f0;
  color: #1b1c1d;
  border-bottom-left-radius: 0.25rem;
}
.chat-message--candidate .chat-message__bubble {
  background: var(--mi-primary, #0d9488);
  color: #fff;
  border-bottom-right-radius: 0.25rem;
}
.chat-message__name {
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
  opacity: 0.9;
}
.chat-message__text {
  font-size: 0.95rem;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Score section: card-based rings with track and band labels */
.report-section--scores {
  padding: 2rem 1.5rem;
}

.report-section__title--hero {
  text-align: center;
  margin-bottom: 0.25rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.report-section__subtitle--hero {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 0.9375rem;
  color: var(--mi-text-muted, #64748b);
}

.scores-hero {
  display: flex;
  justify-content: center;
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(0,0,0,.06);
}

.scores-hero__main {
  display: flex;
  justify-content: center;
}

.score-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Ring container – hero larger, with animation */
.score-card__ring-wrap {
  position: relative;
  width: 180px;
  height: 180px;
  flex-shrink: 0;
}

.score-card__ring-wrap--hero {
  width: 220px;
  height: 220px;
}

.score-card__ring-wrap--hero .score-card__ring {
  mask: radial-gradient(farthest-side, transparent calc(100% - 16px), #fff calc(100% - 16px));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 16px), #fff calc(100% - 16px));
  animation: score-ring-in 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  opacity: 0;
}

@keyframes score-ring-in {
  to { opacity: 1; }
}

.score-card__ring-wrap--hero .score-card__center {
  inset: 16px;
  animation: score-center-in 0.5s ease-out 0.2s both;
}

@keyframes score-center-in {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.score-card__center--hero {
  gap: 0.25rem;
}

.score-card__value--hero {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.score-card__ring-wrap--hero .score-card__track {
  border-width: 5px;
  background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
  border-color: #e2e8f0;
}

.score-card__ring-wrap--sm {
  width: 160px;
  height: 160px;
}

.score-card__ring-wrap--sm .score-card__ring {
  animation: score-ring-in 0.6s cubic-bezier(0.34, 1.2, 0.64, 1) forwards;
  opacity: 0;
}
.score-card--breakdown:nth-child(1) .score-card__ring { animation-delay: 0.15s; }
.score-card--breakdown:nth-child(2) .score-card__ring { animation-delay: 0.25s; }
.score-card--breakdown:nth-child(3) .score-card__ring { animation-delay: 0.35s; }

.score-card__track {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border: 3px solid #e2e8f0;
  transition: border-color 0.2s ease;
}

.score-card--breakdown:hover .score-card__track {
  border-color: #cbd5e1;
}

/* Progress ring – gradient and subtle glow */
.score-card__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    var(--score-color, #0d9488) 0deg,
    var(--score-color, #0d9488) var(--score-deg),
    transparent var(--score-deg),
    transparent 360deg
  );
  mask: radial-gradient(farthest-side, transparent calc(100% - 10px), #fff calc(100% - 10px));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 10px), #fff calc(100% - 10px));
  transition: filter 0.25s ease;
}

.score-card__ring-wrap--hero .score-card__ring {
  filter: drop-shadow(0 0 12px rgba(5, 150, 105, 0.25));
}

.score-card__ring--job-fit {
  --score-color: var(--mi-success, #059669);
}
.score-card__ring-wrap--hero .score-card__ring--job-fit {
  filter: drop-shadow(0 0 14px rgba(5, 150, 105, 0.3));
}

.score-card__ring--technical {
  --score-color: var(--mi-primary, #0d9488);
}
.score-card--technical:hover .score-card__ring {
  filter: drop-shadow(0 0 8px rgba(13, 148, 136, 0.2));
}

.score-card__ring--communication {
  --score-color: var(--mi-accent, #f59e0b);
}
.score-card--communication:hover .score-card__ring {
  filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.2));
}

.score-card__ring--confidence {
  --score-color: var(--mi-info, #0284c7);
}
.score-card--confidence:hover .score-card__ring {
  filter: drop-shadow(0 0 8px rgba(2, 132, 199, 0.2));
}

/* Center circle – glass-style for hero, clean for breakdown */
.score-card__center {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,.04), 0 2px 8px rgba(0,0,0,.04), inset 0 1px 0 rgba(255,255,255,.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1;
  gap: 0.2rem;
  padding: 0.5rem;
  box-sizing: border-box;
}

.score-card__ring-wrap--hero .score-card__center {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 0 0 1px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.06), inset 0 1px 0 rgba(255,255,255,.9);
}

.score-card--breakdown .score-card__center {
  gap: 0.35rem;
  padding: 0.5rem;
}

.score-card__value {
  font-size: 1.875rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.score-card--breakdown .score-card__value {
  font-size: 1.75rem;
}

.score-card__value small {
  font-size: 0.5em;
  font-weight: 700;
  opacity: 0.7;
  margin-left: 2px;
  letter-spacing: -0.02em;
}

.score-card__label {
  font-size: 0.6875rem;
  font-weight: 700;
  color: #64748b;
  margin-top: 0.15rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.score-band {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  max-width: 100%;
  margin-top: 0.5rem;
  padding: 0.4rem 0.875rem;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  white-space: nowrap;
  box-sizing: border-box;
  line-height: 1.2;
  text-align: center;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

.score-card--breakdown .score-band {
  min-height: 1.5rem;
  min-width: 0;
  max-width: 90%;
  margin-top: 0.4rem;
  padding: 0.3rem 0.6rem;
  font-size: 0.5625rem;
  letter-spacing: 0.03em;
}

.score-band--excellent {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.18) 0%, rgba(5, 150, 105, 0.2) 100%);
  color: #047857;
  border-color: rgba(5, 150, 105, 0.35);
}

.score-band--good {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12) 0%, rgba(37, 99, 235, 0.15) 100%);
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.3);
}

.score-band--fair {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18) 0%, rgba(217, 119, 6, 0.2) 100%);
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.4);
}

.score-band--low {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12) 0%, rgba(220, 38, 38, 0.18) 100%);
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.35);
}

.score-card__rationale {
  margin: 1.25rem 0 0;
  max-width: 420px;
  font-size: 0.9rem;
  color: #475569;
  line-height: 1.5;
}

.report-section__title--scores {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.report-section__subtitle {
  margin: 0 0 1.5rem;
  font-size: 0.9rem;
  color: var(--mi-text-muted, #64748b);
}

.score-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
  align-items: stretch;
}

.score-card--breakdown {
  flex: 1;
  min-width: 180px;
  max-width: 220px;
  animation: score-card-in 0.5s ease-out backwards;
}

.score-card--breakdown:nth-child(1) { animation-delay: 0.05s; }
.score-card--breakdown:nth-child(2) { animation-delay: 0.15s; }
.score-card--breakdown:nth-child(3) { animation-delay: 0.25s; }

@keyframes score-card-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.score-card__inner {
  width: 100%;
  min-height: 240px;
  padding: 1.5rem 1rem;
  background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.score-card--breakdown:hover .score-card__inner {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  border-color: #cbd5e1;
}

@media (max-width: 640px) {
  .report-section--scores {
    padding: 1.5rem 1rem;
  }
  .score-card__ring-wrap--hero {
    width: 200px;
    height: 200px;
  }
  .score-card__value--hero {
    font-size: 2.25rem;
  }
  .score-cards {
    gap: 1.25rem;
  }
  .score-card--breakdown {
    min-width: 0;
    flex: 1 1 160px;
  }
  .score-card__inner {
    min-height: 220px;
    padding: 1.25rem 0.75rem;
  }
  .score-card__ring-wrap--sm {
    width: 140px;
    height: 140px;
  }
}

/* Documents (My Resumes / My Job Descriptions) */
.documents-page .ui.list .item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}
.documents-page .ui.list .item > .content.right {
  margin-left: auto;
}
.documents-page .ui.list .item .description {
  margin-top: 0.25rem;
}
.documents-page .ui.list .item .description .ui.label {
  margin-right: 0.35rem;
}

.doc-view-content {
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 70vh;
  overflow: auto;
  padding: 1rem;
  margin: 0;
  background: rgba(0,0,0,.03);
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Report page structure */
.report-page {
  max-width: 1200px;
  margin: 0 auto;
}

.report-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(0,0,0,.08);
}

.report-meta__badges {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.report-meta__date {
  font-size: 0.875rem;
  color: rgba(0,0,0,.55);
}

.report-meta__id code {
  font-size: 0.8rem;
  padding: 0.2rem 0.4rem;
  background: rgba(0,0,0,.06);
  border-radius: 4px;
  color: rgba(0,0,0,.7);
}

.report-section {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  border: 1px solid rgba(0,0,0,.06);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

.report-section__title {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: #1b1c1d;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.report-section__title .icon,
.report-section__title .report-icon {
  opacity: 0.9;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}
.report-section__title .report-icon svg {
  color: inherit;
}

.report-section__title--category {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(0,0,0,.08);
}

.report-subtitle {
  margin: 0.75rem 0 0.35rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(0,0,0,.75);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.report-subtitle .icon,
.report-subtitle .report-icon {
  opacity: 0.9;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}
.report-subtitle .report-icon svg {
  color: inherit;
}

.report-section--insights .report-subtitle:first-of-type {
  margin-top: 0;
}

.report-section--scores {
  padding: 1.5rem;
}

.report-section--summary {
  padding: 0 1.5rem 1rem;
}

.report-summary {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
  color: rgba(0,0,0,.85);
  white-space: pre-line;
}

.report-section--transcript .chat-conversation {
  max-height: 26rem;
}

.report-audio {
  width: 100%;
  max-width: 100%;
  height: 40px;
}

.report-grid {
  margin-top: 0;
}

.report-grid .ten.wide.column .report-section:last-child {
  margin-bottom: 0;
}

.report-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.report-list__item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.4rem 0;
  font-size: 0.95rem;
  line-height: 1.4;
}

.report-list__item .icon,
.report-list__item .report-list-icon {
  flex-shrink: 0;
  margin-top: 0.2rem;
  display: inline-flex;
  align-items: flex-start;
}

.report-list--success .report-list__item .icon,
.report-list--success .report-list-icon--success { color: var(--mi-success, #059669); }
.report-list--success .report-list-icon--success svg { color: inherit; }

.report-list--warning .report-list__item .icon,
.report-list--warning .report-list-icon--warning { color: var(--mi-warning, #d97706); }
.report-list--warning .report-list-icon--warning svg { color: inherit; }

.report-empty {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(0,0,0,.5);
}

.report-section--status {
  margin-bottom: 0;
}

.report-section--status .ui.message {
  margin: 0;
}
