* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: #f5f7fa;
}

.app {
  display: flex;
  height: 90vh;
}

/* AVATAR */
.avatar-zone {
  flex: 1;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.assistant-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.assistant-header img {
  height: 40px;
}

.avatar-box {
  width: 100%;
  max-width: 720px;
  aspect-ratio: 1/1;
  border-radius: 24px;
  overflow: hidden;
  background: #000;
}

.avatar-box video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-greeting {
  text-align: center;
  margin: 16px 0;
}

.start-btn {
  padding: 14px 28px;
  font-size: 1rem;
  border-radius: 999px;
  border: none;
  background: #0075c9;
  color: white;
  cursor: pointer;
}

/* CHAT */
.chat-zone {
  width: 420px;
  border-left: 1px solid #ddd;
  display: none;
  flex-direction: column;
}

.chat {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
}

.input-area {
  padding: 12px;
  border-top: 1px solid #ddd;
}

textarea {
  width: 100%;
  height: 70px;
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .app {
    flex-direction: column;
  }

  .chat-zone {
    width: 100%;
    height: 50vh;
  }
}
/* ===============================
   CHAT ZONE
================================ */
.chat-zone {
  width: 420px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-left: 1px solid #ddd;
}

/* CABECERA CHAT */
.chat-header {
  height: 56px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #eee;
  font-weight: 600;
}

.close-chat {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
}

/* MENSAJES */
.chat {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #f7f9fc;
}

/* BURBUJAS */
.msg {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 18px;
  margin-bottom: 12px;
  line-height: 1.4;
}

.msg.user {
  background: #0075c9;
  color: white;
  margin-left: auto;
  border-bottom-right-radius: 4px;
}

.msg.bot {
  background: white;
  border: 1px solid #e0e0e0;
  border-bottom-left-radius: 4px;
}

/* INPUT */
.input-area {
  border-top: 1px solid #ddd;
  padding: 12px;
  background: white;
}

textarea {
  resize: none;
  border-radius: 12px;
  padding: 10px;
  border: 1px solid #ccc;
  font-size: 14px;
}

.actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}

#btn {
  padding: 10px 18px;
  border-radius: 999px;
  border: none;
  background: #0075c9;
  color: white;
  cursor: pointer;
}

/* ===============================
   AVATAR SIEMPRE PRESENTE
================================ */
.avatar-zone {
  position: sticky;
  top: 0;
}

/* ===============================
   MÓVIL
================================ */
@media (max-width: 900px) {

  .app {
    flex-direction: column;
    height: 100vh;
  }

  .avatar-zone {
    position: sticky;
    top: 0;
    background: #f5f7fa;
    z-index: 10;
    padding-bottom: 12px;
  }

  .chat-zone {
    width: 100%;
    height: calc(100vh - 360px);
    border-left: none;
  }

  .chat {
    flex: 1;
    overflow-y: auto;
  }

  .input-area {
    position: sticky;
    bottom: 0;
  }
}
.assistant-header img {
  height: 64px;
}
@media (max-width: 900px) {
  .assistant-header img {
    height: 56px;
  }
}
.assistant-header {
  width: 100%;
  max-width: 420px;          /* mismo ancho que el avatar */
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}
.assistant-header img {
  height: 64px;
  flex-shrink: 0;
}
.avatar-box {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}
.chat-zone {
  background: #f9fafb;
  border-left: 1px solid #e5e7eb;
}
.chat {
  background: linear-gradient(
    to bottom,
    #f9fafb 0%,
    #f5f7fa 100%
  );
}
.start-btn {
  font-size: 15px;
  padding: 14px 32px;
  box-shadow: 0 6px 16px rgba(0, 117, 201, 0.25);
}
.start-btn:hover {
  transform: translateY(-1px);
}
.avatar-box,
.chat-zone {
  border-radius: 24px;
}
.chat-zone {
  margin: 16px;
}
.msg.bot {
  background: #ffffff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.04);
}
.msg.user {
  background: linear-gradient(
    135deg,
    #0075c9,
    #005fa3
  );
}
@media (max-width: 900px) {
  .avatar-zone {
    border-bottom: 1px solid #e5e7eb;
  }
}
/* ===============================
   TOP BAR
================================ */
.top-bar {
  height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
}

.dark-toggle {
  background: none;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
}

/* Hover suave */
.dark-toggle:hover {
  background: #f3f4f6;
}
@media (max-width: 900px) {
  .top-bar {
    height: 44px;
    padding: 0 12px;
  }

  .dark-toggle {
    font-size: 12px;
    padding: 6px 12px;
  }
}
#langSelect {
  border-radius: 999px;
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  font-size: 13px;
}
