/* ========== THEME VARIABLES — matched to veave.in ========== */
/* Green = main menu bar, Orange = link/accent colour used in the page (#e4985b),
   Dark = the black search button / dark UI elements.
   If the menu green in css/style1.css is a slightly different hex, replace --brand-primary only. */

:root {
    --brand-primary: #7cc242;        /* header / launcher green */
    --brand-primary-dark: #68a835;   /* hover green */
    --brand-bubble: #6cb843;         /* bot message bubble */
    --brand-chip: #d3ebc6;           /* light green option chips */
    --brand-chip-hover: #bfe0ad;
    --brand-chip-text: #1f3d14;
    --brand-send: #1f7a34;           /* dark green send button */
    --brand-accent: #e4985b;         /* page accent orange */
    --brand-dark: #222222;
    --brand-text-on-primary: #ffffff;
    --brand-light-bg: #ffffff;
}



/* ========== CORE CONTAINER ELEMENTS ========== */

/* Floating Button (launcher) */
.chatbot-button {
    position: fixed;
    bottom: 90px;                 /* sits above the scroll-to-top arrow */
    right: 20px;
    width: 60px;
    height: 60px;
    background: var(--brand-primary);
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.25);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .25s ease;
    z-index: 1000;
    font-size: 14px;
    line-height: 1.4;
    font-family: var(--font-family-2, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);
}

.chatbot-button img {
    width: 32px !important;
    height: 32px !important;
    max-width: 32px;
    object-fit: contain;
}

.chatbot-button:hover {
    transform: scale(1.08);
}



/* Chat Window Shell */
.chatbot-window {
    position: fixed;
    bottom: 10px;
    right: 20px;
    width: 360px;
    height: 520px;
    max-height: calc(100vh - 20px);   /* never cut off on short screens */

    display: none;
    flex-direction: column;
    overflow: hidden;

    background: var(--brand-light-bg);
    border-radius: 10px;
    border: 1px solid #dcdcdc;
    box-shadow: 0 16px 40px rgba(0,0,0,0.3);

    z-index: 100000;                  /* above scroll-to-top and sticky menu */
    font-size: 14px;
    line-height: 1.4;
    font-family: var(--font-family-2, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);
}

/* Stop theme paragraph/heading styles leaking into the chat */
.chatbot-window p {
    margin: 0;
    text-align: left;
    font-size: 14px;
    line-height: 1.4;
}



/* ===== BIGGER CHAT WINDOW (Desktop) ===== */
.chatbot-window.chatbot-fullscreen {
    position: fixed;
    bottom: 20px;
    right: 20px;

    width: 520px;
    height: 720px;

    max-height: calc(100vh - 40px);
    border-radius: 10px;
    border: 1px solid #dcdcdc;
    box-shadow: 0 16px 40px rgba(0,0,0,0.3);

    transition: all .25s ease;
}

/* ===== LARGE TABLETS (1024px ↓) ===== */
@media (max-width: 1024px) {
    .chatbot-window.chatbot-fullscreen {
        width: 450px;
        height: 650px;
        bottom: 20px;
        right: 20px;
    }
}

/* ===== SMALL TABLETS / LARGE PHONES (768px ↓) ===== */
@media (max-width: 768px) {
    .chatbot-window.chatbot-fullscreen {
        width: 90%;
        height: 80vh;
        right: 5%;
        bottom: 10px;
    }
}

/* ===== MOBILE PHONES (480px ↓) ===== */
@media (max-width: 480px) {
    .chatbot-window.chatbot-fullscreen {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        right: 0;
        bottom: 0;
        top: 0;
        left: 0;

        border-radius: 0;
        border: none;
    }
}


#chatFullscreen {
    background: none;
    border: none;
    padding: 0 4px;
    cursor: pointer;
    color: #fff;
    font-size: 18px;
    line-height: 1;
}



/* ========== HEADER ========== */

.chat-header {
    background: var(--brand-primary) !important;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    column-gap: 12px;
    padding: 10px 12px;
    flex-shrink: 0;
}

.chat-header .chat-logo {
    max-height: 32px;
    max-width: 160px;
    object-fit: contain;
}

.chat-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

#chatRetry {
    background: none;
    border: none;
    padding: 0;
    line-height: 0;
    cursor: pointer;
}

#chatRetry img {
    width: 20px;
    height: 20px;
    display: block;
    filter: invert(1) brightness(1.5);
}

.chat-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #fff;
    font-size: 20px;
    line-height: 1;
    font-weight: 600;
    padding: 0 4px;
}



/* ========== BODY (messages area) ========== */

.chat-body {
    background: #ffffff;
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    row-gap: 10px;

    scrollbar-width: thin;
    scrollbar-color: #bbb #f9f9f9;
}

.chat-body::-webkit-scrollbar {
    width: 6px;
}

.chat-body::-webkit-scrollbar-thumb {
    background-color: #bbb;
    border-radius: 10px;
}

/* Message bubbles */
.chat-message {
    max-width: 85%;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
    padding: 10px 12px;
    word-wrap: break-word;
    box-shadow: 0 4px 10px rgba(0,0,0,0.06);
    animation: fadeUp .25s ease;
    background: #f4f4f4;
    color: #000;
    align-self: flex-end;
}

/* Bot bubble */
.chat-message.bot {
    background: var(--brand-bubble);
    color: #fff;
    font-weight: 600;
    align-self: flex-start;
    box-shadow: none;
}

.chat-message.bot p,
.bot p {
    color: #fff;
    margin: 0;
}

/* User bubble */
.chat-message.user {
    background: #f1f3f1;
    color: #1f3d14;
    border: 1px solid #dfe6dc;
    box-shadow: none;
    align-self: flex-end;
}

/* Bot message with logo + time (welcome messages) */
.bot-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    align-self: flex-start;
    max-width: 90%;
}

/* logo + bubble on one line, logo centred on the bubble */
.bot-line {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px;
}

.bot-avatar {
    width: 22px !important;
    height: 22px !important;
    max-width: 22px !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    position: static !important;
    display: block !important;
    flex: 0 0 22px;
    object-fit: contain;
}

.bot-line .chat-message {
    max-width: 100%;
    margin: 0;
}

/* agent name above follow-up messages */
.bot-name {
    margin: 0 0 3px 30px;
    font-size: 11.5px;
    font-weight: 600;
    color: #5f6b5a;
}

/* time sits under the bubble, right-aligned */
.msg-time {
    align-self: flex-end;
    margin-top: 3px;
    font-size: 11px;
    color: #8a8a8a;
}



/* ========== SUGGESTION CHIPS / OPTIONS ========== */

.suggestions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    row-gap: 8px;
    width: 100%;
    padding-left: 30px;              /* lines chips up under the bubbles */
    box-sizing: border-box;
}

.suggestion-chip {
    display: inline-block;
    background: var(--brand-chip);
    color: var(--brand-chip-text);
    font-size: 13.5px;
    line-height: 1.4;
    font-weight: 500;

    padding: 8px 14px;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: none;
    transition: all .2s ease;
    border: 1px solid transparent;
    max-width: 100%;
    text-align: left;
    word-break: break-word;
}

.suggestion-chip:hover {
    background: var(--brand-chip-hover);
    color: var(--brand-chip-text);
    border-color: var(--brand-primary);
}

#serviceSuggestions {
    display: flex;
    flex-direction: column;
    row-gap: 8px;
    width: 100%;
}

/* YES / NO group */
#yesNoOptions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
    margin-top: 8px;
    justify-content: flex-start;
}

#yesNoOptions .suggestion-chip {
    min-width: 72px;
    text-align: center;
    padding: 8px 14px;
    border-radius: 12px;
    background: var(--brand-chip);
    color: var(--brand-chip-text);
    border: 1px solid transparent;
    box-shadow: none;
    transition: all .2s ease;
}

#yesNoOptions .suggestion-chip:hover {
    background: var(--brand-primary-dark);
    color: #fff;
    border-color: var(--brand-primary-dark);
    transform: translateY(-2px);
}

/* Close Chat button (end of flow) */
#finalCloseBtn {
    display: block;
    background: var(--brand-primary);
    color: var(--brand-text-on-primary);
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;

    padding: 10px 12px;
    margin: 16px auto 8px auto;
    width: calc(100% - 32px);
    max-width: 200px;

    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: background .2s ease, box-shadow .2s ease;
}

#finalCloseBtn:hover {
    background: var(--brand-primary-dark);
    color: #fff;
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}



/* ========== CONTACT FORM BLOCK (green enquiry card) ========== */

.chat-form {
    background: var(--brand-bubble);
    border: none;
    border-radius: 10px;

    display: flex;
    flex-direction: column;
    gap: 10px;

    padding: 12px 10px 14px;
    width: 92%;
    max-width: 260px;
    margin-left: 30px;               /* lines up under the bot bubbles */
    box-sizing: border-box;

    box-shadow: none;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
}

.chat-form-title {
    color: #fff;
    font-weight: 600;
    font-size: 14.5px;
    line-height: 1.35;
    text-align: center;
    margin-bottom: 2px;
}

.chat-form input,
.chat-form select {
    width: 100%;
    height: 38px;
    margin: 0 !important;
    background: #fff;
    border: 1px solid #d9e8cf;
    border-radius: 4px;
    box-sizing: border-box;

    padding: 6px 10px;
    font-size: 14px;
    line-height: 1.4;
    color: #1a1f2d;
    outline: none;
    font-family: inherit;
    box-shadow: none;
}

.chat-form input::placeholder {
    color: #9a9a9a;
    opacity: 1;
}

.chat-form input:focus,
.chat-form select:focus {
    border-color: var(--brand-send);
    box-shadow: 0 0 0 2px rgba(31,122,52,0.25);
}

/* Phone row: small country-code box + number field */
.chat-form .phone-group {
    display: flex;
    gap: 0;
    margin-top: 0;
    background: #fff;
    border: 1px solid #d9e8cf;
    border-radius: 4px;
    overflow: hidden;
}

/* Country button: flag + arrow only (left side) */
.chat-form .cb-cc-btn {
    flex: 0 0 auto;
    align-self: stretch;
    width: auto !important;
    min-width: 0 !important;
    line-height: 1 !important;
    display: flex;
    align-items: center;
    gap: 4px;
    height: 38px;
    padding: 0 7px 0 8px;
    margin: 0;
    background: #fff;
    border: none;
    border-right: 1px solid #e3e3e3;
    border-radius: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: 13.5px;
    color: #1a1f2d;
}

.chat-form .cb-cc-btn:hover { background: #f4faf0; }

/* Flag is a <span> with a background image, so the site's global <img> rules can't stretch it */
.chat-form .cb-flag {
    display: inline-block !important;
    flex: 0 0 20px !important;
    width: 20px !important;
    height: 14px !important;
    min-height: 0 !important;
    max-height: 14px !important;
    background-color: #eee;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.12);
    margin: 0 !important;
    padding: 0 !important;
}

.chat-form .cb-caret {
    font-size: 10px;
    color: #777;
}

.chat-form .phone-group input {
    flex: 1;
    min-width: 0;
    border: none;
    border-radius: 0;
    padding-left: 4px !important;      /* number starts right after the code */
}

/* ISD code shown inside the number box, before the number (right side) */
.chat-form .cb-cc-dial {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    padding-left: 10px;
    background: #fff;
    color: #1a1f2d;
    font-size: 14px;
    line-height: 1;
    white-space: nowrap;
    cursor: text;
}

.chat-form .phone-group input:focus {
    box-shadow: none;
}

/* Country list: opens inside the card, under the phone row */
.chat-form .cb-cc-list {
    background: #fff;
    border-radius: 4px;
    margin-top: -4px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.chat-form .cb-cc-list[hidden] { display: none; }

.chat-form .cb-cc-search {
    height: 34px !important;
    border: none !important;
    border-bottom: 1px solid #e3e3e3 !important;
    border-radius: 0 !important;
    font-size: 13px !important;
}

.chat-form .cb-cc-list ul {
    list-style: none;
    margin: 0;
    padding: 4px 0;
    max-height: 180px;
    overflow-y: auto;
}

.chat-form .cb-cc-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    font-size: 13px;
    color: #1a1f2d;
    cursor: pointer;
    line-height: 1.3;
}

.chat-form .cb-cc-list li:hover { background: #eef7e8; }

.chat-form .cb-cc-name { flex: 1; }

.chat-form .cb-cc-code {
    color: #777;
    font-size: 12.5px;
}

.chat-form .cb-cc-list li.cb-cc-divider {
    height: 1px;
    padding: 0;
    margin: 4px 0;
    background: #e3e3e3;
    cursor: default;
}

.chat-form button#cbSubmitBtn {
    align-self: center;
    width: auto;
    min-width: 110px;
    margin-top: 4px;
    background: var(--brand-send);
    color: #fff;
    border: none;
    border-radius: 6px;

    padding: 9px 22px;
    font-size: 14.5px;
    line-height: 1.4;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s ease, box-shadow .2s ease;
    font-family: inherit;
}

.chat-form button#cbSubmitBtn:hover {
    background: #17602a;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.chat-form button#cbSubmitBtn:disabled {
    background: #9ab89f;
    cursor: not-allowed;
}

/* Errors: readable on the green card */
.field-error {
    margin-top: -4px;
    font-size: 12px;
    color: #fff;
    background: #c62828;
    padding: 2px 8px;
    border-radius: 4px;
    align-self: flex-start;
}

.input-error {
    border: 1.5px solid #c62828 !important;
}

.phone-group:has(.input-error) {
    border: 1.5px solid #c62828;
}




/* ========== FOOTER INPUT BAR ========== */

.chat-footer {
    background: #f8f9fa;
    border-top: 1px solid #ddd;
    padding: 10px;
    display: flex;
    align-items: center;
    column-gap: 8px;
    font-size: 14px;
    line-height: 1.4;
    flex-shrink: 0;
}

#chatInput {
    flex: 1;
    min-width: 0;
    height: 40px;
    margin: 0;
    background: #fff;
    border: 1px solid #cfe6bf;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    line-height: 1.4;
    color: #1a1f2d;
    outline: none;
    font-family: inherit;
}

#chatInput::placeholder {
    color: #888;
    opacity: 1;
}

#chatInput:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 2px rgba(125,194,67,0.3);
}

#chatInput:disabled {
    background: #eceeef;
    color: #999;
    cursor: not-allowed;
}

/* Send button — fixed size so the icon can't stretch */
#sendBtn {
    flex: 0 0 40px;
    background: var(--brand-send);
    border: none;
    border-radius: 6px;
    width: 40px;
    height: 40px;
    padding: 0;
    overflow: hidden;

    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--brand-text-on-primary);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: background .2s ease, box-shadow .2s ease;
}

#sendBtn img,
#sendBtn svg {
    width: 20px !important;
    height: 20px !important;
    max-width: 20px;
    max-height: 20px;
    object-fit: contain;
    display: block;
    filter: brightness(0) invert(1);   /* white icon on dark green */
}

#sendBtn:disabled {
    background: #bdbdbd;
    cursor: not-allowed;
    box-shadow: none;
}

#sendBtn:not(:disabled):hover {
    background: #17602a;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}



/* ========== ANIMATIONS ========== */

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}



/* ========== RESPONSIVE (mobile narrow screens) ========== */

@media screen and (max-width: 480px) {
    .chatbot-window {
        width: 90%;
        right: 5%;
        bottom: 80px;
        max-height: 70vh;
    }

    .chat-header .chat-logo {
        max-width: 140px;
        max-height: 24px;
    }
}



/* ========== "CHAT WITH US" PILL LAUNCHER ========== */

.open-chat-popup {
    position: fixed;
    bottom: 90px;                     /* was 20px — sat on top of the scroll-to-top arrow */
    right: 20px;
    padding: 10px 18px;
    background: var(--brand-primary);
    color: var(--brand-text-on-primary);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    border-radius: 30px;
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    transition: all 0.3s ease;
    z-index: 1000;
}

.open-chat-popup:hover {
    transform: translateY(-4px);
    background: var(--brand-primary-dark);
    color: #fff;
}

.open-chat-popup::before { content: "Chat with Us"; }

/* The old ::after pointed at /mnt/data/...png, which doesn't exist on the server.
   Any icon the script puts inside the pill is now capped at 22px. */
.open-chat-popup img,
.open-chat-popup svg {
    width: 22px !important;
    height: 22px !important;
    max-width: 22px;
    object-fit: contain;
    display: block;
}



.instruction-text {
    margin: 10px 0;
    font-size: 14px;
    color: #666;
}

#chatbotContainer  { display: block; }
#chatbotContainer1 { display: none; }


/* ========== WHATSAPP BUTTON (same green as the bot messages) ========== */
.cb-wa-btn {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 4px 0 0 30px;
    padding: 9px 14px;
    background: var(--brand-bubble);        /* same as "Get a FREE Consultation…" bubble */
    color: #fff;
    border: none;
    border-radius: 8px;                     /* same corners as the bot bubbles */
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    box-shadow: none;
    transition: background .2s ease;
}

.cb-wa-btn:hover {
    background: var(--brand-primary-dark);
}

/* Bootstrap Icons WhatsApp icon */
.cb-wa-btn .bi {
    font-size: 17px;
    line-height: 1;
    color: #fff;
}

/* WhatsApp button sitting above "Close Chat" at the end of a conversation */
.cb-wa-btn + #finalCloseBtn {
    margin-top: 8px;
}