/* Chatbot Styles - Premium Dark Design */
:root {
    --chat-gradient-primary: linear-gradient(90deg, rgba(252, 148, 60, 1) 0%, rgba(255, 101, 104, 1) 100%);
    /* Matches Hero CTA */
    --chat-bg-dark: rgba(20, 20, 20, 0.95);
    --chat-bg-light: #f5f5f5;
    --chat-text-color: #ffffff;
    --chat-text-color-secondary: #aaaaaa;
    --chat-border-radius: 16px;
    --chat-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    --chat-font-family: 'Poppins', 'Roboto', sans-serif;
}

/* Floating Action Button (FAB) */
.chatbot-toggler {
    position: fixed;
    bottom: 30px;
    right: 30px;
    outline: none;
    border: none;
    height: 60px;
    width: 60px;
    display: flex;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--chat-gradient-primary);
    box-shadow: var(--chat-shadow);
    transition: all 0.3s ease;
    z-index: 9999;
}

.chatbot-toggler:hover {
    transform: scale(1.1);
}

.chatbot-toggler span {
    color: #fff;
    position: absolute;
    font-size: 1.5REM;
    /* slightly larger icon */
}

/* Hide close icon initially */
.chatbot-toggler span:last-child,
.show-chatbot .chatbot-toggler span:first-child {
    opacity: 0;
}

/* Show close icon when active */
.show-chatbot .chatbot-toggler span:last-child {
    opacity: 1;
}

/* Chatbot Window */
.chatbot {
    position: fixed;
    right: 30px;
    bottom: 100px;
    width: 380px;
    /* Slightly wider for premium feel */
    background: var(--chat-bg-dark);
    backdrop-filter: blur(10px);
    /* Glassmorphism */
    border-radius: var(--chat-border-radius);
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.5);
    transform-origin: bottom right;
    box-shadow: var(--chat-shadow);
    transition: all 0.3s ease;
    z-index: 9999;
    font-family: var(--chat-font-family);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.show-chatbot .chatbot {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

/* Header */
.chatbot header {
    background: var(--chat-gradient-primary);
    padding: 16px 0;
    position: relative;
    text-align: center;
    color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chatbot header h2 {
    color: #fff;
    font-size: 1.6rem;
    font-weight: 600;
    margin: 0;
    letter-spacing: 0.5px;
}

.chatbot header span {
    position: absolute;
    right: 15px;
    top: 50%;
    display: none;
    /* Hide standard close button in header since we have the FAB */
    cursor: pointer;
    transform: translateY(-50%);
}

/* Chat Messages Area */
.chatbot .chatbox {
    overflow-y: auto;
    height: 400px;
    /* Good height */
    padding: 20px 20px 80px;
    /* Bottom padding for input area space */
    background: transparent;
    /* Let background of container show */
}

.chatbot .chatbox::-webkit-scrollbar {
    width: 6px;
}

.chatbot .chatbox::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.chatbot .chatbox::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}


.chatbox .chat {
    display: flex;
    list-style: none;
    margin-bottom: 15px;
}

.chatbox .incoming span {
    width: 32px;
    height: 32px;
    color: #fff;
    cursor: default;
    text-align: center;
    line-height: 32px;
    align-self: flex-end;
    background: var(--chat-gradient-primary);
    border-radius: 50%;
    margin: 0 10px 7px 0;
    font-size: 14px;
}

.chatbox .chat p {
    white-space: pre-wrap;
    padding: 12px 16px;
    border-radius: 10px 10px 10px 0;
    max-width: 75%;
    color: #fff;
    font-size: 1.3rem;
    background: rgba(255, 255, 255, 0.1);
    /* Slight white for incoming */
    backdrop-filter: blur(5px);
    line-height: 1.4;
    margin-bottom: 0;
}

.chatbox .incoming p {
    border-radius: 10px 10px 10px 0;
    color: #e0e0e0;
}

.chatbox .outgoing {
    justify-content: flex-end;
}

.chatbox .outgoing p {
    color: #fff;
    background: var(--chat-gradient-primary);
    border-radius: 10px 10px 0 10px;
}

/* Chat Input Area */
.chatbot .chat-input {
    display: flex;
    gap: 5px;
    position: absolute;
    bottom: 0;
    width: 100%;
    background: #1a1a1a;
    padding: 10px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-input textarea {
    height: 45px;
    /* Fixed height usually better for single line start */
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    max-height: 180px;
    padding: 12px 15px 12px 0;
    font-size: 1.3rem;
    background: transparent;
    color: #fff;
    font-family: var(--chat-font-family);
}

.chat-input textarea::placeholder {
    color: #777;
}

.chat-input span {
    align-self: flex-end;
    color: #ff6900;
    cursor: pointer;
    height: 45px;
    display: flex;
    align-items: center;
    visibility: hidden;
    /* Hidden when empty if you want, or always visible */
    font-size: 1.2rem;
    transition: color 0.2s;
}

.chat-input textarea:valid~span {
    visibility: visible;
}

.chat-input span:hover {
    color: #cf2e2e;
}

/* Responsive */
@media (max-width: 490px) {
    .chatbot {
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    .chatbot .chatbox {
        height: 80%;
        /* Adjust for mobile keyboard */
    }

    .chatbot header {
        padding: 20px 0;
    }
}