body {
  font-family: "Montserrat", sans-serif;
  background-color: #ffffff;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}


.chat-container {
  height: auto;
  width: 400px;
  position: fixed;
  bottom: 75px;
  right: 75px;
  background: rgb(255, 255, 255);
  background: linear-gradient(
    0deg,
    rgba(255, 255, 255, 1) 0%,
    rgba(255, 255, 255, 1) 50%,
    rgba(244, 173, 84, 1) 50%,
    rgba(244, 173, 84, 1) 100%
  );
  border-radius: 30px !important;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  transform-origin: bottom right;
  transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1), opacity 0.3s ease;
  opacity: 1;
  z-index: 999;
  transform: translateY(0);
  will-change: transform, opacity;
   contain: layout style;
}

.chat-container.card-expanded {
  height: 600px;
}

.chat-header {
  background-color: #f4ad54;
  padding: 32px;
  text-align: center;
  position: relative;
  margin-bottom: 50px;
}

.chat-header.expanded-header {
  padding: 20px;
  margin-bottom: 0;
  padding-bottom: 15px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.chat-header.expanded-header #header-text {
  font-size: 14px;
  color: #000;
  margin-left: 30px;
}

.back-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  width: 18px;
  height: 18px !important;
  display: none;
}

#header-text {
  color: #fafafa;
  font-size: 28px;
  font-weight: 400;
  display: block;
  text-align: left;
  margin-bottom: 5px;
}

.card-container {
  position: relative;
  width: 400px;
}

.card {
  background-color: #fff;
  border-radius: 30px !important;
  padding: 15px 35px 75px 35px;
  margin-top: -50px;
  box-shadow: 0px -4px 11px 2px rgba(0, 0, 0, 0.05);
  transition: padding 0.3s ease, margin-top 0.3s ease,
    background-color 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.card:hover {
  padding-top: 25px;
  margin-top: -60px;
  box-shadow: 0px 4px 15px 2px rgba(0, 0, 0, 0.1);
}

.card-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: transform 0.5s ease;
}

.card:hover .card-title {
  transform: translateY(-10px);
}

.card.expanded {
  height: 600px;
  background-color: #fff !important;
  transition: all 0.3s ease;
  z-index: 10;
  position: relative;
  margin-top: 0;
  transform-origin: bottom;
  border-radius: 30px !important;
  box-shadow: 0px 4px 15px 2px rgba(0, 0, 0, 0.1);
  padding-top: 15px;
  padding-bottom: 35px;
}

.card.expanding {
  display: none;
}

.card-container > .card {
  display: flex;
}

#card1,
#card2,
#card3 {
  background-color: #fafafa;
}

.card-header {
  font-size: 16px;
}

.chevron-icon {
  width: 14px;
  height: 14px !important;
  margin-left: auto;
}

#chat-messages {
  height: calc(100% - 100px);
  overflow-y: auto;
    overflow-x: hidden;
  padding: 20px;
  padding-top: 20px;
  background-color: #fff;
  border-radius: 30px 30px 0 0 !important;
  box-shadow: 0px -4px 11px 2px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 15px;
  opacity: 1;
  transition: opacity 0.2s ease;
  scroll-padding: 20px;
  contain: layout style;
  overscroll-behavior: contain;
}

.user-message,
.system-message {
  padding: 20px;
  font-size: 14px;
  max-width: 60%;
}

.question,
.user-message,
.system-message {
  line-height: 1.4;
}

.user-message {
  background-color: #167cff;
  color: #fff;
  border-radius: 20px 20px 5px 20px !important;
  margin-left: auto;
}

.question {
  background-color: #f2f3fa;
  color: #000;
  border-radius: 20px 20px 20px 5px !important;
  padding: 20px;
  font-size: 14px;
  max-width: 70%;
}

.message-options {
  display: flex;
  flex-direction: column;
  width: 70%;
  margin-left: auto;
}

.message-text {
  padding-top: 20px;
  padding-inline: 20px;
}

.answer-button {
    background-color: #146fe5 !important;
    color: white !important;
    border: none;
    border-radius: 11px 11px 0px 11px !important;
    padding: 12px 16px;
    text-align: left;
    font-size: 14px !important;
    cursor: pointer !important;
    transition: background-color 0.2s;
    margin: 5px 0;
    width: 100%;
    white-space: normal !important;
    line-height: normal !important;
}

.answer-button:hover {
  background-color: #115dbf;
}

#restart-button {
  position: fixed;
  bottom: 20px;
  right: 500px;
  padding: 10px 20px;
  background-color: #f4ad54;
  color: white;
  border: none;
  border-radius: 5px !important;
  cursor: pointer;
  font-family: "Montserrat", sans-serif;
  z-index: 1000;
}

.chat-toggle-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50% !important;
  background-color: #f4ad54;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  transition: transform 0.3s ease;
  overflow: hidden;
}

.chat-toggle-button:hover {
  transform: scale(1.05);
}

.chat-toggle-button img {
  width: 50px;
  height: 50px;
  transition: transform 0.3s ease-in-out;
}

.chat-toggle-button.rotated img {
  transform: rotate(180deg);
}

.chat-container.hidden {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1), opacity 0.4s ease;
}

.chat-assistant-label {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: white;
  color: #000;
  border-radius: 30px !important;
  font-size: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: width 0.4s ease, padding 0.4s ease;
  pointer-events: none;
  z-index: 998;
  height: 60px;
  display: flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  width: 60px;
  padding: 0;
  text-indent: 60px;
}

.chat-assistant-label.visible {
    width: 317px;
    padding: 0px 20px 0 15px;
    text-indent: 0;
    justify-content: flex-start;
}

.loading {
  text-align: center;
  padding: 20px;
  color: #666;
}

.error {
  background-color: #ffebee;
  color: #c62828;
  padding: 10px;
  margin: 10px 0;
  border-radius: 5px !important;
}

.select-container {
  width: 70%;
  margin-left: auto;
}

.select {
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 10px;
  border: 1px solid #ddd;
  border-radius: 11px 11px 0px 11px !important;
  font-size: 14px;
  font-family: "Montserrat", sans-serif;
  background-color: #167cff;
  color: white;
}

.select:focus {
  outline: none;
  border-color: #167cff;
}

/* Product recommendations */
.product-recommendation,
.perfume-recommendation {
  background-color: #f2f3fa;
  padding: 20px;
  border-radius: 20px 20px 20px 5px !important;
  margin-bottom: 20px;
  max-width: 75%;
}

.carousel-container {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  margin: 15px 0 15px;
}

.carousel-arrow {
  position: absolute;
  width: 36px;
  height: 36px;
  background-color: rgba(0, 0, 0, 0.4);
  color: white;
  border-radius: 50% !important;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 18px;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
  user-select: none;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.carousel-arrow:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

.carousel-arrow:active {
  transform: scale(0.95);
}

.carousel-arrow-left {
  left: 5px;
}

.carousel-arrow-right {
  right: 5px;
}

.product-recommendations,
.perfume-recommendations {
  display: flex;
  flex-direction: row;
  gap: 15px;
  margin: 0;
  width: 100%;
  overflow-x: auto;
  padding: 10px 5px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  position: relative;
}

/* Hide scrollbar for products container */
.product-recommendations::-webkit-scrollbar,
.perfume-recommendations::-webkit-scrollbar {
  display: none;
}

.product-item,
.perfume-item {
  display: flex;
  flex-direction: column;
  background-color: #fafafa;
  border-radius: 12px !important;
  padding: 0;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease-in-out;
  margin: 0;
  min-width: 200px;
  max-width: 200px;
  flex-shrink: 0;
  overflow: hidden;
  scroll-snap-align: center;
}

.product-item:hover,
.perfume-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
}

div#chat-messages .product-image,
div#chat-messages .perfume-image {
  width: calc(100% - 10px);
  height: 160px;
  margin-top: 5px;
  margin-left: 50%;
  transform: translateX(-50%);
  overflow: hidden;
  background-color: #f5f5f5;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  border-radius: 10px !important;
}

div#chat-messages .product-name,
div#chat-messages .perfume-name {
  font-weight: 600;
  color: #333;
  padding: 12px 15px 5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}

.product-price {
  font-weight: normal;
  font-size: 16px;
  color: #333;
  text-align: right;
}

.product-add-button {
  background-color: #167cff;
  color: white !important;
  border: none;
  border-radius: 5px !important;
  padding: 10px;
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  margin: 5px 15px 15px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: block;
  transition: background-color 0.2s ease;
}

.product-add-button:hover {
  background-color: #3550e0;
}

#current-date {
  display: flex;
  justify-content: center;
  color: #000;
  text-align: center;
  font-size: 12px;
  font-style: normal;
  font-weight: 400;
  line-height: normal;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.chat-content {
  display: none;
  margin-top: 10px;
}

.card.expanded .chat-content {
  display: block;
  height: 500px;
  overflow-y: auto;
}

/* Media query for mobile devices (500px or less) */
@media screen and (max-width: 500px) {
  .card-container {
    position: absolute;
    bottom: -30px;
    width: 100%;
    padding-bottom: 200px;
    background-color: #fafafa;
     padding-bottom: 200px; /* Fallback */
    padding-bottom: calc(200px + env(safe-area-inset-bottom));
  }

  .chat-container {
    background: #f4ad54;
    width: 100%;
    height: 100vh; /* Fallback */
    height: 100dvh;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    border-radius: 0!important;
    transform-origin: bottom center;
    transform: translateY(0);
    transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1),
      background 0.3s ease-out;
    will-change: transform;
    box-shadow: none;
    padding-top: 0; /* Fallback */
    padding-top: env(safe-area-inset-top);
    padding-bottom: 0; /* Fallback */
    padding-bottom: env(safe-area-inset-bottom);
  }

  /* Remove orange background when card is expanded */
  .chat-container.card-expanded {
    background: linear-gradient(
      to bottom,
      #f4ad54 0%,
      #f4ad54 15%,
      rgba(255, 255, 255, 1) 45%,
      rgba(255, 255, 255, 1) 100%
    );
    height: 100vh; /* Fallback */
    height: 100dvh;
  }

  /* Change header to be transparent to show gradient */
  .chat-container.card-expanded .chat-header {
    background-color: transparent;
  }

  #chat-messages {
    position: relative;
    height: calc(100vh - 200px); /* Fallback */
    height: calc(100dvh - 200px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    margin-bottom: 0; /* Fallback */
    margin-bottom: env(safe-area-inset-bottom);
  }

  .chat-container.hidden {
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1), opacity 0.3s ease;
  }

  #restart-button {
    bottom: 20px; /* Fallback */
    bottom: calc(20px + env(safe-area-inset-bottom));
    right: 100px;
  }

  .card {
    padding: 15px 35px 175px 35px;
    margin-top: -130px;
    transition: all 0.3s ease-out;
    position: relative;
  }

  .card.expanding,
  .card.expanded {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: 60px; /* Fallback */
    top: calc(60px + env(safe-area-inset-top));
    height: calc(100vh - 100px); /* Fallback */
    height: calc(100dvh - 100px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    margin-top: 0;
    border-radius: 30px 30px 0 0 !important;
    transform: translateY(0);
    padding-bottom: 75px; /* Fallback */
    padding-bottom: calc(75px + env(safe-area-inset-bottom));
    z-index: 1000;
    background-color: #ffffff;
    animation: slideUpCard 0.3s ease forwards;
  }

  @keyframes slideUpCard {
    from {
      transform: translateY(100%);
    }
    to {
      transform: translateY(0);
    }
  }

  .chat-header {
    transition: background-color 0.3s ease-out;
    padding-top: 32px; /* Fallback */
    padding-top: calc(32px + env(safe-area-inset-top));
  }

  .chat-container.card-expanded .chat-header {
    background-color: transparent;
      padding-top: 20px; /* Fallback */
    padding-top: calc(20px + env(safe-area-inset-top));
  }
  .chat-toggle-button {
    bottom: 20px; /* Fallback */
    bottom: calc(20px + env(safe-area-inset-bottom));
    right: 20px; /* Fallback */
    right: calc(20px + env(safe-area-inset-right));
  }

  .chat-assistant-label {
    bottom: 20px; /* Fallback */
    bottom: calc(20px + env(safe-area-inset-bottom));
    right: 20px; /* Fallback */
    right: calc(20px + env(safe-area-inset-right));
  }
}

/* Hide scrollbars for all elements */
*::-webkit-scrollbar {
  width: 0;
  height: 0;
  background: transparent;
}

* {
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */
}

/* Custom dropdown styling */
.custom-dropdown-container {
  width: 100%;
  position: relative;
  margin-top: 10px;
  padding-inline: 15px;
  box-sizing: border-box;
}

.dropdown-input {
  width: calc(100% - 30px);
  padding: 10px 15px;
  border-radius: 20px !important;
  border: 1px solid #e0e0e0;
  font-size: 14px;
  font-family: "Montserrat", sans-serif;
  background-color: #f2f3fa;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  margin-bottom: 5px;
}

.dropdown-input:focus {
  outline: none;
  border-color: #4776e6;
  box-shadow: 0 1px 5px rgba(71, 118, 230, 0.2);
}

.dropdown-list {
  width: 100%;
  max-height: 200px;
  overflow-y: auto;
  background-color: #f2f3fa;
  border-radius: 20px !important;
  border: 1px solid #e0e0e0;
  margin-top: 5px;
  z-index: 100;
  position: relative;
  display: none;
  padding-block: 5px;
}

.dropdown-list.active {
  display: block;
}

.dropdown-option {
  padding: 10px 15px;
  cursor: pointer;
  transition: background-color 0.2s;
  font-weight: 500;
  text-transform: uppercase;
}

.dropdown-option:hover {
  background-color: #629fee;
  color: white;
}

.dropdown-option.selected {
  background-color: #8ab7f2;
  color: white;
}

.dropdown-no-result {
  padding: 15px;
  text-align: center;
  color: #999;
  font-style: italic;
}

/* System messages */
.system-message {
  background-color: #f2f3fa;
  color: #000;
  border-radius: 20px 20px 20px 5px !important;
  padding: 0px;
  padding-bottom: 20px;
  font-size: 14px;
  max-width: 85%;
  overflow: visible;
}

.date-header {
  color: #000;
  text-align: center;
  padding-bottom: 10px;
  font-size: 12px;
  font-style: normal;
  font-weight: 400;
  line-height: normal;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.product-recommendations > .product-item:first-child {
  margin-left: 10px;
}

.product-recommendations > .product-item:last-child {
  margin-right: 10px;
}

.perfume-recommendations > .perfume-item:first-child {
  margin-left: 10px;
}

.perfume-recommendations > .perfume-item:last-child {
  margin-right: 10px;
}

/* Typing indicator */
.typing-indicator {
  max-width: 50px;
  padding: 20px 15px;
  margin-left: 0;
}

.typing-dots {
  display: flex;
  justify-content: center;
  gap: 4px;
}

.typing-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50% !important;
  background-color: #bbb;
  animation: typingAnimation 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) {
  animation-delay: 0s;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingAnimation {
  0%,
  100% {
    transform: scale(0.7);
    opacity: 0.5;
  }
  50% {
    transform: scale(1);
    opacity: 1;
  }
}
