/* Base Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.rating-container {
  margin-top: 4px;
  display: flex;
  gap: 8px;
  align-items: center;
}

    .rating-container button {
        /* The background is inherited from the widget's background via inline JS or CSS 'inherit' */
        border: 0px solid #ddd;
        border-radius: 4px;
        padding: 4px 8px;
        font-size: 14px;
        cursor: pointer;
        transition: background-color 0.2s ease;
    }

.rating-container button:hover {
  background-color: #e0e0e0;
}


/* Floating Chat Button Container */
.wc-chat-widget-wrapper {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;

  /* Make a circle at 80px */
  width: 80px;
  height: 80px;
  border-radius: 60%;

  /* Center icon inside */
  display: flex;
  align-items: center;
  justify-content: center;

  /* White background + subtle shadow */
  background-color: #fff;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);

  /* Floating animation */
  animation: float 3s ease-in-out infinite;
  transition: transform 0.2s ease;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.wc-chat-widget-wrapper:hover {
  transform: scale(1.05) translateY(-5px);
}

/* Floating Chat Button Icon */
.wc-chat-widget-button {
  cursor: pointer;
}

.wc-chat-widget-icon {
  width: 50px;
  height: auto;
  transition: transform 0.2s ease;
  border-radius: 0;
}

.wc-chat-widget-icon:hover {
  transform: scale(1.1);
}

/* Chat Widget Container */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    background-color: #ffffff;
    animation: fadeInUp 0.4s ease;
    z-index: 9999;
    font-family: Verdana, Arial, sans-serif !important;
}

/* Mobile-specific adjustments */
@media screen and (max-width: 768px) {
  .chat-widget {
    bottom: 10px;
    right: 10px;
    left: 10px;
    width: auto;
    max-width: none;
  }
}

/* Hidden by default */
.hidden {
  display: none;
}

/* Chat Header with Gradient */
.chat-header {
  background: #1A2552;
  border-bottom: none;
  padding: 12px 16px;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
}

.chat-header-left {
  display: flex;
  align-items: center;
}

.chat-logo {
  width: 50px;
  height: 50px;
  margin-right: 10px;
  border-radius: 8px;
}

.chat-header-subtitle {
  font-size: 18px;
  font-weight: 600;
  color: #5D87E4;
}

.chat-header-title {
  font-size: 14px;
  color: #d9e8ff;
}

.chat-close {
  cursor: pointer;
  font-size: 24px;
  color: #fff;
  transition: color 0.3s ease;
}

.chat-close:hover {
  color: #d9e8ff;
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  padding: 16px;
  background-color: #f9f9f9;
  overflow-y: auto;
  position: relative;
}

/* Bot Message Container */
.bot-message-container {
  display: flex;
  align-items: flex-start;
  margin: 8px 0;
  position: relative;
}

/* Chat Bubbles */
.chat-bubble {
  display: block;
  padding: 12px 14px;
  border-radius: 12px;
  max-width: 100%;
  word-wrap: break-word;
  animation: bubbleIn 0.3s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 8px;
  position: relative;
}

/* Bot bubble - left aligned */
.chat-bubble.bot {
  background-color: #ffffff;
  color: #333;
  margin-right: auto;
}

/* User bubble - right aligned */
.chat-bubble.user {
  background-color: #1A2552;
  color: #ffffff;
  margin-left: auto;
  border-bottom-right-radius: 0;
}

/* Chat Input Container */
.chat-input-container {
  display: flex;
  border-top: 1px solid #eee;
  background-color: transparent;
  padding: 0 8px;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
}

#chat-input {
  flex: 1;
  background-color: #f0f0f0;
  border: none;
  padding: 18px 20px;  /* Increased padding for taller input */
  outline: none;
  font-size: 14px;
  border-bottom-left-radius: 20px;
  margin: 8px;
  resize: none;
  overflow: hidden;
  min-height: 40px;
  max-height: 120px;
  line-height: 1.5;
}

.send-button {
  background-color: #4a90e2;
  color: #fff;
  border: none;
  padding: 12px 20px;
  font-size: 14px;
  cursor: pointer;
  border-bottom-right-radius: 20px;
  margin: 8px 8px 8px 0;
  transition: background-color 0.3s ease;
}

.send-button:hover {
  background-color: #0056b3;
}

.send-button:disabled {
  background-color: #c0dff8;
  cursor: not-allowed;
}

/* Typing Indicator */
.typing-indicator {
  display: inline-block;
}

.typing-indicator span {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 2px;
  background-color: #666;
  border-radius: 50%;
  animation: blink 1.4s infinite both;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

.typing-indicator-wrapper {
  display: flex;
  justify-content: center;
  padding: 10px 0;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bubbleIn {
  0% { opacity: 0; transform: translateY(10px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes blink {
  0% { opacity: 0.2; }
  20% { opacity: 1; }
  100% { opacity: 0.2; }
}

/* Focus States for Accessibility */
#chat-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px #4a90e2;
}
.send-button:focus {
  outline: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #4a90e2;
}


.bot-avatar {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  margin-right: 8px;
  flex-shrink: 0;
}
/* Responsive adjustments for mobile (up to 480px wide) */
@media (max-width: 480px) {
  .chat-widget {
    bottom: 10px;
    right: 8px;
    left: 8px;
    width: auto;
    max-height: 90vh;
  }
  
  .wc-chat-widget-wrapper {
    bottom: 15px;
    right: 15px;
    width: 60px;
    height: 60px;
  }
  
  .wc-chat-widget-icon {
    width: 35px;
  }
}

/* iPhone-specific adjustments */
@media screen and (max-width: 414px) {
  .chat-widget {
    bottom: 8px;
    right: 6px;
    left: 6px;
    width: auto;
    max-height: 85vh;
    border-radius: 12px;
  }
  
  .chat-header {
    padding: 10px 12px;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
  }
  
  .chat-messages {
    padding: 12px;
  }
  
  .chat-input-container {
    padding: 0 6px;
  }
  
  #chat-input {
    padding: 14px 16px;
    font-size: 16px; /* Prevents zoom on iOS */
  }
}
