/* Elyxta Chat - front-end (Figma: AcDO2cXyjLmWzIw2Ij5XCZ node 152-222) */

:root {
  --elyxta-bg: #fcfffd;
  --elyxta-primary: #2a57f2;
  --elyxta-text: #001355;
  --elyxta-placeholder: rgba(42, 87, 242, 0.6);
  --elyxta-chip-bg: rgba(42, 87, 242, 0.1);
  --elyxta-chip-text: rgba(0, 19, 85, 0.48);
  --elyxta-font: "Unbounded", sans-serif;
}

/* ----- Input card (shortcode) ----- */
.elyxta-chat-form {
  max-width: 100%;
  background: var(--elyxta-bg);
  border: none;
  border-radius: 20px;
  box-shadow: 0 4px 24px rgba(42, 87, 242, 0.08);
  overflow: hidden;
  font-family: var(--elyxta-font);
}

.elyxta-chat-form-inner {
  padding: 28px 48px 28px 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.elyxta-chat-input {
  width: 100%;
  min-height: 70px;
  padding: 12px 0;
  border: none;
  resize: vertical;
  font-family: var(--elyxta-font);
  font-weight: 300;
  font-size: 18px;
  line-height: 1.11;
  color: var(--elyxta-text);
  background: transparent;
}

.elyxta-chat-input::placeholder {
  color: var(--elyxta-placeholder);
}

.elyxta-chat-input:focus {
  outline: none;
}

.elyxta-chat-form-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.elyxta-chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
  flex: 1;
  min-width: 0;
}

.elyxta-chat-chip {
  padding: 0 16px;
  height: 24px;
  line-height: 24px;
  border: none;
  border-radius: 20px;
  background: var(--elyxta-chip-bg);
  color: var(--elyxta-chip-text);
  font-family: var(--elyxta-font);
  font-weight: 300;
  font-size: 14px;
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s,
    opacity 0.2s;
}

.elyxta-chat-chip:hover {
  background: rgba(42, 87, 242, 0.18);
  color: rgba(0, 19, 85, 0.7);
}

.elyxta-chat-send {
  width: 62px;
  height: 62px;
  min-width: 62px;
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  background: transparent;
  align-items: center;
  justify-content: center;
  transition:
    filter 0.2s,
    opacity 0.2s,
    transform 0.15s;
}

.elyxta-chat-send:hover {
  opacity: 0.7;
}

.elyxta-chat-send:active {
  transform: scale(0.96);
}

.elyxta-chat-send-text {
  position: absolute;
  width: 1px;
  height: 1px;
  clip: rect(0, 0, 0, 0);
  overflow: hidden;
}

/* ----- Popup ----- */
.elyxta-chat-popup {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.elyxta-chat-popup[hidden] {
  display: none !important;
}

.elyxta-chat-popup-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

/* ----- Popup: Figma 212-5 (chat window) ----- */
.elyxta-chat-popup-dialog {
  position: relative;
  width: 100%;
  max-width: 1300px;
  max-height: 90vh;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--elyxta-font);
}

.elyxta-chat-popup-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  color: #cccccc;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition:
    color 0.2s,
    background 0.2s;
}

.elyxta-chat-popup-close:hover {
  color: #999999;
  background: rgba(0, 0, 0, 0.04);
}

.elyxta-chat-popup-close svg {
  width: 100%;
  height: 100%;
}

.elyxta-chat-popup-messages {
  flex: 1;
  overflow-y: auto;
  padding: 48px 48px 24px 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 200px;
  scrollbar-width: thin;
  scrollbar-color: #d9d9d9 #f7f6f6;
}

.elyxta-chat-popup-messages::-webkit-scrollbar {
  width: 11px;
}

.elyxta-chat-popup-messages::-webkit-scrollbar-track {
  background: #f7f6f6;
  border-radius: 20px;
}

.elyxta-chat-popup-messages::-webkit-scrollbar-thumb {
  background: #d9d9d9;
  border-radius: 20px;
}

.elyxta-chat-popup-messages::-webkit-scrollbar-thumb:hover {
  background: #c5c5c5;
}

/* Input area in popup: Figma #F4F4F4 */
.elyxta-chat-popup-input-wrap {
  padding: 24px 48px 32px;
}

.elyxta-chat-popup-input-wrap .elyxta-chat-form {
  border-radius: 20px;
  background: #f4f4f4;
  box-shadow: none;
}

.elyxta-chat-popup-input-wrap .elyxta-chat-form-inner {
  padding: 24px 48px 24px 48px;
}

.elyxta-chat-msg {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  max-width: 85%;
  font-family: var(--elyxta-font);
}

.elyxta-chat-msg-user {
  align-self: flex-end;
  flex-direction: column-reverse;
  margin-left: auto;
}

.elyxta-chat-msg-user .elyxta-chat-msg-bubble {
  background: var(--elyxta-chip-bg);
  color: #000000;
  border-radius: 16px 16px 4px 16px;
}

.elyxta-chat-msg-user .elyxta-chat-msg-text {
  font-size: 18px;
  font-weight: 300;
  line-height: 1.5;
}

.elyxta-chat-msg-user .elyxta-chat-msg-label {
  order: -1;
  align-self: flex-end;
  font-size: 14px;
  font-weight: 300;
  color: rgba(0, 0, 0, 0.22);
  margin-bottom: 4px;
}

.elyxta-chat-msg-user .elyxta-chat-msg-label .elyxta-chat-msg-time {
  display: inline;
  font-size: inherit;
  margin-top: 0;
}

.elyxta-chat-msg-assistant {
  align-self: flex-start;
}

.elyxta-chat-msg-assistant .elyxta-chat-msg-bubble {
  background: transparent;
  color: #000000;
  border-radius: 16px 16px 16px 4px;
}

.elyxta-chat-msg-assistant .elyxta-chat-msg-text {
  font-size: 18px;
  font-weight: 300;
  line-height: 1.5;
}

.elyxta-chat-avatar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.elyxta-chat-msg-avatar {
  width: 108px;
  height: 108px;
  min-width: 108px;
  border-radius: 50%;
  background-image: url("../images/ai-agent.png");
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.elyxta-chat-avatar-col .elyxta-chat-msg-name {
  font-size: 28px;
  font-weight: 700;
  color: var(--elyxta-primary);
  text-align: center;
}

.elyxta-chat-msg-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.elyxta-chat-msg-bubble {
  padding: 12px 30px;
  font-size: 18px;
  font-weight: 300;
  line-height: 1.5;
}

.elyxta-chat-msg-text {
  white-space: pre-wrap;
  word-break: break-word;
}

.elyxta-chat-msg-time {
  display: block;
  font-size: 14px;
  font-weight: 300;
  color: rgba(0, 0, 0, 0.22);
  margin-top: 4px;
}

/* Messenger CTA block */
.elyxta-chat-messenger-cta {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(42, 87, 242, 0.2);
  border-radius: 14px;
  background: rgba(42, 87, 242, 0.04);
}

.elyxta-chat-messenger-cta-title {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.45;
  color: #001355;
}

.elyxta-chat-messenger-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 8px;
}

.elyxta-chat-messenger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  min-height: 44px;
  padding: 8px 12px;
  text-decoration: none;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  transition: transform 0.15s, opacity 0.2s, filter 0.2s;
}

.elyxta-chat-messenger-btn:hover {
  color: #fff;
  filter: brightness(1.04);
}

.elyxta-chat-messenger-btn:active {
  transform: scale(0.98);
}

.elyxta-chat-messenger-btn.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.elyxta-chat-messenger-btn-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
}

.elyxta-chat-messenger-btn-icon svg {
  width: 100%;
  height: 100%;
}

.elyxta-chat-messenger-btn-whatsapp {
  background: #25d366;
}

.elyxta-chat-messenger-btn-telegram {
  background: #229ed9;
}

.elyxta-chat-messenger-btn-vk {
  background: #0077ff;
}

.elyxta-chat-messenger-btn-instagram {
  background: #d62976;
}

.elyxta-chat-lead-form {
  margin-top: 12px;
}

.elyxta-chat-lead-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  line-height: 1.4;
}

.elyxta-chat-lead-row {
  display: flex;
  gap: 8px;
}

.elyxta-chat-lead-input {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(0, 19, 85, 0.25);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: var(--elyxta-font);
}

.elyxta-chat-lead-submit {
  border: none;
  border-radius: 8px;
  background: #2a57f2;
  color: #fff;
  font-size: 13px;
  font-family: var(--elyxta-font);
  padding: 0 14px;
  cursor: pointer;
}

.elyxta-chat-lead-submit:disabled {
  opacity: 0.6;
  cursor: default;
}

.elyxta-chat-lead-status {
  margin-top: 6px;
  font-size: 12px;
  color: #2b8f2b;
  min-height: 16px;
}

.elyxta-chat-lead-status.is-error {
  color: #d64545;
}

/* Typing indicator (loading) */
.elyxta-chat-msg-loading .elyxta-chat-msg-bubble {
  min-height: 24px;
}

.elyxta-chat-msg-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 0;
}

.elyxta-chat-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--elyxta-primary);
  opacity: 0.5;
  animation: elyxta-typing-bounce 1.4s ease-in-out infinite both;
}

.elyxta-chat-typing-dot:nth-child(1) {
  animation-delay: 0s;
}
.elyxta-chat-typing-dot:nth-child(2) {
  animation-delay: 0.16s;
}
.elyxta-chat-typing-dot:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes elyxta-typing-bounce {
  0%,
  80%,
  100% {
    transform: translateY(0) scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: translateY(-6px) scale(1);
    opacity: 1;
  }
}

/* ----- Cards ----- */
.elyxta-chat-msg-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.elyxta-chat-card {
  border: 1px solid rgba(42, 87, 242, 0.15);
  border-radius: 12px;
  padding: 16px;
  background: #fff;
  min-width: 200px;
  max-width: 280px;
}

.elyxta-chat-card-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 8px;
}

.elyxta-chat-card-title {
  font-weight: 500;
  color: var(--elyxta-text);
}

.elyxta-chat-card-subtitle {
  font-size: 14px;
  font-weight: 300;
  color: var(--elyxta-chip-text);
}

.elyxta-chat-card-meta {
  display: flex;
  gap: 12px;
  font-size: 14px;
  font-weight: 300;
  color: var(--elyxta-chip-text);
  margin-bottom: 8px;
}

.elyxta-chat-card-price {
  margin-bottom: 8px;
}

.elyxta-chat-card-price-current {
  font-weight: 500;
  color: var(--elyxta-primary);
}

.elyxta-chat-card-price-old {
  text-decoration: line-through;
  color: var(--elyxta-chip-text);
  margin-left: 8px;
  font-size: 14px;
}

.elyxta-chat-card-desc {
  font-size: 14px;
  font-weight: 300;
  color: var(--elyxta-chip-text);
  margin: 8px 0 12px;
  line-height: 1.4;
}

.elyxta-chat-card-book {
  display: inline-block;
  padding: 10px 20px;
  background: var(--elyxta-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: var(--elyxta-font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.2s;
  margin-bottom: 8px;
}

.elyxta-chat-card-book:hover {
  filter: brightness(1.1);
  color: #fff;
}

.elyxta-chat-card-more {
  display: block;
  background: none;
  border: none;
  color: var(--elyxta-primary);
  font-family: var(--elyxta-font);
  font-size: 14px;
  font-weight: 300;
  cursor: pointer;
  padding: 4px 0;
}

.elyxta-chat-card-more:hover {
  text-decoration: underline;
}

/* Body scroll lock when popup open */
body.elyxta-chat-popup-open {
  overflow: hidden;
}
.tours--chat {
  gap: 24px;
}
.tours--chat .tour-item__big-name {
  font-size: 20px;
}
.tours--chat .tour-item__tarif {
  font-size: 16px;
}
.tours--chat .tour-item__hot {
  font-size: 12px;
}
.tours--chat .tour-item__hot-svg {
  width: 12px;
}
.tours--chat .tour-item__hot {
  gap: 6px;
}
.tours--chat .tour-item__time,
.tours--chat .tour-item__volume {
  font-size: 11px;
}
.tours--chat .tour-item__sell-price {
  font-size: 18px;
}
.tours--chat .tour-item__sell-price > span {
  font-size: 11px;
}
.tours--chat .tour-item__old-price {
  font-size: 12px;
  margin-top: 6px;
}
.tours--chat .tour-item__price-desc {
  font-size: 10px;
}
.tours--chat .advantage-item {
  font-size: 12px;
}
.tours--chat .tour-item__button {
  padding: 8px 13px;
  font-size: 12px;
  width: 85%;
}
.tours--chat .tour-item {
  padding-bottom: 156px;
}
@media (max-width: 1250px) {
  .elyxta-chat-msg-assistant .elyxta-chat-msg-text,
  .elyxta-chat-msg-user .elyxta-chat-msg-text {
    font-size: 15px;
  }
  .elyxta-chat-avatar-col .elyxta-chat-msg-name {
    font-size: 20px;
  }
  .elyxta-chat-msg-avatar {
    width: 80px;
    height: 80px;
    min-width: 80px;
  }
  .elyxta-chat-popup-input-wrap .elyxta-chat-form-inner {
    padding: 6px 24px 24px 24px;
  }
}
@media (max-width: 1135px) {
  .elyxta-chat-msg {
    max-width: 100%;
  }
}
@media (max-width: 991px) {
  .elyxta-chat-form-inner {
    padding: 6px 24px 24px 24px;
  }
  .elyxta-chat-input {
    font-size: 15px;
  }
  .elyxta-chat-chip {
    font-size: 12px;
  }
  .elyxta-chat-send {
    width: 40px;
    height: 40px;
    min-width: 40px;
  }
  .tours--chat {
    align-items: flex-start;
  }
  .elyxta-chat-msg-bubble {
    padding: 12px 15px;
  }
  .elyxta-chat-avatar-col .elyxta-chat-msg-name {
    font-size: 16px;
  }
}
@media (max-width: 645px) {
  .elyxta-chat-msg {
    flex-direction: column;
    gap: 4px;
    max-width: 100%;
  }
  .elyxta-chat-msg-content .elyxta-chat-msg-bubble {
    padding: 4px 6px;
  }
}
@media (max-width: 530px) {
  .elyxta-chat-messenger-grid {
    grid-template-columns: 1fr;
  }
  .elyxta-chat-lead-row {
    flex-direction: column;
  }
  .elyxta-chat-lead-submit {
    min-height: 40px;
  }
  .elyxta-chat-input {
    font-size: 13px;
  }
  .elyxta-chat-chip:last-child {
    display: none;
  }
  .elyxta-chat-popup-messages {
    padding: 25px 25px 24px 25px;
  }
  .elyxta-chat-popup-input-wrap {
    padding: 20px;
  }
  .elyxta-chat-input {
    font-size: 14px;
  }
  .elyxta-chat-msg-time {
    font-size: 12px;
  }
  .elyxta-chat-msg-assistant .elyxta-chat-msg-text,
  .elyxta-chat-msg-user .elyxta-chat-msg-text {
    font-size: 14px;
  }
  .elyxta-chat-msg-content .elyxta-chat-msg-bubble {
    padding: 7px 0;
  }
}
@media (max-width: 480px) {
  .elyxta-chat-msg-bubble {
    padding: 7px 15px;
  }
  .elyxta-chat-msg-avatar {
    width: 50px;
    height: 50px;
    min-width: 50px;
  }
  .elyxta-chat-avatar-col .elyxta-chat-msg-name {
    font-size: 13px;
  }
  .elyxta-chat-avatar-col {
    gap: 4px;
  }
  .elyxta-chat-popup-input-wrap .elyxta-chat-form-inner {
    padding: 3px 15px 15px 15px;
  }
}
