
/* Chatbot Styles */
:root {
  --chatbot-width: 350px;
  --chatbot-header-height: 60px;
}

.chatbot-toggler {
  position: fixed;
  bottom: 30px;
  right: 35px;
  width: 60px;
  height: 60px;
  background-color: var(--primary-blue);
  color: var(--white);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  z-index: 999;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.chatbot-toggler:hover {
  opacity: 0.9;
  transform: scale(1.05);
}

.chatbot-toggler .material-symbols-outlined {
  transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

.chatbot-toggler .close-icon {
  transform: rotate(-90deg) scale(0);
  opacity: 0;
  position: absolute;
}

.show-chatbot .chatbot-toggler .chat-icon {
  transform: rotate(90deg) scale(0);
  opacity: 0;
}

.show-chatbot .chatbot-toggler .close-icon {
  transform: rotate(0) scale(1);
  opacity: 1;
}

.chatbot {
  position: fixed;
  right: 35px;
  bottom: 100px;
  width: var(--chatbot-width);
  max-height: calc(100vh - 115px);
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: 0 0 128px 0 rgba(0,0,0,0.1), 0 32px 64px -48px rgba(0,0,0,0.5);
  transform: scale(0.5);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  transform-origin: bottom right;
  z-index: 1000;
}

.show-chatbot .chatbot {
  transform: scale(1);
  opacity: 1;
  pointer-events: auto;
}

.chatbot-header {
  height: var(--chatbot-header-height);
  flex-shrink: 0;
  background: var(--primary-blue);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center; /* Center title by default */
  padding: 0 var(--spacing-md);
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  position: relative;
}

.chatbot-header h2 {
  font-size: var(--font-size-md);
  color: var(--white);
  font-family: var(--font-family-japanese);
}

.chatbot-header .close-btn {
  display: none; /* Hide by default on desktop */
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--white);
  cursor: pointer;
}

.chatbox-container {
    overflow-y: auto;
    flex-grow: 1;
}

.chatbox {
  padding: var(--spacing-md);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.chat {
  display: flex;
  max-width: 90%;
}

.chat p {
  font-size: 0.95rem;
  padding: var(--spacing-sm);
  border-radius: var(--border-radius);
  background: var(--light-blue);
  line-height: 1.6;
}

.chat.outgoing {
  justify-content: flex-end;
}

.chat.outgoing p {
  background: var(--primary-blue);
  color: var(--white);
}

.initial-questions {
  padding: var(--spacing-sm) var(--spacing-md);
  border-top: 1px solid #ddd;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.initial-questions button {
  background: none;
  border: 1px solid var(--primary-blue);
  color: var(--primary-blue);
  padding: var(--spacing-sm);
  border-radius: var(--border-radius);
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
  font-family: var(--font-family-japanese);
  font-size: 0.9rem;
}

.initial-questions button:hover {
  background: var(--light-blue);
}

@media (max-width: 490px) {
  .chatbot {
    right: 0;
    bottom: 0;
    height: 100%;
    width: 100%;
    border-radius: 0;
    max-height: 100%;
  }
  .chatbot-toggler {
    right: 20px;
    bottom: 20px;
  }
  .chatbot-header {
    justify-content: center; /* Keep title centered */
  }
  .chatbot-header .close-btn {
    display: block; /* Show close button on mobile */
  }
}
