/* styles.css */
body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #121212; /* Default dark mode */
    color: #ffffff;
    transition: background-color 0.3s, color 0.3s;
}

.chat-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 80%;
    background-color: #1e1e1e; /* Dark mode */
    box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    overflow: hidden;
    flex-direction: column;
    transition: background-color 0.3s;
}

.chat-box {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 80vh;
    overflow: hidden;
    position: relative;
}

.messages {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #252525; /* Dark mode */
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s;
}

.message {
    margin-bottom: 15px;
    padding: 12px 18px;
    border-radius: 8px;
    line-height: 1.6;
    max-width: 80%;
    word-wrap: break-word;
    box-sizing: border-box;
    position: relative;
}

.user-message {
    background-color: #007bff;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 0;
}

.bot-message {
    background-color: #333333; /* Dark mode */
    color: #f1f1f1;
    align-self: flex-start;
    border-bottom-left-radius: 0;
}

/* Code Block Styling */
.bot-code-message {
    background-color: #1e1e1e; /* Dark mode */
    color: #f8f8f2;
    padding: 12px;
    border-radius: 8px;
    position: relative;
    overflow-x: auto;
    margin-top: 10px;
    transition: background-color 0.3s, color 0.3s;
}

.bot-code-message pre {
    margin: 0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
}

.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: #4CAF50;
    border: none;
    color: white;
    padding: 5px 8px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.copy-btn:hover {
    opacity: 1;
}

.input-area {
    display: flex;
    padding: 10px;
    background-color: #1e1e1e; /* Dark mode */
    border-top: 1px solid #333333;
    transition: background-color 0.3s, border-color 0.3s;
}

.user-input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #333333;
    border-radius: 5px;
    font-size: 16px;
    margin-right: 10px;
    resize: none;
    height: 50px;
    background-color: #252525;
    color: #ffffff;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

.send-btn {
    width: 20%;
    height: 80%;
    margin-top: 5px;
    padding: 15px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
    text-align: center;
}

.send-btn:hover {
    background-color: #0056b3;
}

.messages::-webkit-scrollbar {
    width: 8px;
}

.messages::-webkit-scrollbar-thumb {
    background-color: #666666;
    border-radius: 4px;
}

/* Light Mode */
body.light-mode {
    background-color: #f5f5f5;
    color: #333333;
}

body.light-mode .chat-container {
    background-color: #ffffff;
}

body.light-mode .messages {
    background-color: #e9e9e9;
}

body.light-mode .bot-message {
    background-color: #f1f1f1;
    color: #333333;
}

body.light-mode .input-area {
    background-color: #ffffff;
    border-top: 1px solid #e0e0e0;
}

body.light-mode .user-input {
    background-color: #ffffff;
    color: #333333;
    border-color: #ddd;
}

body.light-mode .bot-code-message {
    background-color: #f8f8f2;
    color: #333333;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .chat-container {
        max-width: 95%;
        height: 90vh;
    }

    .user-input {
        height: 40px;
    }
}

.theme-toggle-btn {
    padding: 5px 5px;
    border-radius: 5px;
    position:relative;
    background-color: #444;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

body.light-mode .theme-toggle-btn {
    background-color: white;
}
