/* ========================================================
   CHAT EFÍMERO DE 5 MINUTOS - LIVE ECHOES
   Diseño sobrio y limpio estilo Signal / Telegram Secret Chat
   ======================================================== */

.chat-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-fast), visibility var(--transition-fast);
}

.chat-modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.chat-modal-window {
  width: 100%;
  max-width: 480px;
  height: 600px;
  max-height: 90vh;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  transform: translateY(12px);
  transition: transform var(--transition-normal);
}

.chat-modal-backdrop.active .chat-modal-window {
  transform: translateY(0);
}

/* Encabezado del Chat */
.chat-header {
  padding: 0.85rem 1.15rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chat-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-partner-info {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.partner-avatar {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-xs);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.partner-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.partner-badge {
  font-size: 0.68rem;
  color: var(--accent-emerald);
  font-weight: 500;
}

/* Temporizador 5:00 limpio */
.timer-pill {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: monospace;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.timer-pill.warning {
  color: var(--accent-amber);
  border-color: var(--accent-amber);
}

.timer-pill.danger {
  color: var(--accent-red);
  border-color: var(--accent-red);
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-extend-time {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-extend-time:hover:not(:disabled) {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-extend-time:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-close-chat {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-size: 1.15rem;
  cursor: pointer;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-xs);
  transition: color var(--transition-fast);
}

.btn-close-chat:hover {
  color: var(--accent-red);
}

/* Snippet de confesión */
.chat-context-snippet {
  font-size: 0.76rem;
  color: var(--text-secondary);
  background: var(--bg-input);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-xs);
  border-left: 2px solid var(--border-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Rompehielos */
.chat-icebreakers-bar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  background: var(--bg-surface-elevated);
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
  scrollbar-width: none;
}

.chat-icebreakers-bar::-webkit-scrollbar {
  display: none;
}

.icebreaker-chip {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.72rem;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-fast);
}

.icebreaker-chip:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

/* Área de Mensajes */
.chat-messages-area {
  flex: 1;
  padding: 1rem 1.15rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: var(--bg-app);
}

.chat-bubble {
  max-width: 80%;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  line-height: 1.4;
  word-break: break-word;
  position: relative;
}

.chat-bubble.mine {
  align-self: flex-end;
  background: var(--accent-white);
  color: var(--accent-black);
  border-bottom-right-radius: 2px;
}

.chat-bubble.partner {
  align-self: flex-start;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-bottom-left-radius: 2px;
}

.bubble-sender {
  font-size: 0.68rem;
  color: var(--text-tertiary);
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.chat-bubble.mine .bubble-sender {
  color: rgba(0, 0, 0, 0.5);
}

.bubble-time {
  font-size: 0.62rem;
  opacity: 0.55;
  text-align: right;
  margin-top: 0.2rem;
}

/* Indicador de escritura */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 0.35rem 0.65rem;
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-full);
  align-self: flex-start;
  width: fit-content;
  border: 1px solid var(--border-subtle);
}

.typing-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-tertiary);
  animation: typingDot 1.4s infinite ease-in-out;
}

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

@keyframes typingDot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.3; }
  30% { transform: translateY(-3px); opacity: 1; }
}

/* Pie del Chat */
.chat-footer {
  padding: 0.75rem 1.15rem;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.chat-input-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chat-text-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.86rem;
  outline: none;
  font-family: inherit;
  transition: border-color var(--transition-fast);
}

.chat-text-input:focus {
  border-color: var(--border-strong);
}

.btn-send-message {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-white);
  border: none;
  color: var(--accent-black);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 700;
  transition: opacity var(--transition-fast);
}

.btn-send-message:hover {
  opacity: 0.9;
}

.chat-footer-disclaimer {
  font-size: 0.68rem;
  color: var(--text-tertiary);
  text-align: center;
}

/* Pantalla de Fin */
.chat-destruction-screen {
  position: absolute;
  inset: 0;
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
  z-index: 50;
}

.destruction-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.8;
}

.destruction-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.destruction-msg {
  font-size: 0.84rem;
  color: var(--text-secondary);
  max-width: 300px;
  margin-bottom: 1.25rem;
  line-height: 1.45;
}

.btn-exit-destroyed {
  background: var(--accent-white);
  border: none;
  color: var(--accent-black);
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
}
