﻿/* ==========================================
   1. THEME VARIABLES
========================================== */

#chatbotPanel {
    --primary: #FF8C00;
    --primary-hover: #E67E00;
    --panel-bg: #FFFFFF;
    --chat-bg: #FFF9F0;
    --bot-bg: #FFF0D9;
    --bot-text: #352B20;
    --user-text: #FFFFFF;
    --input-bg: #FFFFFF;
    --border-color: #F2D7B5;
    --muted-text: #8A6A42;
    --header-text: #FFFFFF;
    box-sizing: border-box;
}

    /* DARK THEME */
    #chatbotPanel[data-theme="dark"] {
        --primary: #444444;
        --primary-hover: #333333;
        --panel-bg: #1E1E1E;
        --chat-bg: #151515;
        --bot-bg: #303030;
        --bot-text: #F1F1F1;
        --user-text: #FFFFFF;
        --input-bg: #252525;
        --border-color: #444444;
        --muted-text: #BBBBBB;
        --header-text: #FFFFFF;
    }

    /* GREEN THEME */
    #chatbotPanel[data-theme="green"] {
        --primary: #00B526;
        --primary-hover: #00951F;
        --panel-bg: #FFFFFF;
        --chat-bg: #F3FFF5;
        --bot-bg: #E1F7E6;
        --bot-text: #164321;
        --user-text: #FFFFFF;
        --input-bg: #FFFFFF;
        --border-color: #C5E8CE;
        --muted-text: #54835C;
        --header-text: #FFFFFF;
    }

    /* BLUE THEME */
    #chatbotPanel[data-theme="blue"] {
        --primary: #5f73e0;
        --primary-hover: #051363;
        --panel-bg: #FFFFFF;
        --chat-bg: #F4F6FF;
        --bot-bg: #E5EAFF;
        --bot-text: #172554;
        --user-text: #FFFFFF;
        --input-bg: #FFFFFF;
        --border-color: #CCD5F2;
        --muted-text: #53628D;
        --header-text: #FFFFFF;
    }



/* ==========================================
   2. MAIN WEBSITE
========================================== */
body {
    background: #00000000;
}
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: transparent;
}
.chatbot-home {
    font-family: Arial, sans-serif;
    padding: 35px 20px;
    color: #263445;
}

    .chatbot-home h1 {
        font-size: 28px;
        margin-bottom: 10px;
    }

    .chatbot-home p {
        color: #64748b;
    }

nav.navbar.navbar-expand-sm.navbar-toggleable-sm.navbar-light.bg-white.border-bottom.box-shadow.mb-3 {
    background: #00000000 !important;
    border: 0 !IMPORTANT;
    box-shadow: none !important;
}

.footer[b-dy2cwvinwv] {
    border: 0 !important;
}
/* ==========================================
   3. FLOATING CHATBOT ICON
========================================== */

/* Main floating chatbot container */
.chatbot-launcher {
    position: fixed;
    right: 25px;
    bottom: 25px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

/* Greeting popup  position: relative; */
.chatbot-greeting {
    width: 275px;
    max-width: calc(100vw - 39px);
    padding: 4px 27px 5px 16px;
    box-sizing: border-box;
    background: #f8992d;
    color: #ffffff;
    border-radius: 14px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.18);
    font-size: 15px;
    font-weight: 500;
    line-height: 21px;
    overflow-wrap: break-word;
    white-space: normal;
    position: absolute;
    right: 80px;
}

/* Greeting close button */
.chatbot-greeting-close {
    position: absolute;
    top: 7px;
    right: 10px;
    padding: 0;
    margin: 0;
    border: none;
    outline: none;
    box-shadow: none;
    background: transparent;
    color: #ffffff;
    font-size: 23px;
    line-height: 22px;
    cursor: pointer;
}

/* Floating chatbot button */
#openChatbot {
    position: relative;
    width: 64px;
    height: 64px;
    min-width: 64px;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    border-radius: 50%;
    background: transparent !important;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    flex-shrink: 0;
    line-height: 0;
    transition: transform 0.2s ease;
}

    /* Chatbot image */
    #openChatbot img {
        display: block;
        width: 100px;
        height: 100px;
        object-fit: contain;
        border: none;
        outline: none;
        box-shadow: none;
        background: transparent;
    }

    /* Hover effect */
    #openChatbot:hover {
        transform: scale(1.05);
    }

/* Mobile layout */
@media (max-width: 576px) {
    .chatbot-launcher {
        right: 15px;
        bottom: 15px;
    }

    .chatbot-greeting {
        width: 250px;
    }
}

@keyframes greetingAppear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ==========================================
   4. MAIN CHATBOT PANEL
========================================== */

#chatbotPanel {
    display: none;
    position: fixed;
    right: 25px;
    bottom: 100px;
    width: 460px;
    height: 650px;
    max-width: calc(100vw - 30px);
    max-height: calc(100vh - 125px);
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 0 12px 40px #0002;
    overflow: hidden;
    flex-direction: column;
    z-index: 999;
    transition: background .2s;
    box-sizing: border-box;
}

    #chatbotPanel.open {
        display: flex;
    }

    /* Hidden HTML elements must remain hidden. */
    #chatbotPanel [hidden] {
        display: none !important;
    }


/* ==========================================
   5. CHATBOT HEADER
========================================== */

.chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 17px;
    background: var(--primary);
    color: var(--header-text);
    min-height: 72px;
    flex-shrink: 0;
    box-sizing: border-box;
}

.chatbot-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-avatar {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    background: #ffffff30;
    border-radius: 50%;
    font-size: 20px;
}

.chatbot-title strong {
    font-size: 17px;
}

.chatbot-subtitle {
    display: block;
    font-size: 11px;
    opacity: .85;
    margin-top: 3px;
}

.chatbot-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chatbot-header button {
    border: none;
    background: transparent;
    color: white;
    font-size: 21px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
}

    .chatbot-header button:hover {
        background: #ffffff25;
    }


/* ==========================================
   CHATBOT THEME COLOR SELECTOR
========================================== */

.theme-color-options {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Individual color buttons */
.chatbot-header-actions .theme-swatch {
    width: 27px;
    height: 27px;
    min-width: 27px;
    padding: 0;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 3px;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

/* Saffron */
.theme-swatch[data-theme="saffron"] {
    background: #FF8C00;
}

/* Dark */
.theme-swatch[data-theme="dark"] {
    background: #444444;
}

/* Green */
.theme-swatch[data-theme="green"] {
    background: #00B526;
}

/* Blue */
.theme-swatch[data-theme="blue"] {
    background: #071A85;
}

/* Hover effect */
.chatbot-header-actions .theme-swatch:hover {
    transform: scale(1.12);
}

/* Selected theme indicator */
.chatbot-header-actions .theme-swatch.active {
    outline: 2px solid #FFFFFF;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.25);
}

/* Keyboard accessibility */
.chatbot-header-actions .theme-swatch:focus-visible {
    outline: 2px solid #FFFFFF;
    outline-offset: 3px;
}



/* ==========================================
   6. WELCOME SCREEN
========================================== */

.welcome-screen {
    flex: 1;
    min-height: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 25px;
    background: var(--chat-bg);
    color: var(--bot-text);
    text-align: center;
    box-sizing: border-box;
}

.welcome-content {
    width: 100%;
    max-width: 360px;
    animation: screenAppear .35s ease;
}

.welcome-icon {
    width: 65px;
    height: 65px;
    display: grid;
    place-items: center;
    margin: 0 auto 22px;
    border-radius: 50%;
    background: var(--bot-bg);
    font-size: 30px;
}

.welcome-content h2 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 12px;
}

.welcome-content h3 {
    font-size: 19px;
    font-weight: 600;
    margin: 0 0 12px;
    color: var(--primary);
}

.welcome-content p {
    font-size: 15px;
    color: var(--muted-text);
    line-height: 1.6;
    margin: 8px 0;
}

.welcome-content .welcome-description {
    font-size: 13px;
    margin-top: 15px;
}

.start-conversation-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 30px;
    padding: 14px 25px;
    border: none;
    border-radius: 10px;
    background: var(--primary);
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, transform .2s;
}

    .start-conversation-button:hover {
        background: var(--primary-hover);
        transform: translateY(-2px);
    }

    .start-conversation-button span {
        font-size: 20px;
    }


/* ==========================================
   7. CONVERSATION SCREEN
========================================== */

.conversation-screen {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--chat-bg);
    overflow: hidden;
}

/* Message area */

#chatMessages {
    flex: 1 1 0;
    min-height: 80px;
    padding: 18px 15px;
    overflow-y: auto;
    background: var(--chat-bg);
    box-sizing: border-box;
}

.chat-message {
    max-width: 88%;
    padding: 12px 14px;
    border-radius: 14px;
    margin-bottom: 14px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.65;
    font-size: 14px;
    animation: messageAppear .2s ease;
}

.bot-message {
    background: var(--bot-bg);
    color: var(--bot-text);
    margin-right: auto;
    border-bottom-left-radius: 4px;
}

.user-message {
    background: var(--primary);
    color: var(--user-text);
    margin-left: auto;
    border-bottom-right-radius: 4px;
}


/* ==========================================
   8. SUGGESTED QUESTIONS
========================================== */

.suggestions-container {
    padding: 12px 14px 10px;
    background: var(--chat-bg);
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

    .suggestions-container h4 {
        font-size: 13px;
        font-weight: 700;
        margin: 0 0 5px;
        color: var(--bot-text);
    }

    .suggestions-container p {
        font-size: 11px;
        color: var(--muted-text);
        margin: 0 0 10px;
    }

.suggested-questions {
    display: flex;
    flex-direction: column;
    gap: 7px;
    max-height: 175px;
    overflow-y: auto;
    padding: 2px;
}

.suggested-question {
    width: 100%;
    text-align: left;
    padding: 9px 12px;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    background: var(--panel-bg);
    color: var(--bot-text);
    font-size: 12px;
    line-height: 1.45;
    cursor: pointer;
    transition: border-color .2s, background .2s;
}

    .suggested-question:hover {
        border-color: var(--primary);
        background: var(--bot-bg);
    }

    .suggested-question:focus-visible {
        outline: 2px solid var(--primary);
        outline-offset: 2px;
    }


/* ==========================================
   9. CHAT STATUS
========================================== */

#chatStatus {
    flex-shrink: 0;
    padding: 0 15px 8px;
    font-size: 12px;
    color: var(--muted-text);
    background: var(--chat-bg);
}


/* ==========================================
   10. CHAT INPUT AREA
========================================== */

.chatbot-input-area {
    display: flex;
    gap: 9px;
    padding: 13px;
    align-items: flex-end;
    border-top: 1px solid var(--border-color);
    background: var(--panel-bg);
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
}

#chatMessageInput {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    max-height: 160px;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    outline: none;
    resize: none;
    overflow-y: hidden;
    background: var(--input-bg);
    color: var(--bot-text);
    font-size: 14px;
    line-height: 20px;
    font-family: inherit;
    box-sizing: border-box;
}

    #chatMessageInput:focus {
        border-color: var(--primary);
    }

    #chatMessageInput::placeholder {
        color: var(--muted-text);
    }

#sendChatMessage {
    width: 44px;
    height: 44px;
    min-width: 44px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 600;
    flex-shrink: 0;
    cursor: pointer;
    transition: background .2s, opacity .2s;
}

    #sendChatMessage:hover {
        background: var(--primary-hover);
    }

    #sendChatMessage:disabled {
        opacity: .6;
        cursor: not-allowed;
    }


/* ==========================================
   11. MAXIMIZED CHATBOT
========================================== */

#chatbotPanel.maximized {
    width: min(750px, calc(100vw - 30px));
    height: min(800px, calc(100vh - 125px));
}


/* ==========================================
   12. ANIMATIONS
========================================== */

@keyframes messageAppear {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes screenAppear {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ==========================================
   13. RESPONSIVE DESIGN
========================================== */

@media (max-width: 480px) {

    #chatbotPanel {
        right: 10px;
        bottom: 85px;
        width: calc(100vw - 20px);
        height: 80vh;
        max-height: calc(100vh - 100px);
    }

        #chatbotPanel.maximized {
            width: calc(100vw - 20px);
            height: 88vh;
        }

    #themeSelector {
        width: 82px;
    }

    .chatbot-header {
        padding: 12px;
    }

    .chatbot-header-actions {
        gap: 4px;
    }

    .welcome-content h2 {
        font-size: 24px;
    }

    .welcome-content h3 {
        font-size: 17px;
    }

    .suggested-questions {
        max-height: 150px;
    }

    #openChatbot {
        right: 18px;
        bottom: 8px;
    }
}

#chatbotPanel,
.chatbot-launcher {
    pointer-events: auto;
}

/* Embedded chatbot widget mode */

body.widget-mode {
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: transparent !important;
}

body.widget-mode .chatbot-launcher {
        position: fixed;
        right: 0;
        bottom: 0;
        width: 338px;
        height: 64px;
        gap: 0;
    }

body.widget-mode #openChatbot {
        width: 64px;
        height: 64px;
        min-width: 64px;
    }

body.widget-mode #openChatbot img {
            width: 64px;
            height: 64px;
        }

body.widget-mode #chatbotPanel {
        position: fixed;
        right: 0 !important;
        bottom: 0 !important;
        width: 460px !important;
        height: 650px !important;
        max-width: 100vw;
        max-height: 100vh;
    }

body.widget-mode.widget-chat-open .chatbot-launcher {
        display: none;
    }

body.widget-mode {
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

body.widget-mode #chatbotPanel {
        position: fixed !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 460px !important;
        height: 650px !important;
        max-width: none !important;
        max-height: none !important;
        box-sizing: border-box !important;
        z-index: 999999 !important;
    }

body.widget-mode #chatbotPanel.open {
    display: flex !important;
}
