/* =============================================
   AndreaAI - Unified App Styles
   Versión: 4.0 (Modo App Nativa)
   Diseño moderno con modo claro/oscuro, burbujas tipo chat,
   sidebar tipo drawer, y soporte responsive.
   ============================================= */

/* ---------- VARIABLES CSS ---------- */
:root {
  --font-system: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'SF Mono', 'Monaco', 'Menlo', 'Courier New', monospace;

  --bg-primary: #0b0f14;
  --bg-secondary: #1a1e24;
  --bg-tertiary: #252a32;
  --text-primary: #e8eaed;
  --text-secondary: #9aa3b4;
  --text-muted: #6c757d;
  --accent: #2b6ed9;
  --accent-hover: #1e5ab8;
  --accent-soft: rgba(43, 110, 217, 0.15);
  --border: #2f3540;
  --border-light: #3a404b;
  --bubble-user: #1f2c3f;
  --bubble-ai: #1e242c;
  --shadow: rgba(0, 0, 0, 0.3);
  --shadow-light: rgba(0, 0, 0, 0.1);
  --overlay: rgba(0, 0, 0, 0.5);
  --success: #28a745;
  --danger: #dc3545;
  --warning: #ffc107;
  --info: #17a2b8;
}

/* Tema claro */
body.light-theme {
  --bg-primary: #f5f7fa;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f0f2f5;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.1);
  --border: #e2e8f0;
  --border-light: #cbd5e1;
  --bubble-user: #e6f2ff;
  --bubble-ai: #ffffff;
  --shadow: rgba(0, 0, 0, 0.1);
  --shadow-light: rgba(0, 0, 0, 0.05);
  --overlay: rgba(0, 0, 0, 0.3);
}

/* ---------- RESET / GLOBAL ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-system);
  background: var(--bg-primary);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- LAYOUT PRINCIPAL ---------- */
.main-wrapper {
  display: flex;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

/* ---------- SIDEBAR (MODERNO, DRAWER EN MÓVIL) ---------- */
.sidebar {
  width: 280px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, width 0.25s ease;
  position: relative;
  z-index: 1050;
  box-shadow: 2px 0 10px var(--shadow);
  overflow: hidden;
}

/* Colapsado en escritorio (clase .collapsed) */
.sidebar.collapsed {
  width: 0;
  min-width: 0;
  border-right: none;
}

/* Drawer en móvil */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    box-shadow: none;
    border-right: 1px solid var(--border);
  }
  .sidebar.active {
    transform: translateX(0);
    box-shadow: 4px 0 20px var(--shadow);
  }
  .sidebar.collapsed {
    transform: translateX(-100%);
    width: 280px; /* Mantiene ancho para la animación */
  }
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  font-size: 18px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.brand .icon-format {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}
.gradient-text {
  background: linear-gradient(135deg, var(--accent), #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Botón nuevo chat */
.btn-new-chat {
  margin: 16px;
  padding: 12px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 30px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-new-chat:hover {
  background: var(--accent-hover);
}

/* Historial colapsable */
.history-collapsible {
  border-top: 1px solid var(--border);
  margin-top: 10px;
}
.history-collapsible-toggle {
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-secondary);
  font-weight: 500;
  user-select: none;
}
.history-collapsible-toggle i {
  transition: transform 0.2s;
}
.history-collapsible-content {
  padding: 8px 12px;
  max-height: 300px;
  overflow-y: auto;
}

/* Items del historial */
.conversation-history-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.conversation-item {
  background: var(--bg-tertiary);
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  transition: background 0.2s, border-color 0.2s;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.conversation-item:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.conversation-item.active {
  background: var(--accent);
  border-color: var(--accent);
}
.conversation-item.active .conv-title,
.conversation-item.active .conv-time {
  color: white;
}
.conv-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  overflow: hidden;
}
.conv-details {
  flex: 1;
  overflow: hidden;
}
.conv-title {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}
.conv-time {
  font-size: 11px;
  color: var(--text-secondary);
}
.btn-delete-conv {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
  opacity: 0.5;
}
.conversation-item:hover .btn-delete-conv {
  opacity: 1;
}
.btn-delete-conv:hover {
  color: var(--danger);
  background: rgba(220, 53, 69, 0.1);
}

.history-actions {
  padding: 8px 12px 12px;
}
.btn-history-action {
  width: 100%;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 8px;
  border-radius: 30px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.btn-history-action:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

/* Modo escritora en sidebar */
.writer-mode-collapsible {
  border-top: 1px solid var(--border);
  margin-top: 10px;
}
.writer-mode-toggle {
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-secondary);
  font-weight: 500;
}
.writer-mode-content {
  padding: 8px 12px;
}
.btn-new-writer {
  width: 100%;
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px;
  border-radius: 30px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-bottom: 8px;
}
.btn-new-writer:hover {
  background: var(--accent-hover);
}
.writer-history-list-sidebar {
  max-height: 200px;
  overflow-y: auto;
  background: var(--bg-tertiary);
  border-radius: 12px;
  padding: 4px;
}
.writer-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 13px;
}
.writer-history-item:hover {
  background: var(--accent-soft);
}
.writer-history-prompt {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}
.writer-history-time {
  font-size: 10px;
  color: var(--text-secondary);
  margin-right: 8px;
}
.writer-delete-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
}
.writer-delete-btn:hover {
  color: var(--danger);
}

/* Footer de sidebar */
.footer-actions {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}
.btn-config {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: 30px;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-config:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}
.toggle-sidebar-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.toggle-sidebar-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* Mobile overlay */
.mobile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--overlay);
  backdrop-filter: blur(3px);
  z-index: 1040;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.mobile-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ---------- CONTENT AREA ---------- */
.content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  overflow: hidden;
}

/* Header */
.main-header {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  min-height: 60px;
}
.main-header h2 {
  font-size: 18px;
  font-weight: 600;
  margin-left: 12px;
}
#current-model-display {
  font-size: 11px;
  background: var(--bg-tertiary);
  padding: 4px 8px;
  border-radius: 30px;
  color: var(--text-secondary);
}

/* Secciones de contenido */
.content-section {
  display: none;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}
.content-section.active {
  display: flex;
}

/* ---------- CHAT ---------- */
.chat-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

/* Burbujas de mensaje */
.message-wrapper {
  display: flex;
  animation: slideIn 0.2s ease;
}
.message-wrapper.ai {
  justify-content: flex-start;
}
.message-wrapper.user {
  justify-content: flex-end;
}

.message-content {
  max-width: 80%;
  padding: 12px 16px;
  background: var(--bubble-ai);
  border-radius: 20px 20px 20px 4px;
  box-shadow: 0 1px 2px var(--shadow);
  line-height: 1.5;
  word-wrap: break-word;
  font-size: 15px;
  color: var(--text-primary);
}
.message-wrapper.user .message-content {
  background: var(--bubble-user);
  border-radius: 20px 20px 4px 20px;
}
body.light-theme .message-wrapper.user .message-content {
  background: var(--bubble-user);
  color: var(--text-primary);
}

/* Animación */
@keyframes slideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Indicador de escritura */
.typing .message-content {
  background: var(--bg-tertiary);
  border-radius: 20px 20px 20px 4px;
  padding: 16px;
}
.typing-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
}
.typing-emotion {
  font-weight: 600;
}
.thinking-animation {
  display: flex;
  gap: 4px;
  justify-content: center;
  padding: 8px 0;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}
.empty-state img {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  margin-bottom: 16px;
}
.empty-state h2 {
  font-size: 20px;
  margin-bottom: 8px;
  color: var(--text-primary);
}
.empty-state p {
  margin-bottom: 24px;
}
.empty-state-tips {
  background: var(--bg-tertiary);
  border-radius: 16px;
  padding: 20px;
  text-align: left;
}
.empty-state-tips ul {
  margin: 12px 0 0 20px;
}
.empty-state-tips li {
  margin-bottom: 6px;
}

/* ---------- INPUT AREA ---------- */
.input-area {
  padding: 12px 20px 20px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
}
.input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--bg-tertiary);
  border-radius: 30px;
  padding: 4px 4px 4px 16px;
  border: 1px solid var(--border);
}
.input-wrapper textarea {
  flex: 1;
  background: transparent;
  border: none;
  padding: 12px 0;
  resize: none;
  max-height: 120px;
  color: var(--text-primary);
  font-size: 16px;
  outline: none;
  font-family: inherit;
  line-height: 1.5;
}
.input-wrapper textarea::placeholder {
  color: var(--text-muted);
}
.btn-thinking,
.btn-send {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, transform 0.1s;
  flex-shrink: 0;
}
.btn-thinking:hover,
.btn-send:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.btn-thinking.active {
  background: var(--accent);
  color: white;
}
.btn-send {
  background: var(--accent);
  color: white;
}
.btn-send:hover {
  background: var(--accent-hover);
  transform: scale(1.05);
}
.btn-send:active {
  transform: scale(0.95);
}

/* ---------- WRITER MODE ---------- */
#writer-mode-section {
  background: var(--bg-primary);
}
.writer-mode-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.writer-mode-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.writer-mode-header h2 {
  color: var(--accent);
  font-size: 22px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-exit-writer {
  background: var(--danger);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  transition: background 0.2s;
}
.btn-exit-writer:hover {
  background: #c82333;
}

.writer-mode-input-area {
  margin-bottom: 24px;
}
.writer-mode-input-area label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-secondary);
}
#writer-prompt {
  width: 100%;
  min-height: 120px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
  resize: vertical;
  margin-bottom: 12px;
  outline: none;
}
#writer-prompt:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.btn-generate {
  background: var(--accent);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 30px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  float: right;
}
.btn-generate:hover {
  background: var(--accent-hover);
}

.writer-mode-output-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.output-header span {
  font-weight: 500;
  color: var(--text-secondary);
}
.btn-copy {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  transition: background 0.2s, color 0.2s;
}
.btn-copy:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}
.writer-output {
  flex: 1;
  background: var(--bg-tertiary);
  border-radius: 16px;
  padding: 20px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  border: 1px solid var(--border);
  white-space: pre-wrap;
  word-wrap: break-word;
  color: var(--text-primary);
}

/* Modal de confirmación modo escritora */
.writer-mode-prompt {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--overlay);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  backdrop-filter: blur(3px);
}
.writer-prompt-content {
  background: var(--bg-secondary);
  padding: 30px;
  border-radius: 24px;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 20px 40px var(--shadow);
}
.writer-prompt-content p {
  margin-bottom: 24px;
  font-size: 16px;
  color: var(--text-primary);
}
.writer-prompt-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.writer-prompt-buttons button {
  padding: 12px 24px;
  border: none;
  border-radius: 30px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.writer-prompt-buttons button:active {
  transform: scale(0.97);
}
#writer-prompt-yes {
  background: var(--accent);
  color: white;
}
#writer-prompt-yes:hover {
  background: var(--accent-hover);
}
#writer-prompt-no {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
#writer-prompt-no:hover {
  background: var(--border);
  color: var(--text-primary);
}

/* ---------- BLOQUES DE CÓDIGO ---------- */
.code-block-wrapper {
  margin: 16px 0;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.code-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.code-lang {
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
}
.copy-code-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 20px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 11px;
  transition: background 0.2s, color 0.2s;
}
.copy-code-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}
.code-block-wrapper pre {
  padding: 16px;
  overflow-x: auto;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  background: var(--bg-tertiary);
  color: var(--text-primary);
}
.inline-code {
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--accent);
  border: 1px solid var(--border);
}

/* ---------- MARKDOWN / FORMATO ---------- */
.message-content h1,
.message-content h2,
.message-content h3 {
  margin: 1em 0 0.5em;
  font-weight: 600;
  line-height: 1.25;
}
.message-content h1 { font-size: 1.5em; border-bottom: 1px solid var(--border); padding-bottom: 0.3em; }
.message-content h2 { font-size: 1.3em; }
.message-content h3 { font-size: 1.1em; }
.message-content ul,
.message-content ol {
  padding-left: 1.5em;
  margin: 0.5em 0;
}
.message-content li {
  margin-bottom: 0.25em;
}
.message-content blockquote {
  border-left: 4px solid var(--accent);
  padding-left: 1em;
  margin: 0.5em 0;
  color: var(--text-secondary);
  font-style: italic;
}
.message-content a {
  color: var(--accent);
  text-decoration: none;
}
.message-content a:hover {
  text-decoration: underline;
}
.message-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1em 0;
}

/* ---------- NOTIFICACIONES ---------- */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 12px 20px;
  color: var(--text-primary);
  box-shadow: 0 4px 12px var(--shadow);
  z-index: 1100;
  animation: slideInRight 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 300px;
}
.notification.success {
  border-color: var(--success);
  background: rgba(40, 167, 69, 0.1);
}
.notification.error {
  border-color: var(--danger);
  background: rgba(220, 53, 69, 0.1);
}
.notification.info {
  border-color: var(--info);
  background: rgba(23, 162, 184, 0.1);
}
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ---------- UTILIDADES ---------- */
.text-center { text-align: center; }
.opacity-50 { opacity: 0.5; }
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 30px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 11px;
}

/* Scroll personalizado */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}

/* ---------- MEDIA QUERIES ---------- */
@media (max-width: 768px) {
  .message-content {
    max-width: 90%;
    font-size: 16px;
  }
  .input-wrapper {
    padding-left: 12px;
  }
  .btn-thinking,
  .btn-send {
    width: 48px;
    height: 48px;
  }
  .empty-state img {
    width: 56px;
    height: 56px;
  }
  .writer-mode-container {
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .message-content {
    max-width: 95%;
    padding: 10px 14px;
  }
  .main-header h2 {
    font-size: 16px;
  }
  .brand {
    padding: 16px;
  }
  .btn-new-chat {
    margin: 12px;
  }
  .writer-prompt-content {
    margin: 0 16px;
    padding: 24px;
  }
}

@media (min-width: 1600px) {
  .chat-container {
    max-width: 1200px;
    margin: 0 auto;
  }
  .message-content {
    max-width: 70%;
  }
}

/* ========== NUEVOS ESTILOS PARA EFECTOS ========== */

/* Auto-crecimiento del textarea (ya lo maneja JS, pero podemos darle un max-height) */
#user-input {
    max-height: 200px;
    overflow-y: auto;
}

/* Indicador de escritura simple (puntos animados) */
.simple-spinner {
    display: flex;
    gap: 4px;
    justify-content: center;
    padding: 8px 0;
    font-size: 24px;
    line-height: 1;
    color: var(--text-secondary);
}

.simple-spinner span {
    animation: bounce 1.4s infinite ease-in-out both;
}

.simple-spinner span:nth-child(1) { animation-delay: -0.32s; }
.simple-spinner span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Modo pensamiento profundo (línea de estado) */
.thinking-deep {
    background: var(--bg-tertiary);
    border-left: 4px solid var(--accent);
}
.typing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}
.typing-emotion {
    font-weight: 600;
}
.typing-stage {
    color: var(--text-secondary);
    font-style: italic;
}

/* Efecto máquina de escribir (el texto se muestra normalmente) */
.message-content {
    white-space: pre-wrap; /* respeta saltos de línea */
}