body {
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background-color: #343541;
    color: white;
    padding: 10px;
    overflow: hidden;
}

/* Chat container */
#chat-container {
    width: 95%;
    max-width: 400px;
    height: calc(100vh - 350px); /* Adjust height dynamically */
    border-radius: 10px;
    background: #444654;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    margin-bottom: 110px;
    gap: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    padding-bottom: 30px; /* Ensures last messages are visible */
}

/* Messages */
.message {
    padding: 10px;
    border-radius: 10px;
    max-width: 80%;
    word-wrap: break-word;
}

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

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

/* Fixed Chat Input Bar */
#chat-input-container {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 95%;
    max-width: 400px;
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: #343541;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
}

/* User input field */
#user-input {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 20px;
    background: #565869;
    color: white;
    font-size: 16px;
    outline: none;
}

/* Prevent mobile zoom-in */
input {
    font-size: 16px;
}

/* Send button */
#send-btn {
    background: #0d6efd;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease;
}

#send-btn:hover {
    background: #0b5ed7;
}

#send-btn svg {
    width: 22px;
    height: 22px;
}

/* API Key input */
#api-key {
    width: 95%;
    max-width: 400px;
    padding: 12px;
    border: none;
    border-radius: 5px;
    margin-bottom: 10px;
    background: #565869;
    color: white;
    font-size: 16px;
}

/* Difficulty buttons */
#difficulty-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.difficulty-btn {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    background: #4a4b52;
    color: white;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease;
}

.difficulty-btn:hover {
    background: #6c6f7e;
}

/* Mobile Responsive Design */
@media (max-width: 480px) {
    body {
        height: auto;
        justify-content: flex-start;
    }

    #chat-container {
        height: calc(100vh - 300px);
        padding-bottom: 20px;
    }

    #chat-input-container {
        width: 95%;
        bottom: 5px;
        padding: 8px;
    }

    #user-input {
        font-size: 16px;
        padding: 12px;
    }

    #send-btn {
        width: 40px;
        height: 40px;
    }

    #difficulty-buttons {
        flex-direction: row;
        gap: 5px;
    }

    .difficulty-btn {
        font-size: 14px;
        padding: 8px 12px;
    }
}
