/* ================================================
   ELIO — V2 Analysis Detail Styles
   Matches class names from renderCallDetailV2()
   ================================================ */

/* ================================================
   HERO: Score + Veredicto
   ================================================ */
.v2-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  padding: 20px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.v2-score-block {
  text-align: center;
  flex-shrink: 0;
}

.v2-score-big {
  font-size: 48px;
  font-weight: 700;
  font-family: var(--font-mono);
  line-height: 1;
  margin-bottom: 4px;
}

.v2-score-big.high { color: var(--green); }
.v2-score-big.mid { color: var(--amber); }
.v2-score-big.low { color: var(--red); }

.v2-score-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--t4);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.v2-veredicto {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-2);
}

.v2-veredicto.closed {
  background: var(--green-soft);
}

.v2-veredicto.lost {
  background: var(--red-soft);
}

.v2-veredicto.maybe {
  background: var(--amber-soft);
}

.v2-veredicto-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

.v2-veredicto-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--t1);
  margin-bottom: 4px;
}

.v2-veredicto-reason {
  font-size: 13px;
  color: var(--t3);
  line-height: 1.5;
}

/* ================================================
   RESUMEN
   ================================================ */
.v2-resumen {
  font-size: 14px;
  color: var(--t2);
  line-height: 1.6;
  padding: 16px 20px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
}

/* ================================================
   CATEGORIES
   ================================================ */
.v2-categories {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.v2-category {
  padding: 16px 18px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.v2-cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.v2-cat-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--t1);
}

.v2-cat-score {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-mono);
}

.v2-cat-score.high { color: var(--green); }
.v2-cat-score.mid { color: var(--amber); }
.v2-cat-score.low { color: var(--red); }

.v2-cat-bar {
  height: 5px;
  background: var(--bg-3);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 10px;
}

.v2-cat-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s var(--ease);
}

.v2-cat-fill.high { background: var(--green); }
.v2-cat-fill.mid { background: var(--amber); }
.v2-cat-fill.low { background: var(--red); }

.v2-cat-feedback {
  font-size: 13px;
  color: var(--t2);
  line-height: 1.5;
  margin-bottom: 8px;
}

.v2-cat-moment {
  font-size: 12px;
  color: var(--t3);
  padding: 6px 10px;
  background: var(--bg-2);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}

.v2-cat-moment .moment-icon {
  margin-right: 4px;
}

.v2-cat-suggestion {
  font-size: 12px;
  color: var(--accent);
  padding: 6px 10px;
  background: var(--amber-softer);
  border-radius: var(--radius-sm);
  line-height: 1.5;
}

.v2-cat-suggestion .suggestion-icon {
  margin-right: 4px;
}

/* ================================================
   OBJECTIONS
   ================================================ */
.v2-objections {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.v2-objection {
  padding: 16px 18px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.v2-obj-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.v2-obj-quote {
  font-size: 14px;
  font-weight: 500;
  color: var(--t1);
  font-style: italic;
  flex: 1;
}

.v2-obj-type {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  text-transform: capitalize;
}

.v2-obj-timestamp {
  font-size: 12px;
  color: var(--t4);
  margin-bottom: 10px;
}

.v2-obj-handling {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.v2-obj-did,
.v2-obj-should {
  font-size: 13px;
  color: var(--t2);
  line-height: 1.5;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}

.v2-obj-did {
  background: var(--bg-2);
}

.v2-obj-should {
  background: var(--amber-softer);
  border-left: 3px solid var(--accent);
}

.v2-obj-did .label,
.v2-obj-should .label {
  font-weight: 600;
  color: var(--t1);
  display: block;
  margin-bottom: 2px;
  font-size: 12px;
}

/* ================================================
   METRICS
   ================================================ */
.v2-metric-section {
  padding: 18px 20px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 14px;
}

.v2-metric-section h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--t1);
  margin-bottom: 14px;
}

/* Talk Ratio */
.v2-talk-ratio {
  margin-bottom: 8px;
}

.v2-talk-bar {
  display: flex;
  height: 28px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 6px;
}

.v2-talk-closer {
  background: var(--accent);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-mono);
}

.v2-talk-client {
  background: var(--bg-3);
  color: var(--t2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-mono);
}

.v2-talk-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--t4);
}

.v2-talk-eval {
  font-size: 13px;
  color: var(--t3);
  line-height: 1.5;
  margin-top: 8px;
}

/* Script Following */
.v2-guion-score {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}

.v2-guion-num {
  font-size: 28px;
  font-weight: 700;
  font-family: var(--font-mono);
}

.v2-guion-num.high { color: var(--green); }
.v2-guion-num.mid { color: var(--amber); }
.v2-guion-num.low { color: var(--red); }

.v2-guion-label {
  font-size: 13px;
  color: var(--t4);
}

.v2-guion-phases {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.v2-phase {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-weight: 500;
}

.v2-phase.done {
  background: var(--green-soft);
  color: var(--green);
}

.v2-phase.skipped {
  background: var(--red-soft);
  color: var(--red);
}

.v2-guion-nota {
  font-size: 13px;
  color: var(--t3);
  line-height: 1.5;
}

/* Filler Words */
.v2-filler-total {
  font-size: 14px;
  font-weight: 500;
  color: var(--t1);
  margin-bottom: 10px;
}

.v2-filler-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.v2-filler-tag {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-2);
  color: var(--t2);
}

.v2-filler-tag strong {
  color: var(--t1);
  font-family: var(--font-mono);
}

.v2-filler-worst {
  font-size: 13px;
  color: var(--red);
  padding: 8px 12px;
  background: var(--red-soft);
  border-radius: var(--radius-sm);
}

/* ================================================
   FEEDBACK
   ================================================ */
.v2-feedback-section {
  margin-bottom: 20px;
}

.v2-feedback-section h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--t1);
  margin-bottom: 12px;
}

.v2-strengths-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.v2-strengths-list li {
  font-size: 13px;
  color: var(--t2);
  line-height: 1.5;
  padding: 10px 14px;
  background: var(--green-soft);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--green);
}

.v2-mejora {
  padding: 12px 14px;
  background: var(--bg-2);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  border-left: 3px solid var(--red);
}

.v2-mejora-problema {
  font-size: 13px;
  font-weight: 500;
  color: var(--t1);
  margin-bottom: 4px;
}

.v2-mejora-momento {
  font-size: 12px;
  color: var(--t4);
  margin-bottom: 6px;
}

.v2-mejora-solucion {
  font-size: 13px;
  color: var(--accent);
  line-height: 1.5;
}

.v2-diferente {
  font-size: 14px;
  color: var(--t2);
  line-height: 1.6;
  padding: 14px 18px;
  background: var(--amber-softer);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--accent);
}

/* ================================================
   DETAIL HEADER: Editable name + Context selector
   ================================================ */
.detail-title-editable {
  cursor: pointer;
  padding: 2px 4px;
  margin: -2px -4px;
  border-radius: var(--radius-sm);
  transition: background var(--duration) var(--ease);
}

.detail-title-editable:hover {
  background: var(--bg-2);
}

.detail-title-editable:hover::after {
  content: ' ✏️';
  font-size: 14px;
  opacity: 0.5;
}

.detail-context-select {
  padding: 3px 24px 3px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  background: var(--amber-softer);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='8' height='5' viewBox='0 0 8 5' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L4 4L7 1' stroke='%23C8902E' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  outline: none;
  transition: border-color var(--duration) var(--ease);
}

.detail-context-select:hover {
  border-color: var(--accent);
}

.detail-context-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--amber-glow);
}

/* ================================================
   DETAIL MISC
   ================================================ */
.detail-type-tag {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 10px;
  border-radius: var(--radius-full);
}

.detail-type-tag.external {
  background: var(--blue-soft);
  color: var(--blue);
}

.detail-type-tag.roleplay {
  background: var(--amber-soft);
  color: var(--accent);
}

.detail-feedback {
  font-size: 14px;
  color: var(--t2);
  line-height: 1.6;
  margin-bottom: 16px;
}

.detail-list-section {
  margin-bottom: 16px;
}

.detail-list-section h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.detail-list-section ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail-list-section ul li {
  font-size: 13px;
  color: var(--t2);
  line-height: 1.5;
  padding: 8px 12px;
  background: var(--bg-2);
  border-radius: var(--radius-sm);
}

.detail-list-section.strengths ul li {
  background: var(--green-soft);
  border-left: 3px solid var(--green);
}

.detail-list-section.improvements ul li {
  background: var(--red-soft);
  border-left: 3px solid var(--red);
}

.detail-score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.detail-score-big {
  font-size: 42px;
  font-weight: 700;
  font-family: var(--font-mono);
  line-height: 1;
}

.detail-score-big.high { color: var(--green); }
.detail-score-big.mid { color: var(--amber); }
.detail-score-big.low { color: var(--red); }

.detail-score-label {
  font-size: 12px;
  color: var(--t4);
  margin-top: 4px;
}

.no-analysis-box {
  text-align: center;
  padding: 32px 20px;
}

.detail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--t4);
  font-size: 14px;
  gap: 8px;
  padding: 40px 20px;
}

.detail-empty-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

/* ================================================
   TRANSCRIPT
   ================================================ */
.transcript-box {
  max-height: 500px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  background: var(--bg-0);
}

.transcript-line {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.5;
}

.transcript-line:last-child {
  border-bottom: none;
}

.transcript-role {
  font-weight: 600;
  font-size: 12px;
  flex-shrink: 0;
  min-width: 90px;
}

.transcript-line.closer .transcript-role {
  color: var(--accent);
}

.transcript-line.client .transcript-role {
  color: var(--blue);
}

.transcript-text {
  color: var(--t2);
}

/* ================================================
   ANALYZING SPINNER
   ================================================ */
.analyzing-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--bg-3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

.analyzing-spinner-ring {
  width: 48px;
  height: 48px;
  border: 3px solid var(--bg-3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.analyzing-icon {
  font-size: 48px;
  line-height: 1;
  margin-bottom: 8px;
}

.analyzing-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--t1);
}

.analyzing-subtitle {
  font-size: 14px;
  color: var(--t3);
}

.analyzing-skip {
  margin-top: 16px;
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 768px) {
  .v2-hero {
    flex-direction: column;
    text-align: center;
  }

  .v2-talk-bar {
    height: 24px;
  }

  .v2-obj-header {
    flex-direction: column;
    gap: 6px;
  }
}