/* ================================================
   ELIO V1 — Component Styles
   Insights, Coach Chat, Close Toggle, Train, Upload
   ================================================ */

/* ================================================
   INSIGHTS ROW (Llamadas overview)
   ================================================ */
.insights-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

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

.insight-card h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--t1);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.insight-card h3::before {
  font-size: 14px;
}

/* Objection items — matches both old and new class names */
.insight-objection-item,
.insight-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.insight-objection-item:last-child,
.insight-item:last-child {
  border-bottom: none;
}

.insight-rank {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-3);
  color: var(--t3);
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.insight-objection-text,
.insight-text {
  color: var(--t2);
  flex: 1;
  min-width: 0;
  font-size: 13px;
}

.insight-item.strength .insight-text {
  color: var(--t2);
  line-height: 1.4;
}

.insight-objection-type {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--amber-soft);
  color: var(--accent);
  flex-shrink: 0;
}

.insight-objection-count,
.insight-count {
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--t4);
  flex-shrink: 0;
  background: var(--bg-2);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* Focus area */
.focus-area-display {
  text-align: center;
  padding: 8px 0;
}

.focus-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--t1);
  margin-bottom: 6px;
}

.focus-score {
  font-size: 28px;
  font-weight: 700;
  font-family: var(--font-mono);
  margin-bottom: 4px;
}

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

.focus-desc {
  font-size: 12px;
  color: var(--t4);
}

/* Strengths */
.insight-strength-item {
  padding: 6px 0;
  font-size: 13px;
  color: var(--t2);
  border-bottom: 1px solid var(--border);
}

.insight-strength-item:last-child {
  border-bottom: none;
}

/* ================================================
   FILLER WORDS COMPARISON
   ================================================ */
.filler-comparison {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-top: 4px;
}

.filler-comparison.improving {
  background: var(--green-soft);
  color: var(--green);
}

.filler-comparison.worse {
  background: var(--red-soft);
  color: var(--red);
}

.filler-comparison.same {
  background: var(--bg-2);
  color: var(--t4);
}

/* ================================================
   COACH CHAT
   ================================================ */
.coach-chat {
  display: flex;
  flex-direction: column;
  height: 420px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-0);
}

.coach-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--card-bg);
}

.coach-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

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

.coach-subtitle {
  font-size: 12px;
  color: var(--t4);
}

.coach-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.coach-msg {
  max-width: 85%;
  animation: fadeIn 0.2s ease;
}

.coach-msg.user {
  align-self: flex-end;
}

.coach-msg.assistant {
  align-self: flex-start;
}

.coach-msg-content {
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  line-height: 1.5;
  color: var(--t1);
}

.coach-msg.user .coach-msg-content {
  background: var(--accent);
  color: #FFFFFF;
  border-bottom-right-radius: 4px;
}

.coach-msg.assistant .coach-msg-content {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

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

/* Typing indicator */
.typing-dots {
  display: flex;
  gap: 4px;
  padding: 12px 14px;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--t4);
  animation: typingBounce 1.2s ease infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.coach-loading {
  text-align: center;
  padding: 20px;
  color: var(--t4);
  font-size: 13px;
}

/* Input */
.coach-input-row {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  background: var(--card-bg);
}

.coach-input {
  flex: 1;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--t1);
  background: var(--bg-0);
  outline: none;
  resize: none;
  transition: border-color var(--duration) var(--ease);
}

.coach-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--amber-glow);
}

.coach-input::placeholder {
  color: var(--t4);
}

.coach-send {
  padding: 9px 16px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--accent);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background var(--duration) var(--ease);
  flex-shrink: 0;
}

.coach-send:hover {
  background: var(--accent-hover);
}

.coach-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ================================================
   PRACTICE HISTORY
   ================================================ */
.practice-history {
  margin-top: 32px;
}

.practice-history h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--t1);
  margin-bottom: 12px;
}

.practice-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.practice-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  transition: background var(--duration) var(--ease);
}

.practice-item:last-child {
  border-bottom: none;
}

.practice-item:hover {
  background: var(--bg-2);
}

.practice-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.practice-item-mode {
  font-size: 13px;
  font-weight: 500;
  color: var(--t1);
}

.practice-item-meta {
  font-size: 12px;
  color: var(--t4);
}

.practice-item-score {
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-mono);
}

/* ================================================
   CALL LIST ITEMS (Home recent)
   ================================================ */
.recent-calls-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.recent-call-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--duration) var(--ease);
}

.recent-call-item:last-child {
  border-bottom: none;
}

.recent-call-item:hover {
  background: var(--bg-2);
  margin: 0 -20px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
}

.recent-call-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.recent-call-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.recent-call-details {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.recent-call-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--t1);
}

.recent-call-meta {
  font-size: 12px;
  color: var(--t4);
  display: flex;
  align-items: center;
  gap: 4px;
}

.recent-call-score {
  font-size: 17px;
  font-weight: 700;
  font-family: var(--font-mono);
}

/* ================================================
   CATEGORY BARS (Analysis tabs)
   ================================================ */
.category-item {
  margin-bottom: 18px;
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.category-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--t1);
}

.category-score {
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-mono);
}

.category-bar {
  height: 6px;
  background: var(--bg-3);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}

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

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

.category-feedback {
  font-size: 13px;
  color: var(--t3);
  line-height: 1.5;
}

/* ================================================
   UPLOAD MODAL — Drag & Drop + Progress
   ================================================ */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  background: var(--bg-0);
  margin-bottom: 16px;
}

.upload-area:hover {
  border-color: var(--amber-border);
  background: var(--amber-softer);
}

.upload-area.dragover {
  border-color: var(--accent);
  background: var(--amber-soft);
  border-style: solid;
  transform: scale(1.01);
}

.upload-area.has-file {
  border-style: solid;
  border-color: var(--amber-border);
  background: var(--amber-softer);
  padding: 20px 24px;
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.upload-icon {
  font-size: 36px;
  line-height: 1;
  margin-bottom: 4px;
}

.upload-placeholder p {
  font-size: 14px;
  color: var(--t3);
  margin: 0;
}

.upload-placeholder .upload-link {
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
}

.upload-placeholder .upload-link:hover {
  text-decoration: underline;
}

.upload-placeholder small {
  font-size: 12px;
  color: var(--t4);
}

/* File info when selected */
.upload-file-info {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
}

.upload-file-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--amber-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.upload-file-details {
  flex: 1;
  min-width: 0;
}

.upload-file-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--t1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.upload-file-size {
  font-size: 12px;
  color: var(--t4);
  font-family: var(--font-mono);
}

.upload-file-remove {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-1);
  color: var(--t4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  transition: all var(--duration) var(--ease);
}

.upload-file-remove:hover {
  background: var(--red-soft);
  border-color: var(--red-border);
  color: var(--red);
}

/* Progress section */
#upload-progress {
  margin-top: 16px;
}

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

.progress-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--t2);
}

.progress-percent {
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--accent);
}

.progress-bar {
  height: 6px;
  background: var(--bg-3);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s var(--ease);
}

.progress-fill.complete {
  background: var(--green);
}

#upload-status {
  font-size: 12px;
  color: var(--t4);
  margin: 0;
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 1024px) {
  .insights-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .insights-row {
    grid-template-columns: 1fr;
  }

  .coach-chat {
    height: 360px;
  }
}