.chatbot {
    position: fixed;
    bottom: 112px;
    right: 20px;
    width: 360px;
    max-height: 500px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
}

.chatbot.open {
    display: flex;
}

.chat-header {
    background: var(--primary-color);
    color: #fff;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    font-weight: bold;
    min-height: 60px;
}

.chat-header img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-right: 12px;
    flex-shrink: 0;
}

.chat-header span {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-body {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f9f9f9;
}

.msg {
    margin: 8px 0;
    display: flex;
}

.msg.bot {
    justify-content: flex-start;
}

.msg.user {
    justify-content: flex-end;
}

.bubble {
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
    max-width: 75%;
}

.msg.bot .bubble {
    background: #eee;
    color: #000;
}

.msg.user .bubble {
    background: var(--primary-color);
    color: #fff;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.options button {
    border: 1px solid var(--primary-color);
    background: #fff;
    color: var(--primary-color);
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    text-align: left;
}

.options button:hover {
    background: var(--primary-color);
    color: #fff;
}

.chat-input {
    display: flex;
    padding: 12px;
    border-top: 1px solid #ddd;
    gap: 8px;
    background: #fff;
}

.country-code {
    width: 70px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
}

.chat-input input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
}

.send-btn {
    background: var(--primary-color);
    border: none;
    color: #fff;
    padding: 0 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
}

.chatbot-toggle, .chatbot-close {
    position: fixed;
    right: 20px;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 10000;
}

.chatbot-toggle {
    bottom: 52px;
}

.chatbot-close {
    bottom: 52px;
    display: none;
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
    .chatbot {
        width: 320px; /* Reduced from 360px */
        right: 25px; /* Adjusted for better positioning */
        bottom: 100px;
        max-height: 450px;
    }
    
    .chat-header {
        padding: 10px 12px;
        min-height: 55px;
    }
    
    .chat-header img {
        width: 32px; /* Slightly smaller to fit better */
        height: 32px;
        margin-right: 10px;
    }
    
    .chat-header span {
        font-size: 13px;
    }
    
    .chat-body {
        padding: 12px;
    }
    
    .bubble {
        padding: 8px 10px;
        font-size: 13px;
        max-width: 80%; /* Slightly wider bubbles on mobile */
    }
    
    .chat-input {
        padding: 10px;
        gap: 6px;
    }
    
    .country-code {
        width: 65px;
        padding: 6px;
        font-size: 13px;
    }
    
    .chat-input input {
        padding: 6px;
        font-size: 13px;
    }
    
    .send-btn {
        padding: 0 14px;
        font-size: 14px;
    }
    
    .chatbot-toggle, .chatbot-close {
        right: 15px;
        width: 50px;
        height: 50px;
        font-size: 20px;
        bottom: 45px;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .chatbot {
        width: 300px; /* Even narrower for very small screens */
        right: 10px;
        bottom: 90px;
        max-height: 400px;
    }
    
    .chat-header {
        padding: 8px 10px;
        min-height: 50px;
    }
    
    .chat-header img {
        width: 30px;
        height: 30px;
        margin-right: 8px;
    }
    
    .chat-header span {
        font-size: 12px;
    }
    
    .chat-body {
        padding: 10px;
    }
    
    .bubble {
        padding: 6px 8px;
        font-size: 12px;
    }
    
    .options button {
        padding: 6px;
        font-size: 12px;
    }
    
    .chatbot-toggle, .chatbot-close {
        right: 10px;
        width: 48px;
        height: 48px;
        font-size: 18px;
        bottom: 40px;
    }
}
/* Minimized Chat Styles */
/* Ensure minimized state is visible and properly positioned */
.chatbot.minimized {
  width: 300px;
  height: 70px;
  max-height: 70px;
  bottom: 20px;
  right: 20px;
  border-radius: 35px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  overflow: hidden;
  display: block !important; /* Force display */
  z-index: 10000;
}

.minimized-chat {
  display: flex;
  align-items: center;
  padding: 15px;
  height: 100%;
  background: linear-gradient(135deg, #012e28 0%, #015c4f 100%);
  color: white;
  cursor: pointer;
}

.minimized-avatar {
  margin-right: 12px;
}

.minimized-avatar img {
  border-radius: 50%;
  border: 2px solid white;
}

.minimized-text {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}

.restore-btn {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.restore-btn:hover {
  background: rgba(255,255,255,0.3);
  transform: scale(1.1);
}

/* Make sure regular chatbot has proper z-index */
.chatbot {
  position: fixed;
  bottom: 112px;
  right: 20px;
  width: 360px;
  max-height: 500px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 5px 25px rgba(0,0,0,0.2);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
}

.chatbot.open {
  display: flex;
}

/* Chat toggle button should be visible when chat is closed */
.chatbot-toggle {
  position: fixed;
  bottom: 52px;
  right: 20px;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: var(--primary-color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 10000;
}