﻿body {
    margin: 0;
    /*overflow: hidden;*/
    font-family: "Arial", sans-serif;
}
.chat-container {
    width: 400px;
    height: 500px;
    resize: both;
    overflow: hidden;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    background: #fff;
    display: none;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    min-width: 350px;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    gap:0;
}

.chat-header {
    /*background: linear-gradient(45deg, #1a73e8, #4285f4);*/
    color: white;
    padding: 12px;
    cursor: move;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-body {
    background: #f4f7fc;
    padding: 10px;
    height: calc(100% - 140px);
    overflow-y: auto;
    max-height: calc(100% - 50px);
    word-wrap: break-word;
    overflow-x: hidden;
}

.chat-footer {
    padding: 12px;
    display: flex;
    gap: 10px;
    background: #fff;
    position: relative;
    bottom: 0;
    width: 100%;
    border-top: 1px solid #eee;
}

.chat-input {
    flex-grow: 1;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background-color: #fafafa;
    font-size: 14px;
}

.chat-message {
    color:black;
    font-weight:400;
    padding: 12px;
    margin-bottom: 12px;
    border-radius: 8px;
    max-width: 80%;
    position: relative;
    transition: transform 0.3s ease-out;
    font-family: "Inter", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    word-break: break-word;
    word-spacing: 0.5px;
    letter-spacing: 0.2px;
}
    .chat-message.error {
        background: #ffebee; /* Light red background */
        color: #d32f2f; /* Dark red text */
        border-left: 4px solid #d32f2f; /* Red border to highlight error */
        padding: 12px;
        margin-bottom: 12px;
        border-radius: 8px;
        max-width: 80%;
        font-family: "Inter", Arial, sans-serif;
        font-size: 15px;
        line-height: 1.5;
        word-wrap: break-word;
        word-break: break-word;
        word-spacing: 0.5px;
        letter-spacing: 0.2px;
        animation: shake 0.3s ease-in-out;
    }
.user1 {
    /*background-color: #e1f5fe;*/
    /*background-color: #79d8f6;*/
    background-color: #85e2ff;
    float: right;
    clear: both;
}

.user2 {
    background-color: #c8e6c9;    
    float: left;
    clear: both;
}

.copy-btn {
    font-size: 14px;
    cursor: pointer;
    position: absolute;
    top: 50%;
    right: -30px;
    transform: translateY(-50%);
    color: #1a73e8;
}

.floating-icon {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(45deg, #1a73e8, #4285f4);
    color: white;
    border-radius: 50%;
    padding: 15px;
    cursor: pointer;
    display: block;
    font-size: 22px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: background 0.3s, transform 0.3s;
    z-index: 9998;
    pointer-events: auto;
    width: 50px;
    height: 50px;
}

    .floating-icon:hover {
        background: linear-gradient(45deg, #4285f4, #1a73e8);
    }

.full-screen {
    width: 100% !important;
    height: 100% !important;
    top: 0 !important;
    left: 0 !important;
    position: fixed !important;
    z-index: 9999;
}

.no-transition {
    transition: none !important;
}

.chat-header button,
.chat-footer button {
    background-color: #4285f4;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

    .chat-header button:hover,
    .chat-footer button:hover {
        background-color: #1a73e8;
        transform: scale(1.05);
    }

    .chat-header button:focus,
    .chat-footer button:focus {
        outline: none;
    }

#chatHeader {
    cursor: move !important; /* Default cursor in normal mode */
}

.full-screen #chatHeader {
    cursor: auto !important; /* Normal cursor in full-screen */
}

#sendMessage {
    cursor: pointer;
}

.chat-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: #f5f5f5;
    border-top: 1px solid #ddd;
}

textarea {
    overflow-y: hidden;
    resize: none;
    min-height: 50px;
    max-height: 300px;
}

.chat-messages {
    display: contents;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px;
    /*background: #e0e0e0;*/
    border-radius: 12px;
    max-width: 60px;
    animation: fadeInMessage 0.3s ease-in-out;
    background-color: #c8e6c9;
    float: left;
    clear: both;
}

    /* Three dots bouncing */
    .typing-indicator span {
        width: 6px;
        height: 6px;
        background: #555;
        border-radius: 50%;
        display: inline-block;
        animation: bounce 1.4s infinite ease-in-out;
    }

        .typing-indicator span:nth-child(1) {
            animation-delay: 0s;
        }

        .typing-indicator span:nth-child(2) {
            animation-delay: 0.2s;
        }

        .typing-indicator span:nth-child(3) {
            animation-delay: 0.4s;
        }


.initial-heading {
    font-size: 16px;
    font-weight: bold;
    /*color: #4A90E2;*/
    color: #4f4f4f;
    text-align: center;
    /*background: #f5f5f5;*/
    background: #c8e6c9;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin: 20px auto;
    width: 70%; /* Adjust as needed */
    min-width: 285px; /* Ensures a minimum width */
    /*width: fit-content;*/
    max-width: 600px;
    /* Centering */
    position: absolute;
    top: 43%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Dot Bouncing Animation */
@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.3;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

@media screen and (max-width: 767px) {
    .chat-container {
        width: 100%;
        height: 80%;
        min-width: 0;
        max-width: 100%;
    }

    .chat-footer {
        flex-direction: column;
        gap: 8px;
    }

    .chat-input {
        width: 100%;
    }
}


/* Shake Animation for Error Message */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-3px);
    }

    50% {
        transform: translateX(3px);
    }

    75% {
        transform: translateX(-3px);
    }
}