/* General Styles */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    overflow: hidden;
    background-color: #f5f5f5;
    transition: background-color 0.3s, color 0.3s;
    overflow: hidden; /* Disable scrolling */
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    height: 100vh;
    background-color: #f5f5f5;
    transition: background-color 0.3s, color 0.3s;
}

body.dark-mode {
    background-color: #333;
    color: white;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: -300px; /* Sidebar starts hidden */
    width: 250px;
    height: 100%;
    background: #1e1e1e;
    padding: 20px;
    transition: left 0.3s ease-in-out;
}

.sidebar.active {
    left: 0; /* Slide in when active */
}

.sidebar a {
    text-decoration: none;
    color: #b0b0b0;
    display: block;
    text-align: center;
    font-weight: bold;
    padding: 10px;
}

.sidebar a:hover {
    color: #ffffff;
}

/* Buttons */
.theme-toggle, .new-chat {
    width: 100%;
    padding: 10px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    margin-bottom: 10px;
}

.theme-toggle:hover, .new-chat:hover {
    background-color: #0056b3;
}

.sidebar-toggle {
    position: absolute;
    top: 15px;
    left: 15px;
    background: #333;
    color: white;
    border: none;
    font-size: 20px;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 5px;
    transition: right 0.3s ease-in-out;
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out;
    z-index: 1000;
}

.sidebar.active ~ .overlay {
    opacity: 1;
    visibility: visible;
}

/* Chatbox */
.chatbox {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    width: calc(100% - 250px);
    transition: margin-left 0.3s ease-in-out;
}

.sidebar.active ~ .chatbox {
    margin-left: 250px;
}

/* Input Box */
.input-box {
    display: flex;
    align-items: center;
    background-color: white;
    padding: 10px;
    border-radius: 10px;
    width: 60%;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s;
    margin-bottom: 20px;
}

.input-box input {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 5px;
    margin-right: 10px;
    background-color: transparent;
    color: #333;
    transition: color 0.3s;
}

.input-box .send-button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-weight: bold;
}

.input-box .send-button:hover {
    background-color: #0056b3;
}

/* Chat Area */
.chat-area {
    flex: 1;
    width: 100%;
    overflow-y: auto;
    padding: 10px;
}

/* Messages */
.message {
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    max-width: 90%;
}

.user-message {
    background-color: #e0e0e0;
    align-self: flex-end;
    display: flex;
    align-items: center; /* Ensures icon and text are aligned */
    flex-direction: row-reverse; /* Places icon on the right */
    padding: 10px;
    padding-right: 20px;
    border-radius: 10px;
    max-width: 90%;
    text-align: right;
    margin-left: 80px;

}

.user-message .message-content {
    margin-right: 20px; /* Add spacing between text and icon */
}

.ai-message {
    background-color: #f0f0f0;
    align-self: flex-start;
    display: flex;
    align-items: flex-start; /* Aligns AI icon and text at the top */
    flex-direction: row;
    padding: 10px;
    border-radius: 10px;
    max-width: 90%;
    text-align: left;
    margin-right: 15px;
}

.ai-message .message-content {
    margin-left: 10px; /* Adjust spacing between AI icon and text */
    display: flex;
    align-items: left; /* Ensures text aligns properly */
    text-align: justify;
    flex-direction: column;
}
.ai-message.image-message {
    background-color: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.ai-message.image-message .message-content {
    display: flex;
    justify-content: center;
    width: 100%;
}

.ai-message.image-message .message-content img {
    max-width: 550px;
    width: 100%;
    height: auto;
    border-radius: 10px;
    align-self: center;
}
.copyable {
    user-select: text; /* Allows text selection */
    color: #fff;
    cursor: text; /* Shows text cursor */
}
.ai-message .message-content p {
    display: block;
    margin-bottom: 10px;
}

.ai-icon {
    flex-shrink: 0; /* Prevents the icon from resizing */
    align-self: flex-start; /* Ensures icon stays at the top */
    margin-bottom: 0; /* Remove unwanted bottom margin */
}

.title {
    margin-bottom: 0;
}

.para {
    margin-top: 0;
}

@media screen and (max-width: 768px) {
    .sidebar {
        width: 200px;
    }

    .sidebar-toggle {
        left: 10px;
        font-size: 20px;
        padding: 8px 12px;
    }

    .sidebar.active + .sidebar-toggle {
        left: 210px;
    }

    .chatbox {
        width: 100%;
        padding: 15px;
    }

    .input-box {
        width: 90%;
    }
}

/* Smaller Mobile Screens */
@media screen and (max-width: 480px) {
    .sidebar {
        width: 180px;
    }

    .sidebar-toggle {
        font-size: 18px;
        padding: 6px 10px;
    }

    .sidebar.active + .sidebar-toggle {
        left: 190px;
    }

    .input-box {
        width: 95%;
    }
    .chatbox .logo img{
        width: 250px;
    }
}

/* Extra Small Mobile Screens (Below 375px) */
@media screen and (max-width: 375px) {
    .sidebar {
        width: 160px;
        padding: 15px;
    }

    .sidebar-toggle {
        font-size: 16px;
        padding: 5px 8px;
    }

    .chatbox .logo img{
	width: 250px;
    }

    .sidebar.active + .sidebar-toggle {
        left: 170px;
    }

    .chatbox {
        padding: 8px;
    }

    .input-box {
        width: 98%;
        padding: 8px;
    }

    .input-box input {
        font-size: 14px;
        padding: 6px;
    }

    .send-button {
        padding: 6px 10px;
        font-size: 14px;
    }

    .ai-intro {
        font-size: 12px;
    }
}
