/* --- RAÍZ Y CONFIGURACIÓN GENERAL --- */
:root {
  --bg: #121212;
  --panel: #1e1e1e;
  --primary: #00f5d4;
  --secondary: #a259ff;
  --text: #e0e0e0;
  --text-muted: #888;
  --sentiment-pos: #2ecc71;
  --sentiment-neu: #f1c40f;
  --sentiment-neg: #e74c3c;
  --font-display: 'Orbitron', sans-serif;
  --font-body: 'Roboto', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
}

.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

.header {
  text-align: center;
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--primary);
}

.header h1 {
  font-family: var(--font-display);
  color: var(--primary);
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  letter-spacing: 1.5px;
}

/* --- LAYOUT PRINCIPAL --- */
.main-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* En pantallas grandes, usamos un layout de dos columnas */
@media (min-width: 992px) {
  .main-layout {
      flex-direction: row;
      align-items: flex-start;
  }
  .live-column {
      flex: 2; /* Ocupa 2/3 del espacio */
  }
  .history-column {
      flex: 1; /* Ocupa 1/3 del espacio */
      position: sticky;
      top: 1rem; /* Se queda fijo al hacer scroll */
  }
}

/* --- ESTILO DE TARJETAS (CARD) --- */
.card {
  background-color: var(--panel);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid #2a2a2a;
  margin-bottom: 1.5rem;
}

/* --- COLUMNA DE ANÁLISIS EN VIVO --- */
.control-area {
  text-align: center;
}

#control-btn {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(145deg, #202020, #1a1a1a);
  box-shadow: 8px 8px 16px #0d0d0d, -8px -8px 16px #2b2b2b;
  color: var(--primary);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}
#control-btn:active {
  box-shadow: inset 8px 8px 16px #0d0d0d, inset -8px -8px 16px #2b2b2b;
  transform: scale(0.95);
}
#control-btn.listening {
  background: var(--primary);
  color: var(--bg);
  animation: pulse 1.5s infinite;
}
.mic-icon { width: 40px; height: 40px; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 245, 212, 0.7); }
  70% { box-shadow: 0 0 0 25px rgba(0, 245, 212, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 245, 212, 0); }
}

#status-display {
  font-size: 1rem;
  color: var(--text-muted);
  margin-top: 1rem;
  height: 1.2em;
  transition: color 0.3s;
}

#live-transcript-container {
  border-left: 4px solid var(--primary);
  min-height: 50px;
}
#live-transcript:empty::before {
  content: "Tu transcripción en vivo aparecerá aquí...";
  color: var(--text-muted);
  font-style: italic;
}

.results-container .placeholder {
  text-align: center;
  color: var(--text-muted);
  border: 2px dashed #333;
}

/* --- TARJETA DE ANÁLISIS --- */
.analysis-card {
  animation: fadeIn 0.5s ease;
  border-left: 5px solid var(--secondary); /* Color por defecto */
}
.analysis-card.Positive { border-left-color: var(--sentiment-pos); }
.analysis-card.Neutral { border-left-color: var(--sentiment-neu); }
.analysis-card.Negative { border-left-color: var(--sentiment-neg); }

.analysis-card h2 { margin: 0 0 1rem; font-size: 1.4rem; color: var(--primary); }
.sentiment-display { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; font-weight: bold; margin-bottom: 1.5rem; }
.sentiment-display.Positive { color: var(--sentiment-pos); }
.sentiment-display.Neutral { color: var(--sentiment-neu); }
.sentiment-display.Negative { color: var(--sentiment-neg); }
.original-transcript { font-style: italic; color: var(--text-muted); margin-bottom: 1.5rem; border-left: 2px solid #444; padding-left: 1rem;}
.keywords-container { margin: 1.5rem 0; }
.keyword { display: inline-block; background-color: rgba(162, 89, 255, 0.2); color: var(--secondary); padding: 5px 12px; border-radius: 15px; font-size: 0.9rem; margin: 0 8px 8px 0; }
.suggestions-list h3 { margin: 1.5rem 0 1rem; font-size: 1.2rem; }
.suggestion { margin-bottom: 1rem; }
.progress-bar { width: 100%; background-color: #333; border-radius: 5px; overflow: hidden; }
.progress-bar div { height: 12px; background: linear-gradient(90deg, var(--secondary), var(--primary)); width: 0%; transition: width 0.5s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* --- COLUMNA DE HISTORIAL --- */
.history-list { list-style: none; max-height: 60vh; overflow-y: auto; }
.history-item { padding: 1rem; border-bottom: 1px solid #333; cursor: pointer; transition: background-color 0.2s; }
.history-item:last-child { border-bottom: none; }
.history-item:hover, .history-item.active { background-color: rgba(162, 89, 255, 0.1); }
.history-item .timestamp { font-size: 0.8rem; color: var(--text-muted); display: block; margin-top: 0.25rem; }
.history-item .intent { font-weight: bold; }

/* --- FOOTER --- */
.footer-actions { text-align: center; padding: 2rem 0; }
.btn {
  background-color: var(--secondary); color: white; border: none; padding: 12px 25px;
  border-radius: 8px; font-size: 1rem; cursor: pointer; font-weight: bold; transition: background-color 0.2s;
}
.btn:hover { background-color: #8a3ffc; }