:root {
    --primary-color: #083af0;
    --secondary-color: #f5f6fa;
    --text-color: #2d3436;
    --text-light: #636e72;
    --white: #ffffff;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
    height: 0px;
}

/* Chat Button */
#chat-button {
    position: fixed;
    bottom: 30px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    box-shadow: var(--shadow);
    z-index: 1000;
    transition: var(--transition);
}

#chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(74, 107, 255, 0.4);
}

#chat-button i {
    transition: var(--transition);
}

/* Chat Box */
#chat-box {
    position: fixed;
    bottom: 105px;
    right: 30px;
    width: 380px;
    max-width: calc(100% - 60px);
    height: 600px;
    max-height: 80vh;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
    transform: translateY(20px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

#chat-box.visible {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

/* Chat Header */
#chat-header {
    padding: 15px 20px;
    background: var(--primary-color);
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}



.avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.header-text h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.status {
    font-size: 12px;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
    margin-bottom: 0px;
}

.status::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: rgba(4, 255, 8);
    border-radius: 50%;
}

#minimize-btn {
    background: none;
    border: none;
    color: var(--white);
    font-size: 16px;
    cursor: pointer;
    opacity: 0.8;
    transition: var(--transition);
    padding: 5px;
    border-radius: 4px;
}

#minimize-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    opacity: 1;
}

/* Chat Log */
#chat-log {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
    scroll-behavior: smooth;
}

/* Message Styles */
.message {
    margin-bottom: 15px;
    max-width: 80%;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    margin-left: auto;
}

.message {
    display: flex;
    margin-bottom: 8px;
    max-width: 80%;
    width: fit-content;
}

.message.bot {
    align-self: flex-start;
    margin-right: auto;
}

.message.user {
    align-self: flex-end;
    margin-left: auto;
    flex-direction: row-reverse;
}

.message.system .message-content {
    background: #ffffff;
    color: black;
}

.message-content {
    padding: 8px 12px;
    border-radius: 7.5px;
    font-size: 14.2px;
    line-height: 19px;
    position: relative;
    word-wrap: break-word;
    max-width: 100%;
    box-sizing: border-box;
}

.message.bot .message-content {
    background: #ffffff;
    color: #111b21;
    border-top-left-radius: 0;
    border-top-right-radius: 7.5px;
    border-bottom-left: 7.5px;
    border-bottom-right: 7.5px;
    box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
}

.message.user .message-content {
    background: #083af0;
    ;
    color: #ffffff;
    border-top-left-radius: 7.5px;
    border-top-right-radius: 0;
    border-bottom-left: 7.5px;
    border-bottom-right: 7.5px;
    box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
}


.message.bot .message-time {
    color: #000000;
}

.message.user .message-time {
    color: #ffffff;
}


.message-time {
    font-size: 11px;
    color: rgb(0, 0, 0);
    margin-top: 2px;
    text-align: right;
    padding-right: 2px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 2px;
    height: 15px;
}

/* Add a small arrow/triangle to the message bubbles */
.message.bot .message-content::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 0;
    border-style: solid;
    border-width: 0 8px 8px 0;
    border-color: transparent #f0f2f5 transparent transparent;
}

.message.user .message-content::before {
    content: '';
    position: absolute;
    right: -8px;
    top: 0;
    border-style: solid;
    border-width: 0 0 8px 8px;
    border-color: transparent transparent transparent rgba(255, 255, 255, 0.2);
    ;
}

/* Welcome Message */
.welcome-message {
    text-align: left;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.welcome-message p {
    color: var(--text-light);
    font-size: 14px;
    font-weight: 500;
    /* Bolder welcome message */
    margin: 0;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    padding: 10px 20px;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 10px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background-color: #ccc;
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    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;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0.5);
    }

    40% {
        transform: scale(1);
    }
}

/* Input Container */
#input-container {
    padding: 15px;
    background: var(--white);
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 10px;
}

#chat-form {
    flex: 1;
    display: flex;
    gap: 10px;
    position: relative;
}

#user-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    /* Slightly bolder input text */
    outline: none;
    transition: var(--transition);
    background: #f5f6fa;
}

#user-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(74, 107, 255, 0.2);
}

#voice-btn,
#send-btn {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: var(--secondary-color);
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

#voice-btn:hover,
#send-btn:hover {
    background: #e1e4ea;
}

#send-btn {
    background: var(--primary-color);
    color: white;
}

#send-btn:hover {
    background: #3a5bef;
    transform: translateY(-1px);
}

/* Voice Input State */
.listening #voice-btn {
    background: #ff4d4f;
    color: white;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 77, 79, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(255, 77, 79, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 77, 79, 0);
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Responsive Design */
@media (max-width: 480px) {
    #chat-box {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }

    #chat-button {
        bottom: 20px;
        right: 20px;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.pulse {
    animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
    0% {
        box-shadow: 0 0 0 0 rgba(74, 107, 255, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(74, 107, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(74, 107, 255, 0);
    }
}



#chat-input-container {
    display: flex;
    padding: 10px;
}