/* Reset básico */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f5f3;
  color: #1f2933;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

/* Contenedor principal: dos columnas */
.chat-wrapper {
  display: flex;
  width: 92vw;
  height: 82vh;
  max-width: 1200px;
  background: #ffffff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.18);
}

/* Cada “dispositivo” */
.device {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #e5e7eb;
  position: relative; /* importante para overlay de idioma */
}

.device:last-child {
  border-right: none;
}

/* Cabecera inspirada en web limpia */
.device-header {
  padding: 12px 16px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-title {
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
}

.brand-subtitle {
  font-size: 0.8rem;
  color: #6b7280;
}

.role span {
  font-size: 0.8rem;
  color: #9ca3af;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Área de mensajes */
.device-main {
  flex: 1;
  padding: 16px 14px;
  overflow-y: auto;
  background: #f3f4f6;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Mensajes */
.message {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.4;
  word-wrap: break-word;
}

.message.sent {
  align-self: flex-end;
  background: #111827;
  color: #f9fafb;
}

.message.received {
  align-self: flex-start;
  background: #e5e7eb;
  color: #111827;
}

.message.system {
  align-self: center;
  background: transparent;
  color: #6b7280;
  font-size: 0.8rem;
}

/* Pie con input y botón */
.device-footer {
  padding: 10px 14px;
  display: flex;
  gap: 10px;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
}

.device-footer input[type="text"] {
  flex: 1;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #111827;
  outline: none;
  font-size: 0.9rem;
}

.device-footer input[type="text"]::placeholder {
  color: #9ca3af;
}

.device-footer button {
  padding: 8px 16px;
  border-radius: 999px;
  border: none;
  background: #111827;
  color: #f9fafb;
  font-weight: 500;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}

.device-footer button:hover {
  background: #000000;
}

.device-footer button:active {
  transform: scale(0.97);
}

/* Overlay de idioma huésped */
.language-overlay {
  position: absolute;
  inset: 0;
  background: rgba(243, 244, 246, 0.92);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

.language-card {
  background: #ffffff;
  padding: 24px 22px;
  border-radius: 18px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.15);
  max-width: 360px;
  text-align: center;
}

.language-card h2 {
  font-size: 1rem;
  margin-bottom: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.language-card p {
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 16px;
}

.language-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.language-buttons button {
  padding: 8px 14px;
  border-radius: 999px;
  border: none;
  background: #111827;
  color: #f9fafb;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}

.language-buttons button:hover {
  background: #000000;
}

.language-buttons button:active {
  transform: scale(0.97);
}

/* Scrollbar suave (opcional) */
.device-main::-webkit-scrollbar {
  width: 6px;
}

.device-main::-webkit-scrollbar-track {
  background: #f3f4f6;
}

.device-main::-webkit-scrollbar-thumb {
  background: #cbd5f5;
  border-radius: 999px;
}

.quick-replies {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.quick-reply-btn {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #111827;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.quick-reply-btn:hover {
  background: #111827;
  color: #ffffff;
  border-color: #111827;
}

.quick-replies {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.quick-reply-btn {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #111827;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.quick-reply-btn:hover {
  background: #111827;
  color: #ffffff;
  border-color: #111827;
}