/* Reset some default styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Body Styling */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #1e1e1e; /* Dark background */
    color: #d4d4d4; /* Light text color */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    min-height: 100vh;
    
}

.introArea {
    margin-top: 25px;
    margin-bottom: 30px;
}

.introArea h1 {
    font-size: 50px;
    font-weight: bold;
    background: linear-gradient(to right, #ff7e5f, #feb47b, #6a82fb, #9d50bb); /* Warm and cool color blend */
    background-clip: text;
    color: transparent;
    text-align: center;
    margin-bottom: 10px;
}

.introArea p {
    text-align: center;
    max-width: 750px;

}

/* Container to hold both elements */
.container {
    width: 90%;
    max-width: 800px;
    margin: 20px auto;
}

/* Response Box Styling */
.responseBox {
    background-color: #252526; /* Slightly lighter than background */
    border: 1px solid #333; /* Border to distinguish from background */
    padding: 20px;
    margin-bottom: 20px;
    min-height: 400px;
    max-height: 400px;
    overflow-y: auto;
    font-size: 16px;
    line-height: 1.5;
    border-radius: 25px;
    position: relative;
}

/* Syntax Highlighting for Code (if needed) */
.responseBox code {
    background-color: #1e1e1e;
    color: #c5c5c5;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Courier New', Courier, monospace;
}

.message {
    margin-bottom: 10px;
    clear: both;
    display: flex;
    flex-direction: column;
}

.message.user {
    align-items: flex-end;
    opacity: 0; /* Start hidden for the fade-in effect */
    transform: translateY(10px); /* Initial position for the slide-in effect */
    transition: opacity 0.25s ease-in, transform 0.25s ease-in;
}

.message.user.fade-in {
    opacity: 1;
    transform: translateY(0); /* Slide up into place */
}

.message.ai {
    align-items: flex-start;
    opacity: 1; /* Default visible */
}

.message-content {
    display: inline-block;
    padding: 12px;
    border-radius: 15px;
    max-width: 80%;
    word-wrap: break-word;
}

.message.user .message-content {
    background-color: #6d7174; /* Grey color for user messages */
    color: #fff;
}

.message.ai .message-content {
    background-color: transparent; /* Transparent background for AI messages */
    color: #d4d4d4;
}



/* Style code blocks within the AI's messages */
.message.ai .message-content pre {
    background-color: #1e1e1e;
    padding: 5px;
    border-radius: 5px;
    overflow-x: auto;
    white-space: pre; 
}

/* Ensure inline code is displayed correctly */
.message.ai .message-content code {
    background-color: #1e1e1e;
    color: #c5c5c5;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Courier New', Courier, monospace;
    /* No need to set opacity for inline code */
}

.message.ai .message-content pre,
.message.ai .message-content code {
    margin: 10px 0; /* Adjust the value as needed */
}

/* Code blocks default to opacity 0 */
.message.ai .message-content pre {
    opacity: 0;
    transition: opacity 0.35s ease-in;
    will-change: opacity;
}

/* Fade-in effect when fade-in class is added */
.message.ai .message-content pre.fade-in {
    opacity: 1;
}

/* Typing Cursor */
.typing-cursor {
    display: inline-block;
    width: 8px;
    height: 20px;
    background-color: #d4d4d4;
    margin-left: 4px;
    vertical-align: bottom;

}


.timestamp {
    visibility: hidden; /* Initially hidden */
    opacity: 0;
    transition: visibility 0s 0.25s, opacity 0.25s ease; /* Delay visibility hiding */
}

.message:hover .timestamp {
    visibility: visible;
    opacity: 1;
    transition-delay: 0s; /* Remove delay on hover */
}

.message.user .timestamp {
    position: relative;
    bottom: -10px; /* Move the timestamp 10px lower */
    right: 0;
}

.message.ai .timestamp {
    position: relative;
    left: 12px; /* Move the timestamp 5px higher */
    right: 0;
}

/* Form Styling */
form#userPrompt {
    display: flex;
    flex-direction: column;
}

/* Textarea Styling */
textarea {
    background-color: #1e1e1e;
    color: #d4d4d4;
    border: 1px solid #333;
    padding: 15px;
    font-size: 16px;
    margin-bottom: 15px;
    resize: vertical;
    min-height: 100px;
    border-radius: 25px;

}

/* Button Styling */
.buttonContainer {
    display: flex;
    justify-content: right;
}

button {
    background-color: #0e639c; /* Blue color for the button */
    color: #fff;
    padding: 6px;
    font-size: 17px;
    cursor: pointer;
    transition: all 0.3s ease-out;
    border-radius: 25px;
    width: 90px;
    margin-top: -40px;
    font-family: 'Roboto', sans-serif;

    border: 2px solid #4a3aff;
    position: relative;
    outline: none;
}

button:hover {
    background-color: #1177bb;
}

/* Placeholder Text Styling */
textarea::placeholder {
    color: #808080;
}

/* Scrollbar Styling */
.responseBox::-webkit-scrollbar,
textarea::-webkit-scrollbar {
    width: 8px;
}

.responseBox::-webkit-scrollbar-track,
textarea::-webkit-scrollbar-track {
    background: #1e1e1e;
}

.responseBox::-webkit-scrollbar-thumb,
textarea::-webkit-scrollbar-thumb {
    background: #3e3e3e;
    border-radius: 4px;
}

.responseBox::-webkit-scrollbar-thumb:hover,
textarea::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Adjustments for Mobile */
@media (max-width: 600px) {
    .container {
        width: 95%;
    }

    textarea {
        font-size: 14px;
    }

    button {
        font-size: 14px;
        padding: 12px;
    }
}

#codeCharCount {
    text-align: left;
    margin-top: -10px; /* Adjust to position closer to the textarea */
    margin-bottom: 15px; /* Space below the char count */
    font-size: 14px; /* Smaller font size */
    color: #808080; /* Grey color for subtlety */
}
