/* --- Import Google Font --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');

/* --- Chatbot Styles --- */
.chatbot-toggler {
    position: fixed;
    right: 35px;
    bottom: 30px;
    height: 50px;
    width: 50px;
    color: var(--bg);
    background: var(--accent);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
    z-index: 998;
}

.show-chatbot .chatbot-toggler {
    transform: rotate(90deg);
}

.chatbot-toggler span {
    position: absolute;
}

.show-chatbot .chatbot-toggler span:first-child,
.chatbot-toggler span:last-child {
    opacity: 0;
}

.show-chatbot .chatbot-toggler span:last-child {
    opacity: 1;
}

.chatbot {
    font-family: "Poppins", sans-serif;
    position: fixed;
    right: 95px; /* Positioned to the left of the toggler (35px + 50px + 10px gap) */
    bottom: 30px;
    width: 420px;
    background: #FFFFFF;
    border-radius: var(--radius-lg);
    box-shadow: 0 0 128px 0 rgba(0,0,0,0.1),
                0 32px 64px -48px rgba(0,0,0,0.5);
    transform: scale(0.5);
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
    transform-origin: bottom right;
    transition: all 0.1s ease;
    z-index: 999;
}

.show-chatbot .chatbot {
    transform: scale(1);
    opacity: 1;
    pointer-events: auto;
}

.chatbot header {
    background: #005F6B; /* Accessible Dark Teal */
    padding: 16px 0;
    text-align: center;
    position: relative;
}

.chatbot header h2 {
    color: #fff;
    font-size: 1.4rem;
    margin: 0;
}

.chatbox {
    height: 510px;
    overflow-y: auto;
    padding: 30px 20px 100px;
    list-style: none;
}

.chatbox .chat {
    display: flex;
}

.chatbox .incoming span {
    height: 32px;
    width: 32px;
    color: #fff;
    background: #005F6B; /* Accessible Dark Teal */
    text-align: center;
    line-height: 32px;
    border-radius: 4px;
    margin: 0 10px 7px 0;
    align-self: flex-end;
}

.chatbox .outgoing {
    margin: 20px 0;
    justify-content: flex-end;
}

.chatbox .chat p {
    color: #111111; /* Near-black text for bot */
    max-width: 75%;
    font-size: 0.95rem;
    padding: 12px 16px;
    border-radius: 10px 10px 10px 0; /* Different shape for bot */
    background: #F1F1F1; /* Light grey for bot message */
    white-space: pre-wrap; /* To respect newlines in the response */
}

.chatbox .outgoing p {
    background: #005F6B; /* Accessible Dark Teal for user */
    color: #FFFFFF; /* White text for user */
    border-radius: 10px 10px 0 10px;
}

.chatbot .chat-input {
    position: absolute;
    bottom: 0;
    width: 100%;
    display: flex;
    gap: 5px;
    background: #FFFFFF;
    padding: 5px 20px;
    border-top: 1px solid var(--border);
}

.chat-input textarea {
    border: none;
    outline: none;
    font-size: 0.95rem;
    resize: none;
    padding: 16px 15px 16px 0;
    background: transparent;
    color: #111111;
    max-height: 180px;
    width: 100%;
}

.chat-input span {
    align-self: flex-end;
    height: 55px;
    width: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #005F6B; /* Accessible Dark Teal */
    font-size: 1.35rem;
    cursor: pointer;
    visibility: hidden; /* Hide by default */
}

.chat-input textarea:valid ~ span {
    visibility: visible; /* Show when there is text */
}