/* static/style.css */

:root {
  --hotel-accent: #02b9b1;
  --hotel-accent-dark: #02b9b1;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  background-color: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

#chat-widget {
  width: 100%;
  max-width: 80%;
  height: 590px;
  border: 1px solid #ccc;
  border-radius: 15px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  background-color: #ffffff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  position: relative;
  background-color: var(--hotel-accent);
  color: white;
  padding: 5px 10px;
  text-align: center;
  font-size: 12px;
  font-weight: bold;
  min-height: 35px;
  box-sizing: border-box;
  border-radius: 15px 15px 0 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.brand-title {
  margin: 0;
  font-size: 14px;
}


#messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  background-color: #ffffff;
  scroll-behavior: auto;
  overscroll-behavior: contain;
}

.welcome-logo {
  display: block;
  margin: 0 auto 10px auto;
  width: 180px;
  height: 60px;
  object-fit: contain;
}

.welcome-logo1 {
  display: block;
  margin: 0 auto 10px auto;
  width: 220px;
  height: 120px;
  object-fit: contain;
}

.welcome-text {
  text-align: center;
  font-size: 16px;
  color: var(--hotel-accent);
  margin-bottom: 10px;
  font-weight: bold;
}

.logo-contact-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
  margin-bottom: 4px;
}

.logo-contact-row .welcome-logo {
  margin: 0;
}

.logo-contact-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  font-size: 11px;
  color: var(--hotel-accent);
  min-width: 48px;
}

.contact-icon-svg {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
  color: var(--hotel-accent);
}

.contact-icon-svg svg {
  width: 26px;
  height: 26px;
  display: block;
}

.logo-contact-btn span {
  font-size: 11px;
  color: var(--hotel-accent);
  font-weight: 600;
}

.logo-contact-btn:hover .contact-icon-svg,
.logo-contact-btn:hover span {
  color: var(--hotel-accent-dark);
}

.recognized-question-display {
  margin-top: 4px;
  font-size: 12px;
  text-align: right;
  color: #555;
}


.message.assistant.pending {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  max-width: 160px;
  padding: 10px 12px;
}

.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--hotel-accent);
  opacity: 0.35;
  animation: guestchatTyping 1s infinite ease-in-out;
}

.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.30s; }

@keyframes guestchatTyping {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.35; }
  40% { transform: translateY(-2px); opacity: 1; }
}

.message.assistant {
  background-color: #f2f2f2;
  color: #333;
  padding: 10px;
  margin: 10px 0;
  border-radius: 8px;
  line-height: 1.55;
  font-size: 15px;
  font-weight: 600;
  white-space: normal;
}

.message.assistant p {
  margin: 0 0 10px 0;
}

.message.assistant p:last-child {
  margin-bottom: 0;
}

.message.assistant ul {
  margin: 8px 0 8px 18px;
  padding: 0;
}

.message.assistant li {
  margin: 0 0 6px 0;
}

.message.assistant a {
  color: var(--hotel-accent-dark);
  text-decoration: underline;
}

.message.user {
  text-align: right;
  color: #333;
  padding: 5px;
  font-size: 14px;
  font-weight: bold;
}

.message.error {
  color: red;
  font-size: 12px;
  padding: 5px;
}

.message.system {
  font-size: 13px;
  color: #444;
  padding: 6px 0;
}

.assistant-inline-gallery {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.assistant-gallery-item {
  width: 100%;
}

.message.assistant img,
.assistant-gallery-image {
  max-width: 75% !important;
  width: 75%;
  height: auto;
  display: block;
  margin: 10px auto;
  border-radius: 8px;
}

.input-area {
  display: flex;
  padding: 10px;
  border-top: 1px solid #ccc;
  background: #fff;
}

#messageInput {
  flex: 1;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 14px;
  margin-right: 10px;
}

.send-button {
  background-color: #e22f2f;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  font-size: 14px;
  cursor: pointer;
}

.send-button:hover {
  background-color: #cc2727;
}

.chat-footer {
  display: flex;
  justify-content: space-around;
  padding: 10px;
  background-color: #ffffff;
  border-top: 1px solid #ccc;
}

.action-btn {
  background-color: var(--hotel-accent);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
}

.action-btn:hover {
  background-color: var(--hotel-accent-dark);
}

.mic-button {
  background-color: #fff;
  color: #555;
  border: 1px solid #ccc;
  padding: 10px 16px;
  border-radius: 5px;
  font-size: 14px;
  cursor: pointer;
}

.mic-button:hover {
  background-color: #f8f8f8;
}

#languagePanel {
  display: none;
  margin-top: 6px;
  text-align: center;
  padding: 4px;
}

.lang-btn {
  background: #f9f9f9;
  border: 1px solid #ccc;
  padding: 5px 8px;
  margin: 3px;
  border-radius: 5px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lang-btn img {
  width: 20px;
  height: auto;
  display: inline-block;
}

.lang-btn:hover {
  background: #eee;
}

#progressBarContainer {
  position: relative;
  width: 90%;
  height: 6px;
  display: none;
  margin: 8px auto 12px auto;
  background: rgba(242, 101, 34, 0.12);
  border: 1px solid rgba(242, 101, 34, 0.35);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.08);
}

#progressBar {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #02b9b1 0%, #02b9b1 45%, #02b9b1 100%);
  background-size: 220% 100%;
  box-shadow: 0 0 10px rgba(242,101,34,0.25);
  transition: width 0.28s ease-out, opacity 0.25s ease;
  animation: progressGlow 1.6s linear infinite;
}

#progressBar::after {
  content: "";
  position: absolute;
  top: 0;
  right: -28px;
  width: 28px;
  height: 100%;
  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.7), rgba(255,255,255,0));
  filter: blur(1px);
}

@keyframes progressGlow {
  0% { background-position: 200% 0; }
  100% { background-position: -20% 0; }
}

.quick-questions-container {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.quick-question-btn {
  border: none;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  background: #f3f3f3;
  color: #333;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  white-space: nowrap;
}

.quick-question-btn:hover {
  background: #e6e6e6;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.quick-question-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

@media screen and (max-width: 700px) {
  body {
    align-items: flex-start;
    padding: 12px 0;
  }

  #chat-widget {
    width: 100%;
    max-width: 100%;
    height: calc(100vh - 24px);
  }

  .welcome-logo {
    width: 150px;
    height: 52px;
  }

  .welcome-logo1 {
    width: 180px;
    height: 100px;
  }

  .message.assistant img,
  .assistant-gallery-image {
    width: 85%;
    max-width: 85% !important;
  }
}


@media (max-width: 640px) {
  body {
    align-items: flex-start;
    padding: 8px;
    min-height: 100dvh;
    box-sizing: border-box;
  }

  #chat-widget {
    width: 100%;
    max-width: 100%;
    height: min(78dvh, 700px);
  }

  .chat-header {
    min-height: 32px;
    padding: 6px 10px;
  }

  .brand-title {
    font-size: 13px;
  }

  #messages {
    padding: 8px;
  }

  .input-area {
    padding: 8px;
    gap: 8px;
  }

  #messageInput {
    margin-right: 0;
    min-width: 0;
  }

  .send-button {
    padding: 10px 14px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .quick-question-btn {
    padding: 9px 12px;
    font-size: 13px;
  }
}


/* --- ZEN final polish tweaks --- */

/* Ensure LINE label always uppercase */
.logo-contact-btn span {
  text-transform: uppercase;
}

/* Keep header title perfectly centred even with logo on left */
.chat-header {
  position: relative;
  justify-content: center;
}

.chat-header .header-left-logo {
  position: absolute;
  left: 10px;
  display: flex;
  align-items: center;
}

/* Slightly nicer quick button colour (hotel theme) */
.quick-question-btn {
  color: var(--hotel-accent);
  font-weight: 600;
  padding: 5px 11px;
}

.quick-question-btn:hover {
  background: #ffe9df;
  color: var(--hotel-accent-dark);
}
