/* —— basic reset —— */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* —— body + fonts —— */
@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=Montserrat:wght@300;500;700&display=swap");

body {
  font-family: "Montserrat", Arial, Helvetica, sans-serif; /* Neutral font for body text */
  color: #333;
  background-color: #fff; /* White background for a clean look */
  display: flex;
  justify-content: center;
}

.page-wrapper {
  width: 90%;
  max-width: 900px;
}

/* header */
.site-header {
  text-align: center;
  padding-top: 50px;
  padding-bottom: 10px;
}

.logo {
  width: 250px;
  margin-bottom: 15px;
}

.site-title {
  font-family: "Playfair Display", serif; /* Elegant font for headings */
  font-size: 22px;
  font-weight: 700; /* Bold for emphasis */
  margin-bottom: 10px;
  color: #000; /* Black text for the title */
}

/* category filter */
.search-section {
  margin: 30px 0;
  display: flex;
}

.search-section select {
  width: 100%;
  padding: 16px;
  font-size: 18px;
  border: 2px solid #000; /* Black border */
  border-radius: 8px;
  cursor: pointer;
  background-color: #fff; /* White background */
  font-weight: 500;
  color: #333; /* Neutral text color */
  font-family: "Montserrat", Arial, sans-serif; /* Consistent font for inputs */
}

.search-section select:focus {
  outline: none;
  border-color: #d4af37; /* Gold border on focus */
}

.search-input {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border: 2px solid #000; /* Black border */
  border-radius: 8px;
  margin-bottom: 20px;
  font-family: "Montserrat", Arial, sans-serif; /* Consistent font for inputs */
  color: #333; /* Neutral text color */
}

.search-input:focus {
  outline: none;
  border-color: #d4af37; /* Gold border on focus */
}

/* chat section */
.chatbox {
  margin: 40px 0;
  border: 2px solid #000; /* Black border */
  border-radius: 8px;
  padding: 26px;
  background-color: #f9f9f9; /* Light grey background */
}

.chatbox h2 {
  font-family: "Playfair Display", serif; /* Elegant font for headings */
  font-size: 20px;
  margin-bottom: 20px;
  color: #000; /* Black text */
}

.chat-window {
  padding: 20px;
  font-size: 18px;
  line-height: 1.5;
  height: 400px; /* Increased height to display more conversation */
  overflow-y: auto;
  background: #fafafa;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Chat bubbles with updated transparency */
.chat-window p {
  max-width: 75%;
  padding: 14px 18px;
  border-radius: 20px;
  margin-bottom: 12px;
  word-wrap: break-word;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.6;
}

.chat-window .user-message {
  background-color: #d4af37; /* Gold background for user messages */
  color: #fff; /* White text for contrast */
  border: 1px solid #b8860b; /* Slightly darker gold border */
  align-self: flex-end;
  text-align: right;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Soft shadow for depth */
}

.chat-window .ai-message {
  background-color: #f9f9f9; /* Light grey background for AI messages */
  color: #333; /* Neutral text color */
  border: 1px solid #ccc; /* Light grey border */
  align-self: flex-start;
  text-align: left;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2); /* Slightly darker shadow */
  border-radius: 25px; /* Rounded corners for the AI bubble */
  font-size: 14px; /* Adjusted font size for better fit */
  word-wrap: break-word; /* Ensure long words wrap within the bubble */
  padding: 12px 16px; /* Adjusted padding for consistent spacing */
  max-width: 75%; /* Ensure the bubble does not exceed 75% of the chat window width */
  overflow-wrap: break-word; /* Break long words to prevent overflow */
}

/* Add spacing between chat bubbles and edges */
.chat-window {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 10px;
}

/* placeholder message */
.placeholder-message {
  width: 100%;
  text-align: center;
  padding: 40px;
  color: #666;
  font-size: 18px;
}

/* input row */
.chat-form {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.chat-form input {
  flex: 1;
  padding: 12px;
  font-size: 18px;
  border: none;
  border-bottom: 2px solid #000; /* Black underline */
  background: transparent;
  color: #333; /* Neutral text color */
}

.chat-form input:focus {
  outline: none;
  border-bottom-color: #d4af37; /* Gold underline on focus */
}

.chat-form button {
  font-size: 18px;
  background: #000; /* Black button */
  color: #fff; /* White text */
  border: none;
  padding: 12px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s;
}

.chat-form button:hover {
  background: #d4af37; /* Gold button on hover */
}

.chat-form button:focus {
  outline: 2px solid #000;
  outline-offset: 2px;
}

/* Highlight selected product cards */
.product-card.selected {
  border: 2px solid #d4af37; /* Gold border for selected products */
  background-color: #f9f9f9; /* Light grey background */
}

/* Product card hover overlay */
.product-card {
  position: relative;
  overflow: hidden; /* Ensure the overlay stays within the card */
}

.product-card .overlay {
  position: absolute;
  top: 100%; /* Start outside the card */
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8); /* Semi-transparent black */
  color: #fff; /* White text for contrast */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 10px;
  font-size: 14px;
  line-height: 1.4;
  transition: top 0.3s ease; /* Smooth transition for hover effect */
}

.product-card:hover .overlay {
  top: 0; /* Slide the overlay into view on hover */
}

.product-card .overlay p {
  margin: 0;
}

/* Info icon beside product name */
.product-card .info-icon {
  margin-left: 8px;
  font-size: 14px;
  color: #666;
  cursor: pointer;
  transition: color 0.3s ease;
}

.product-card .info-icon:hover {
  color: #000; /* Darker color on hover */
}

/* visually hidden */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* footer */
.site-footer {
  margin: 60px 0 40px;
  text-align: center;
  font-size: 14px;
  color: #666;
  font-family: "Montserrat", Arial, sans-serif; /* Neutral font for footer */
}

.site-footer nav {
  margin-top: 12px;
}

.site-footer a {
  margin: 0 8px;
  color: #000; /* Black links */
  text-decoration: none;
}

.site-footer a:hover {
  color: #d4af37; /* Gold links on hover */
}

/* products grid */
.products-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 30px 0;
  opacity: 1; /* Fully visible by default */
  transition: opacity 0.3s ease; /* Smooth transition for visibility changes */
}

.products-grid.hidden {
  opacity: 0; /* Hidden state */
  pointer-events: none; /* Disable interaction when hidden */
}

.product-card {
  flex: 0 1 calc(33.333% - 14px);
  border: 1px solid #ccc;
  padding: 15px;
  border-radius: 4px;
  display: flex;
  gap: 15px;
  min-height: 160px;
}

.product-card img {
  width: 110px;
  height: 110px;
  object-fit: contain;
  flex-shrink: 0;
}

.product-card .product-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 110px;
}

.product-card h3 {
  font-family: "Playfair Display", serif; /* Elegant font for product names */
  font-size: 16px;
  margin-bottom: 8px;
}

.product-card p {
  font-family: "Montserrat", Arial, sans-serif; /* Neutral font for product details */
  font-size: 14px;
  color: #666;
}

/* selected products */
.selected-products {
  margin: 40px 0;
  padding: 20px;
  border: 2px solid #000;
  border-radius: 8px;
}

.selected-products h2 {
  font-size: 20px;
  margin-bottom: 20px;
}

#selectedProductsList {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.generate-btn {
  width: 100%;
  margin-top: 20px;
  padding: 16px;
  font-size: 18px;
  font-weight: 500;
  color: #fff;
  background: #000; /* Black button */
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s;
}

.generate-btn:hover {
  background: #d4af37; /* Gold button on hover */
}

.generate-btn i {
  margin-right: 8px;
}

/* Styling for the description card */
.description-card {
  background-color: #fff; /* White background */
  color: #333; /* Neutral text color */
  border: 1px solid #d4af37; /* Gold border */
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  font-size: 14px;
  line-height: 1.5;
  max-width: 300px;
  z-index: 1000;
  white-space: normal;
  word-wrap: break-word;
}

.description-card h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

/* Animation for chat bubbles */
@keyframes slideIn {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.chat-window .user-message,
.chat-window .ai-message {
  animation: slideIn 0.3s ease-out; /* Apply slide-in animation */
}

/* General RTL adjustments */
.rtl {
  direction: rtl;
}

.rtl .chat-window {
  text-align: right;
}

.rtl .user-message {
  align-self: flex-start; /* Flip alignment for user messages */
  text-align: left;
}

.rtl .ai-message {
  align-self: flex-end; /* Flip alignment for AI messages */
  text-align: right;
}

.rtl .product-card {
  text-align: right;
}

.rtl .product-card .info-icon {
  margin-right: 8px; /* Adjust spacing for RTL */
  margin-left: 0;
}

/* Typing indicator styling */
.ai-typing-indicator {
  font-size: 14px;
  color: #666;
  font-style: italic;
  margin-top: 10px;
  align-self: flex-start;
}
