/* Chat Widget CSS Styling */
#chat-widget {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 300px;
    background: #ffffff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    font-family: Arial, sans-serif;
    z-index: 9999;
    overflow: hidden;
}

#chat-header {
    background: #0073aa;
    color: #ffffff;
    padding: 10px;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
}

#chat-close {
  float: right;
  font-size: 18px;
  line-height: 18px;
  cursor: pointer;
  color: #fff;
  margin-right: 8px;
  margin-top:3px;
}

#chat-body {
    display: none;
    padding: 15px;
}

.chat-step {
    margin-bottom: 15px;
}

.chat-step p {
    margin: 0 0 10px;
}

#chat-widget input[type="text"],
#chat-widget input[type="email"],
#chat-widget input[type="tel"],
#chat-widget select,
#chat-widget input[type="file"] {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

#chat-widget button {
    background: #0073aa;
    color: #ffffff;
    border: none;
    padding: 10px;
    width: 100%;
    border-radius: 5px;
    cursor: pointer;
}

#chat-widget button:hover {
    background: #005f8d;
}

/* Toggle chat body when header is clicked */
#chat-header.active + #chat-body {
    display: block;
}

/* Styling for the thank you message */
#chat-step-4 p {
    color: #28a745;
    font-weight: bold;
}

/* Speech bubble styling for messages */
.chat-message {
    max-width: 80%;
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.4;
}

.bot-message {
    background: #f1f1f1;
    color: #333;
    text-align: left;
    border-top-left-radius: 0;
}

.user-message {
    background: #0073aa;
    color: #ffffff;
    text-align: right;
    border-top-right-radius: 0;
    margin-left: auto;
}

.chat-spinner {
    border: 2px solid #f3f3f3; /* Light grey */
    border-top: 2px solid #0073aa; /* Blue */
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-right: 5px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Media query for responsiveness */
@media (max-width: 480px) {
    #chat-widget {
        width: 90%;
        left: 5%;
        bottom: 10px;
    }
} 


/* Limit chat body height and allow scrolling */
#chat-body {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 8px;
    box-sizing: border-box;
}

/* Improve scroll UX on mobile */
#chat-body::-webkit-scrollbar {
    width: 6px;
}
#chat-body::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* Optional: finer control for small screens */
@media (max-width: 480px) {
    #chat-body {
        max-height: 50vh;
    }
}

