/* Gradient Background */
/* Dynamic Gradient Background Animation */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 10px; /* Adjusted font size */
    color: #ffffff;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
    transition: background 0.5s ease-in-out;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Glow Effect for Chat Container */
.container {
    box-shadow: 0 4px 30px rgba(0, 191, 174, 0.3), 0 0 20px rgba(0, 191, 174, 0.2);
    transition: box-shadow 0.5s ease-in-out;
}

.container:hover {
    box-shadow: 0 4px 40px rgba(0, 191, 174, 0.5), 0 0 30px rgba(0, 191, 174, 0.3);
}

/* Enhanced Floating Animation for Suggestion Button */
.suggestion-btn {
    animation: floating 3s infinite ease-in-out, glow 2s infinite alternate;
}

@keyframes glow {
    0% { box-shadow: 0px 5px 15px rgba(0, 191, 174, 0.3); }
    100% { box-shadow: 0px 10px 25px rgba(0, 191, 174, 0.6); }
}

/* Gradient Border for Messages */
.message {
    border: 3px solid transparent;
    background-clip: padding-box;
    position: relative;
}

.message::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #00bfae, #00d4ff);
    border-radius: 15px;
    z-index: -1;
}

/* Glow Effect for Send Button */
.send-btn {
    box-shadow: 0 0 10px rgba(0, 191, 174, 0.3);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.send-btn:hover {
    box-shadow: 0 0 20px rgba(0, 191, 174, 0.6);
    transform: scale(1.1);
}

/* Gradient Overlay for Chat Header */
.chat-header {
    position: relative;
    overflow: hidden;
}

.chat-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, rgba(32, 44, 51, 0.8), rgba(49, 71, 89, 0.8));
    z-index: -1;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1E2A78, #2A9DF4, #80D0C7);
    color: #ffffff;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
    transition: background 0.5s ease-in-out;
}

/* Chat Container */
.container {
    width: 100%;
    max-width: 450px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: rgba(18, 18, 18, 0.9);
    border-radius: 20px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    animation: fade-in 0.6s ease-out;
}

/* Chat Header */
.chat-header {
    background: linear-gradient(90deg, #202c33, #314759);
    padding: 15px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: #ffffff;
    border-radius: 20px 20px 0 0;
}

/* Messages Area */
.messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: #00bfae transparent;
}

/* Scrollbar Styling */
.messages::-webkit-scrollbar {
    width: 5px;
}

.messages::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #00bfae, #00d4ff);
    border-radius: 10px;
}

/* Message Styles */
.message {
    max-width: 75%;
    padding: 12px;
    border-radius: 15px;
    margin: 8px;
    position: relative;
    word-wrap: break-word;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    align-self: flex-start; /* Align all messages to the left */
}

/* Sent Messages */
.sent {
    background: linear-gradient(135deg, #0E76A8, #0FC2C0);
    text-align: left; /* Align text to the left */
    color: #fff;
    border-bottom-left-radius: 5px; /* Adjust border radius */
    border-bottom-right-radius: 15px; /* Adjust border radius */
    animation: slide-in-left 0.3s ease-out, bounce 0.4s ease-in-out;
}

/* Received Messages */
.received {
    background: linear-gradient(135deg, #7630A8, #DA44FF);
    text-align: left; /* Align text to the left */
    color: #fff;
    border-bottom-left-radius: 5px; /* Adjust border radius */
    border-bottom-right-radius: 15px; /* Adjust border radius */
    animation: slide-in-left 0.3s ease-out, bounce 0.4s ease-in-out;
}

/* Message Hover Effect */
.message:hover {
    transform: scale(1.02);
    box-shadow: 0px 4px 15px rgba(0, 255, 175, 0.3);
}

/* Timestamp */
.timestamp {
    font-size: 10px;
    color: #ddd;
    display: block;
    margin-top: 3px;
    text-align: right;
}

/* Typing Indicator */
#typingIndicator {
    display: none;
    font-size: 12px;
    color: #aaa;
    margin-left: 10px;
    animation: fade-in 0.3s ease-in-out;
}

.typing-dots {
    display: inline-block;
    width: 5px;
    height: 5px;
    margin-right: 2px;
    background-color: #aaa;
    border-radius: 50%;
    animation: typing 1.5s infinite ease-in-out both;
}

.typing-dots:nth-child(2) { animation-delay: 0.2s; }
.typing-dots:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Input Area */
.input-area {
    display: flex;
    align-items: center;
    padding: 8px;
    background: linear-gradient(90deg, #202c33, #314759);
    border-radius: 0 0 20px 20px; /* Smooth corners */
    position: sticky; /* Fix input area to the bottom */
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10; /* Ensure it stays on top */
}

/* Modernized Input Field */
textarea {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 15px;
    background-color: #2a2a2a;
    color: white;
    resize: none;
    height: 25px;
    font-size: 10px;
    outline: none;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, height 0.3s ease;
}

/* Glow Effect When Typing */
textarea:focus {
    background-color: #3a3a3a;
    box-shadow: 0px 0px 10px rgba(0, 191, 174, 0.5);
    height: 60px;
}

/* Send Button */
.send-btn {
    padding: 12px;
    border: none;
    background: linear-gradient(135deg, #00bfae, #00d4ff);
    color: white;
    font-size: 18px;
    cursor: pointer;
    margin-left: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.send-btn:hover {
    background: linear-gradient(135deg, #00a88c, #0093E9);
    transform: scale(1.1);
}

/* Animations */
@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slide-in-left {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slide-in-right {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Modern Circular Suggestion Button */
.suggestion-btn {
    position: absolute;
    top: -25px; /* Moves it slightly above the container */
    left: 50%;
    transform: translateX(-50%);
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, #00bfae, #00d4ff); /* Smooth gradient */
    color: white;
    border: none;
    font-size: 10px;
    font-weight: bold;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

/* Icon Inside Button */
.suggestion-btn i {
    font-size: 20px;
    margin-right: 5px;
}

/* Hover Effect */
.suggestion-btn:hover {
    background: linear-gradient(135deg, #00a88c, #0093E9);
    transform: translateX(-50%) scale(1.1);
    box-shadow: 0px 8px 20px rgba(0, 0, 0, 0.4);
}

/* Button Click Animation */
.suggestion-btn:active {
    transform: translateX(-50%) scale(0.95);
}

/* Floating Animation */
@keyframes floating {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(-5px);
    }
}

.suggestion-btn {
    animation: floating 4s infinite ease-in-out;
}

.typing-indicator {
    display: none; /* Hidden by default */
    padding: 4px; /* Reduced padding */
    margin-bottom: 6px;
    background-color: rgba(255, 255, 255, 0.1); /* Subtle background */
    border-radius: 10px; /* Rounded corners */
    width: fit-content; /* Adjust width to content */
    box-shadow: 0 2px 0.5px rgba(0, 0, 0, 0.1); /* Soft shadow for depth */
    position: relative; /* Allow positioning */
    padding-bottom: 12px; /* Extra padding to extend downward */
}

.typing-indicator .dot {
    display: inline-block;
    width: 5px; /* Reduced size */
    height: 5px;
    border-radius: 50%;
    margin-right: 2px; /* Reduced spacing between dots */
    animation: bounce 1.4s infinite ease-in-out;
    opacity: 0.8; /* Slightly transparent for a modern look */
    position: relative;
}

.typing-indicator .dot:nth-child(1) {
    background-color: #4CAF50; /* Modern green */
    animation-delay: -0.32s;
}

.typing-indicator .dot:nth-child(2) {
    background-color: #FFC107; /* Modern yellow */
    animation-delay: -0.16s;
}

.typing-indicator .dot:nth-child(3) {
    background-color: #FF5252; /* Modern red */
}

/* Extend the bounce animation downward */
@keyframes bounce {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: 0.8; /* Fade effect */
    }
    40% {
        transform: translateY(6px); /* Extended downward */
        opacity: 1; /* Fully visible at peak */
    }
}
