body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #a8c0ff, #3f2b96); 
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
    color: #333; 
}


#chat-container {
    width: 100%;
    max-width: 600px; 
    background: #ffffff;
    padding: 30px;
    border-radius: 20px; 
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25); 
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    transition: all 0.3s ease; 
}

h2 {
    text-align: center;
    color: #3f2b96; 
    margin-bottom: 25px;
    font-size: 2.2em; 
    font-weight: 700;
    letter-spacing: 0.5px;
    position: relative;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: #a8c0ff; 
    border-radius: 2px;
}


#chat-box {
    flex-grow: 1;
    min-height: 350px;
    max-height: 60vh;
    overflow-y: auto;
    border: none; 
    padding: 20px;
    background: #f0f4f8; 
    border-radius: 15px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1); 
}


.message {
    padding: 14px 20px;
    border-radius: 25px; 
    margin: 10px 0;
    max-width: 80%; 
    word-wrap: break-word;
    font-size: 1em;
    line-height: 1.5;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); 
    animation: fadeIn 0.3s ease-out; 
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-message {
    background: #3f2b96;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 8px; 
}

.bot-message {
    background: #a8c0ff; 
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 8px; 
}

.input-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Chat Input */
#user-input {
    flex: 1;
    padding: 15px 20px;
    border: 1px solid #e0e0e0;
    border-radius: 30px; 
    outline: none;
    font-size: 1.05em;
    transition: all 0.4s ease;
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.1);
}

#user-input:focus {
    border-color: #3f2b96;
    box-shadow: 0 0 0 4px rgba(168, 192, 255, 0.4);
    background-color: #fff;
}

button {
    padding: 15px 25px;
    background: #3f2b96; 
    color: white;
    border: none;
    border-radius: 30px; 
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 6px 15px rgba(63, 43, 150, 0.3); 
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

button i {
    font-size: 1.2em; 
}

button:hover {
    background: #5a40b3; 
    transform: translateY(-3px); 
    box-shadow: 0 8px 20px rgba(63, 43, 150, 0.4);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 3px 8px rgba(63, 43, 150, 0.3);
}


/* Smooth Scrollbar */
#chat-box::-webkit-scrollbar {
    width: 10px;
}

#chat-box::-webkit-scrollbar-track {
    background: #e0e0e0;
    border-radius: 10px;
}

#chat-box::-webkit-scrollbar-thumb {
    background: #a8c0ff; 
    border-radius: 10px;
    border: 2px solid #e0e0e0; 
}

#chat-box::-webkit-scrollbar-thumb:hover {
    background: #3f2b96; 
}

@media (max-width: 768px) {
    #chat-container {
        padding: 20px;
        border-radius: 15px;
        height: 95vh;
        max-height: 95vh;
        width: 98vw;
        max-width: 98vw;
    }

    h2 {
        font-size: 1.8em;
        margin-bottom: 20px;
    }

    #chat-box {
        min-height: 280px;
        max-height: 65vh;
        padding: 15px;
    }

    .message {
        padding: 12px 18px;
        font-size: 0.9em;
        margin: 8px 0;
        max-width: 90%;
    }

    #user-input {
        padding: 12px 18px;
        font-size: 0.95em;
    }

    button {
        padding: 12px 20px;
        font-size: 0.95em;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    #chat-container {
        padding: 15px;
        border-radius: 10px;
    }
    h2 {
        font-size: 1.6em;
        margin-bottom: 15px;
    }
    #chat-box {
        padding: 10px;
    }
    .input-container {
        flex-direction: row; 
        gap: 8px;
    }
    #user-input {
        padding: 10px 15px;
        font-size: 0.85em;
        border-radius: 25px;
    }
    button {
        padding: 10px 15px;
        font-size: 0.85em;
        border-radius: 25px;
    }
    button i {
        font-size: 1em;
    }
    button span {
        display: none;
    }
}

.loading-message {
    font-style: italic;
    color: #666; 
    background: #a8c0ff; 
    box-shadow: none; 
    animation: pulse 1.5s infinite; 
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}