﻿#chatToggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #007bff;
    color: #fff;
    padding: 12px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1000;
}



/* Wide header for desktop */
#chatHeaderBar {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #007bff;
    color: white;
    padding: 12px 20px;
    border-radius: 20px;
    cursor: pointer;
    z-index: 1000;
    font-weight: bold;
}

/* Show only bubble on small screens */
@media screen and (max-width: 767px) {
    #chatToggle {
        display: block;
    }

    #chatHeaderBar {
        display: none;
    }
}

/* Show only wide header on larger screens */
@media screen and (min-width: 768px) {
    #chatToggle {
        display: none;
    }

    #chatHeaderBar {
        display: block;
    }
}


#chatWidget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    max-width: 90vw;
    height: 570px; /* Set fixed height */
    display: flex;
    flex-direction: column;
    border: 1px solid #ccc;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    overflow: hidden;
    z-index: 10000;
    font-family: Arial, sans-serif;

}
/* Desktop */
.chat-toggle-desktop {
    background: #27ae60;
    color: #fff;
    padding: 10px 15px;
    border-radius: 8px;
}

/* Mobile balloon style */
.chat-toggle-mobile {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #27ae60;
    color: #fff;
    font-size: 20px;
    padding: 0;
    text-align: center;
    line-height: 50px;
}


#chat-header {
    background-color: #0078D7;
    color: white;
    padding: 10px;
    font-weight: bold;
    flex-shrink: 0;
}

#chatMessages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    font-size: 14px;
    line-height: 1.4;
    background: #f9f9f9;
    max-height: 80%;
}

.message {
    display: inline-block;
    position: relative;
    margin: 5px 5px 5px 5px;
    padding: 5px 7px;
    border-radius: 18px;
    max-width: 95%;
    width: 95%;
    font-family: sans-serif;
    line-height: 1.3;
    word-wrap: break-word;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

    /* User messages */
    .message.you {
        background-color: #dcf8c6; /* WhatsApp-style green */
        align-self: flex-end;
        margin-left: auto;
        text-align: left;
        border-bottom-right-radius: 4px;
    }

    /* Swift AI responses */
    .message.swift_ai {
        background-color: #eef3f9;
        align-self: flex-start;
        margin-right: auto;
        text-align: left;
        border-bottom-left-radius: 4px;
        border-left: 4px solid #3b82f6;
    }

    .message.you::after {
        content: "";
        position: absolute;
        right: -8px;
        top: 10px;
        width: 0;
        height: 0;
        border-left: 10px solid #dcf8c6;
        border-top: 10px solid transparent;
        border-bottom: 10px solid transparent;
    }

    .message.swift_ai::after {
        content: "";
        position: absolute;
        left: -8px;
        top: 10px;
        width: 0;
        height: 0;
        border-right: 10px solid #eef3f9;
        border-top: 10px solid transparent;
        border-bottom: 10px solid transparent;
    }
#suggestedQuestions {
    padding: 10px;
    border-top: 1px solid #ccc;
    background: #f1f1f1;
    max-height: 420px;
    display: flex;
    flex-direction: column;
    align-items: center; /* optional, centers horizontally too */
    overflow-y: auto;
    text-align: center; /* optional, for cleaner alignment */
}

    #suggestedQuestions p {
        margin: 0 0 5px;
        font-weight: bold;
    }

    #suggestedQuestions button {
        margin: 2px 2px 4px 0;
        padding: 6px 10px;
        font-size: 13px;
        background: #1e90ff;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        color: white
    }

#chat-header {
    background-color: #0078D7;
    color: white;
    padding: 10px;
    font-weight: bold;
    flex-shrink: 0;
}

#leadForm {
    padding: 3px;
    border-top: 1px solid #ccc;
    background: #fff;
    overflow-y: auto;
}

    #leadForm input,
    #leadForm textarea {
        width: 100%;
        margin-bottom: 5px;
        padding: 6px;
        border: 1px solid #ccc;
        border-radius: 4px;
        font-size: 13px;
    }

    #leadForm button {
        width: 100%;
        padding: 8px;
        font-size: 14px;
        background: #007bff;
        color: white;
        border: none;
        border-radius: 4px;
        cursor: pointer;
    }

.input-container {
    display: flex;
    padding: 5px;
    border-top: 1px solid #ccc;
    background: #fff;
    width: 100%;
    box-sizing: border-box; /* ensures padding doesn't overflow */
    position: sticky;
    bottom: 0;
}

    .input-container input[type="text"] {
        flex: 1;
        padding: 6px;
        font-size: 14px;
        box-sizing: border-box; /* important for responsive layouts */
        min-width: 0; /* prevents flex shrinking issues in some browsers */
    }

    .input-container button {
        padding: 6px 12px;
        margin-left: 5px;
        background-color: #007bff;
        color: white;
        border: none;
        font-size: 14px;
        border-radius: 4px;
        cursor: pointer;
    }
#suggestedQuestions,
#leadForm,
.input-container {
    flex-shrink: 0;
}

#formMessage {
    padding: 8px;
    font-size: 13px;
    text-align: center;
}

.typing-indicator-container {
    display: flex;
    justify-content: flex-start;
    padding: 8px 16px;
}

.typing-indicator {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 4px 8px;
    background: #f1f1f1;
    border-radius: 12px;
}

    .typing-indicator span {
        display: inline-block;
        width: 6px;
        height: 6px;
        margin: 0 2px;
        background-color: #888;
        border-radius: 50%;
        animation: bounce 1.4s infinite ease-in-out both;
    }

        .typing-indicator span:nth-child(1) {
            animation-delay: -0.32s;
        }

        .typing-indicator span:nth-child(2) {
            animation-delay: -0.16s;
        }

        .typing-indicator span:nth-child(3) {
            animation-delay: 0;
        }

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

.send-btn {
    background-color: #27ae60;
    border: none;
    padding: 10px;
    border-radius: 50%;
    margin-left: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

    .send-btn svg {
        fill: #fff;
    }


.cool-button {
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: white;
    font-size: 16px;
    font-weight: bold;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
}

    .cool-button:hover {
        background: linear-gradient(45deg, #0056b3, #007bff);
        transform: scale(1.05);
    }

    .cool-button:active {
        transform: scale(0.95);
    }

:root {
    --chat-color: #3498db; /* Default theme */
}

#chatToggleButton, #chat-header, .cool-button {
    background-color: var(--chat-color);
    transition: 0.3s ease-in-out;
}