:root {
  --launcher-size: clamp(50px, 6vw, 80px);
  --widget-max-width: 380px;
  --widget-bg: #FFFFFF;
  --header-bg: #C5A880;
  --header-text: #FFFFFF;
  --bubble-user: #f0f0f0;
  --bubble-hover: #ececec;
  --input-bg: #FFFFFF;
  --input-border: #ddd;
  --btn-bg: #C5A880;
  --btn-text: #FFFFFF;
  --launcher-icon: url('assets/face.png');
}

/* Base styles */
body {
  font-family: 'Quicksand', sans-serif;
  margin: 0;
  padding: 0;
}

/* Chat Launcher */
#chatLauncher {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: var(--launcher-size);
  height: var(--launcher-size);
  background-color: var(--btn-bg);
  background-image: var(--launcher-icon);
  background-size: 60%;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  z-index: 9999;
  transition: transform 0.2s ease;
}

#chatLauncher:hover {
  transform: scale(1.05);
}

/* Chat Widget Container */
.chat-widget {
  position: fixed;
  bottom: calc(var(--launcher-size) + 30px);
  right: 20px;
  width: min(90vw, var(--widget-max-width));
  max-height: 70vh;
  background: var(--widget-bg);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 9998;
  border: 1px solid #e0e0e0;
}

/* Header */
#chatHeader {
  background: var(--header-bg);
  padding: 16px;
  border-radius: 16px 16px 0 0;
  min-height: 20px;
}

#chatHeader img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

#chatHeader span {
  color: var(--header-text);
  font-weight: 600;
}

/* Chat Content */
#chatContent {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  max-height: 400px;
  font-size: 14px;
  line-height: 1.5;
}

#chatContent p {
  margin: 0 0 16px 0;
  color: #333;
}

/* Option Buttons */
.optionButton {
  width: 100%;
  padding: 12px 16px;
  margin: 8px 0;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  transition: all 0.2s ease;
}

.optionButton:hover {
  background: var(--btn-bg);
  color: var(--btn-text);
  transform: translateY(-1px);
}

/* Input Field */
#inputField {
  padding: 16px;
  border-top: 1px solid #e0e0e0;
  display: flex;
  gap: 8px;
  align-items: center;
  background: #fafafa;
}

#userInput {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--input-border);
  border-radius: 6px;
  font-size: 14px;
  background: var(--input-bg);
  outline: none;
}

#userInput:focus {
  border-color: var(--btn-bg);
  box-shadow: 0 0 0 2px rgba(197, 168, 128, 0.2);
}

#inputField button {
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

#inputField button:first-of-type {
  background: #f8f9fa;
  color: #666;
}

#inputField button:last-of-type {
  background: var(--btn-bg);
  color: var(--btn-text);
}

#inputField button:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Close/Minimize buttons */
#minimizeBtn, #closeBtn {
  cursor: pointer;
  font-size: 18px;
  color: var(--header-text);
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.2s ease;
}

#minimizeBtn:hover, #closeBtn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .chat-widget {
    bottom: calc(var(--launcher-size) + 20px);
    right: 10px;
    left: 10px;
    width: calc(100vw - 20px);
    max-width: none;
    max-height: 60vh;
    border-radius: 12px;
  }
  
  #chatLauncher {
    bottom: 15px;
    right: 15px;
  }
  
  #chatContent {
    padding: 16px;
    max-height: 300px;
    font-size: 13px;
  }
  
  #inputField {
    padding: 12px;
    flex-direction: column;
    gap: 8px;
  }
  
  #userInput {
    width: 100%;
    margin-bottom: 8px;
  }
  
  #inputField button {
    width: 100%;
    padding: 12px;
  }
  
  .optionButton {
    font-size: 13px;
    padding: 10px 12px;
  }
}

/* Small Mobile */
@media (max-width: 480px) {
  .chat-widget {
    bottom: calc(var(--launcher-size) + 15px);
    right: 5px;
    left: 5px;
    width: calc(100vw - 10px);
    max-height: 55vh;
    border-radius: 8px;
  }
  
  #chatLauncher {
    bottom: 10px;
    right: 10px;
  }
  
  #chatHeader {
    padding: 12px;
  }
  
  #chatContent {
    padding: 12px;
    max-height: 250px;
  }
  
  #inputField {
    padding: 10px;
  }
}

/* Tablet Landscape */
@media (min-width: 769px) and (max-width: 1024px) {
  .chat-widget {
    width: min(400px, 45vw);
    max-height: 65vh;
  }
}

/* Ensure proper stacking */
.chat-widget * {
  box-sizing: border-box;
}

/* Scrollbar styling for webkit browsers */
#chatContent::-webkit-scrollbar {
  width: 6px;
}

#chatContent::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

#chatContent::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

#chatContent::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}
