/* Fullscreen Responsive Chatbot UI */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f0f0f5;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

.chat-container {
    width: 100%;
    height: 100vh;
    max-width: 100%;
    background: white;
    display: flex;
    flex-direction: column;
    position: relative;
    padding-bottom: 80px; /* Ensures space for input field */
}

/* Chat Header */
.chat-header {
    background: #4285F4;
    color: white;
    text-align: center;
    padding: 15px;
    flex-shrink: 0;
}

/* Chat Messages */
.chat-box {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    background-color: #f9f9f9;
    max-height: calc(100vh - 140px); /* Prevents messages from covering input */
    margin-bottom: 10px;
}

/* Message Styling */
.bot-message, .user-message {
    max-width: 80%;
    padding: 12px;
    border-radius: 15px;
    margin: 5px 0;
    font-size: 1rem;
    word-wrap: break-word;
}

.bot-message {
    background: #E3F2FD;
    align-self: flex-start;
}

.user-message {
    background: #D1E8D1;
    align-self: flex-end;
}

/* Input Box (Full Width, Moved Down) */
.input-container {
    display: flex;
    padding: 10px;
    background: white;
    border-top: 1px solid #ddd;
    position: fixed;
    bottom: 30px; /* Moved down by 10px */
    width: 100%;
    max-width: 100%;
    left: 0;
    right: 0;
    box-sizing: border-box;
    gap: 10px;
}

/* Full-width Input Field */
input {
    flex-grow: 1;
    padding: 12px;
    border: none;
    outline: none;
    border-radius: 25px;
    background: #f0f0f0;
    font-size: 1rem;
    width: 100%;
    box-sizing: border-box;
}

/* Send Button */
button {
    background: #4285F4;
    color: white;
    border: none;
    border-radius: 50%;
    width: 55px;
    height: 55px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

button:hover {
    background: #357ae8;
}

/* Footer Styling */
.chat-footer {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    background: #f9f9f9;
    padding: 10px;
    width: 100%;
    border-top: 1px solid #ddd;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    box-sizing: border-box;
}

/* Fix for Mobile Screens */
@media (max-width: 768px) {
    .chat-box {
        max-height: calc(100vh - 160px);
    }

    .input-container {
        bottom: 40px; /* Moved down by 10px */
        padding: 8px;
    }

    input {
        font-size: 0.9rem;
        padding: 10px;
    }

    button {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
}

@media (max-width: 768px) {
    .chat-container {
        height: 100vh;
        padding-bottom: 100px; /* Increase bottom padding to prevent overlap */
    }

    .chat-box {
        max-height: calc(100vh - 190px); /* Adjust max-height to prevent overlap */
        padding-bottom: 20px; /* Extra padding for better spacing */
    }

    .input-container {
        bottom: 60px; /* Further move down input box to prevent overlapping */
    }

    .chat-footer {
        bottom: 0;
    }
}

@media (max-width: 768px) {
    .chat-footer {
        font-size: 0.75rem; /* Reduce font size slightly */
    }
}


@media (max-width: 768px) {
    .chat-container {
        padding-bottom: 110px; /* Increase space at the bottom to prevent overlap */
    }

    .chat-box {
        max-height: calc(100vh - 200px); /* Adjust height dynamically */
        padding-bottom: 30px; /* Ensure extra spacing for messages */
    }

    .input-container {
        bottom: 50px; /* Lower the input field slightly */
    }

    .chat-footer {
        font-size: 0.75rem; /* Reduce footer text size */
    }
}
