/* --- Local Fonts & CSS Variables --- */
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 400; /* Regular weight */
    src: url('../../assets/fonts/Poppins-Regular.ttf') format('truetype');
}

@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 700; /* Bold weight */
    src: url('../../assets/fonts/Poppins-Bold.ttf') format('truetype');
}

@font-face {
    font-family: 'Material Icons Outlined';
    font-style: normal;
    font-weight: 400;
    src: url('../../assets/fonts/MaterialIconsOutlined-Regular.otf') format('opentype');
}

:root {
    --primary-color: #e75a25;
    --secondary-color: #f0f2f5;
    --text-color: #333;
    --light-text-color: #fff;
    --bubble-incoming: #f2f2f2;
    --bubble-outgoing: #724ae8;
    --border-color: #ccc;
    --box-shadow: 0 0 12px 0 rgba(0, 0, 0, 0.15);
    --button-bg: var(--primary-color);
}

/* * { */
    /* margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif; */
/* } */

/* body { */
    /* background-color: var(--secondary-color);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color); */
/* } */

.chatbot-toggler {
    position: fixed;
    bottom: 30px;
    right: 35px;
    height: 60px;
    width: 60px;
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    z-index: 1000;
    box-shadow: var(--box-shadow);
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

/* .chatbot-toggler {
    position: fixed;
    bottom: 30px;
    right: 35px; */
    /* ... existing styles ... */
    /* transition: all 0.3s ease-in-out;
    z-index: 2147483647 !important; /* MAKE THIS CHANGE 
    box-shadow: var(--box-shadow);
    outline: none;
    -webkit-tap-highlight-color: transparent;
} */

.chatbot-toggler:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.chatbot-toggler:active {
    transform: scale(0.95);
}

.chatbot-toggler span {
    color: var(--light-text-color);
    font-size: 2rem;
    position: absolute;
    transition: all 0.3s ease-in-out;
    font-family: 'Material Icons Outlined', sans-serif;
}

.chatbot-toggler .chat-icon {
    opacity: 1;
    transform: rotate(0deg);
}

.chatbot-toggler .close-icon {
    opacity: 0;
    transform: rotate(90deg);
}

.show-chatbot .chatbot-toggler .chat-icon {
    opacity: 0;
    transform: rotate(-90deg);
}

.show-chatbot .chatbot-toggler .close-icon {
    opacity: 1;
    transform: rotate(0deg);
}

/*
    ----------------------------------------
    3. Chatbot Window Container
    ----------------------------------------
*/
.chatbot-window {
    position: fixed;
    right: 35px;
    bottom: 100px;
    width: 420px;
    max-width: 90%;
    height: 600px;
    max-height: 80vh;
    background: var(--light-text-color);
    border-radius: 15px;
     overflow: hidden;
   opacity: 0;
     pointer-events: none;
    transform: scale(0.5);
    transform-origin: bottom right;
    box-shadow: var(--box-shadow);
    transition: all 0.3s ease-in-out;
    z-index: 999;
    display: flex;
    flex-direction: column;
} 

/* .chatbot-window {
    position: fixed;
    right: 35px;
    bottom: 100px; */
    /* ... existing styles ... */
    /* transition: all 0.3s ease-in-out;
    z-index: 2147483646 !important; /* MAKE THIS CHANGE (slightly lower than toggler) 
    display: flex;
    flex-direction: column;
} */

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

.chatbot-header {
    padding: 16px 25px;
    background: var(--primary-color);
    color: var(--light-text-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.chatbot-header h2 {
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Updated Header Button Group */
.chatbot-header .header-buttons {
    display: flex;
    gap: 10px;
}

.chatbot-header .close-btn,
.chatbot-header .home-btn {
    background: none;
    border: none;
    color: var(--light-text-color);
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    font-family: 'Material Icons Outlined', sans-serif;
}

.chatbot-header .close-btn:hover {
    transform: rotate(90deg);
}

.chatbot-header .home-btn:hover {
    transform: scale(1.1);
}

.chatbox {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px 25px;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) #f0f2f5;
}

.chatbox::-webkit-scrollbar {
    width: 8px;
}

.chatbox::-webkit-scrollbar-track {
    background: #f0f2f5;
}

.chatbox::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 4px;
    border: 2px solid #f0f2f5;
}

.chatbox .chat {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    position: relative;
}

.chatbox .chat-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: var(--light-text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chatbox .chat-avatar .material-icons {
    font-size: 1.2rem;
    font-family: 'Material Icons Outlined', sans-serif;
}

.chatbox .chat-bubble {
    padding: 12px 18px;
    font-size: 0.95rem;
    border-radius: 18px;
    max-width: 75%;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
}

.chatbox .chat.incoming .chat-bubble {
    background: var(--bubble-incoming);
    color: var(--text-color);
    border-bottom-left-radius: 5px;
    margin-right: 30px;
}

.chatbox .chat.outgoing {
    justify-content: flex-end;
    text-align: right;
}

.chatbox .chat.outgoing .chat-bubble {
    background: var(--bubble-outgoing);
    color: var(--light-text-color);
    border-bottom-right-radius: 5px;
    margin-left: 30px;
}

.chatbox .chat-meta {
    font-size: 0.75rem;
    color: #888;
    position: absolute;
    bottom: -18px;
    white-space: nowrap;
}

.chatbox .chat.incoming .chat-meta {
    left: 45px;
}

.chatbox .chat.outgoing .chat-meta {
    right: 0;
}

/* New: Styling for Initial Welcome Message */
.chatbox .chat.incoming.initial {
    background-color: transparent;
    border-bottom: none;
    margin-bottom: 20px;
}

.chatbox .chat.incoming.initial .chat-bubble {
    background-color: transparent;
    padding: 0;
    margin: 0;
}

.chatbox .chat.incoming.initial .chat-meta {
    display: none;
}

.chatbox .chat.incoming.initial .chat-avatar {
    display: none;
}

/* New: Typing Indicator styles */
.chatbox .typing-indicator {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 12px 18px;
}

.chatbox .typing-indicator-dots {
    display: flex;
    gap: 4px;
}

.chatbox .typing-indicator-dots span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--primary-color);
    border-radius: 50%;
    opacity: 0.3;
    animation: typing-dots 1s infinite;
}

.chatbox .typing-indicator-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.chatbox .typing-indicator-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing-dots {
    0%, 100% {
        transform: translateY(0);
        opacity: 0.3;
    }
    50% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

/* New: Styles for Button-Based Suggestions */
.chatbox .chat-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 5px;
}

.chatbox .suggestion-btn {
    background-color: var(--button-bg);
    color: var(--light-text-color);
    border: none;
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.chatbox .suggestion-btn:hover {
    background-color: #5a3ba8;
    transform: translateY(-2px);
}

.chatbox .suggestion-btn:active {
    transform: translateY(0);
}

.chat-input-area {
    padding: 15px 25px;
    background: var(--light-text-color);
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-input-area .input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 5px;
    transition: border-color 0.2s ease;
}

.chat-input-area .input-wrapper:focus-within {
    border-color: var(--primary-color);
}

.chat-input-area textarea {
    flex-grow: 1;
    height: 40px;
    max-height: 150px;
    border: none;
    outline: none;
    resize: none;
    font-size: 1rem;
    padding: 10px;
    background: transparent;
    -webkit-appearance: none;
}

.chat-input-area .send-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-family: 'Material Icons Outlined', sans-serif;
    font-size: 1.8rem;
    cursor: pointer;
    align-self: flex-end;
    padding: 8px;
    transition: transform 0.2s ease;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.chat-input-area .send-btn:hover {
    transform: scale(1.1);
}

.chat-input-area .input-footer {
    text-align: center;
    font-size: 0.7rem;
    color: #aaa;
}

@media (max-width: 768px) {
    .chatbot-toggler {
        bottom: 20px;
        right: 20px;
        height: 55px;
        width: 55px;
    }
    
    .chatbot-toggler span {
        font-size: 1.8rem;
        font-family: 'Material Icons Outlined', sans-serif;
    }

    .chatbot-window {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
        right: 0;
        bottom: 0;
        box-shadow: none;
    }

    .chatbot-header {
        padding: 14px 20px;
    }

    .chatbox {
        padding: 15px 20px;
    }
}