/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #0d1117, #161b22);
    color: #e6e6e6;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    padding: 10px;
}

.chat-container {
    width: 100%;
    max-width: 600px;
    background: #21262d;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    padding: 20px;
    height: 85vh;
    max-height: 85vh;
    animation: slideIn 0.6s ease-out;
}

header h1 {
    text-align: center;
    margin-bottom: 15px;
    font-weight: 600;
    font-size: 24px;
    color: #4cb7d8;
    text-shadow: 1px 2px 5px rgba(88, 166, 255, 0.4);
    font-family: 'Poppins', sans-serif;
}

/* Messages Area */
.messages {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px;
    border-radius: 8px;
    background: #0d1117;
    border: 1px solid #30363d;
}

.messages::-webkit-scrollbar {
    width: 8px;
}

.messages::-webkit-scrollbar-thumb {
    background-color: #525865;
    border-radius: 5px;
}

/* Individual Message Styling */
.message {
    margin-bottom: 12px;
    padding: 12px;
    border-radius: 8px;
    font-size: 16px;
    word-wrap: break-word;
    max-width: 80%;
    animation: fadeIn 0.4s ease-in-out;
    font-family: 'Roboto', sans-serif;
}

.my-message {
    background: linear-gradient(135deg, #1f6feb, #4c8ed7);
    color: #ffffff;
    align-self: flex-end; /* Align my message to the right */
    text-align: right; /* Text aligns to the right */
    box-shadow: 0 3px 8px rgba(31, 111, 235, 0.4);
}

.other-message {
    background: #30363d;
    color: #e6e6e6;
    align-self: flex-start; /* Align other message to the left */
    text-align: left; /* Text aligns to the left */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Input Area */
.input-area {
    display: flex;
    margin-top: 10px;
    gap: 12px;
    align-items: center;
    padding-bottom: 15px; /* Extra padding for mobile buttons */
}

#message-input {
    flex-grow: 1;
    padding: 14px;
    border: 1px solid #444;
    border-radius: 8px;
    font-size: 16px;
    background: #21262d;
    color: #e6e6e6;
    outline: none;
    transition: border 0.3s ease;
    font-family: 'Open Sans', sans-serif;
}

#message-input::placeholder {
    color: #888;
}

#message-input:focus {
    border-color: #589cc4;
}

/* Send Button */
#send-btn {
    padding: 12px 18px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    background: linear-gradient(135deg, #238636, #2ea043);
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(34, 139, 34, 0.4);
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}

#send-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(46, 160, 67, 0.5);
}

@media (max-width: 600px) {
    .chat-container {
        padding: 15px;
    }
    header h1 {
        font-size: 20px;
    }
    #message-input {
        padding: 10px;
        font-size: 14px;
    }
    #send-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* Keyframes for Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
