/* ===================== BASE STYLING ===================== */
body {
    background-color: #343541;
    color: white;
    font-family: Inter, sans-serif;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    min-height: 100vh;
    margin: 0;
}

/* login page styles */
.login-container {
    width: 300px;
    margin: 100px auto;
    padding: 20px;
    background: #444654;
    border-radius: 8px;
    text-align: center;
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -80%);
}

.login-container input {
    width: 90%;
    padding: 10px;
    margin: 10px 0;
}

.login-container button {
    width: 30%;
    padding: 10px;
    background-color: #0FA37F;
    color: white;
    border: none;
    cursor: pointer;
    margin: 10px;
}

.logout-button {
    padding: 8px 12px;
    background: red;
    color: white;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
}


/* ===================== TOP-LEFT HEADER ===================== */
.left-top-corner {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 20px;
    padding: 20px 40px;
    background-color: #2c2c3a;
    border-radius: 10px;
    margin: 20px;
    width: fit-content;
}

.eco-mode-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.eco-mode-label {
    font-weight: bold;
    color: #7df59b;
    font-size: 16px;
}

.logout-button {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.logout-button:hover {
    background-color: #c0392b;
}

/* ===================== MAIN LAYOUT ===================== */
.main-layout {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    padding: 0 40px 40px 40px;
    box-sizing: border-box;
}

/* ===================== CHAT WINDOWS ===================== */
.chat-comparison-container {
    display: flex;
    flex: 2;
    gap: 20px;
    padding-bottom: 120px;
}

.chat-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #24243a;
    border-radius: 16px;
    padding: 20px;
    margin: 0 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ===================== CHAT HISTORY ===================== */
.chat-history-container {
    width: 100%;
    height: calc(100vh - 220px);
    border-radius: 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px;
}

/* ===================== CHAT MESSAGES ===================== */
.chat-message {
    display: inline-block;
    margin: 10px;
    padding: 12px 15px;
    border-radius: 10px;
    line-height: 1.5;
    max-width: 80%;
    word-wrap: break-word;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.chat-message.user {
    background-color: #444654;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 0;
}

.chat-message.llm {
    background-color: #0FA37F;
    color: white;
    align-self: flex-start;
    border-bottom-left-radius: 0;
}

.chat-message.llm.eco {
    background-color: #0FA37F;
}

/* ===================== INPUT AREA ===================== */
.query-submission-container {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
}

.query-box {
    flex-grow: 1;
    height: 50px;
    padding: 10px;
    border: none;
    border-radius: 20px;
    background-color: #40414F;
    color: white;
    font-size: 16px;
    outline: none;
    transition: 0.3s;
}

.query-box:focus {
    background-color: #4A4B57;
}

.send_button {
    padding: 10px 20px;
    background-color: #0FA37F;
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    height: 50px;
    transition: background-color 0.3s;
}

.send_button:hover {
    background-color: #0D8F6A;
}

/* ===================== SCROLLBAR ===================== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #343541;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #50515E;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #60616E;
}

/* ===================== RESPONSIVE ===================== */
@media screen and (max-width: 1024px) {
    .main-layout {
        flex-direction: column;
        padding-right: 0;
    }

    .chat-comparison-container {
        flex-direction: column;
    }

    .chat-panel {
        width: 100%;
    }

    .eco-feedback-container {
        position: static;
        width: 100%;
        height: auto;
    }
}
/* Toggle Button */
.toggle-button {
    background-color: #0FA37F;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: background-color 0.2s ease;
}

.toggle-button:hover {
    background-color: #0D8F6A;
}

/* When closed, hide content */
#eco-feedback-content {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
    opacity: 1;
}

#eco-feedback-content.closed {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
}
/* Sidebar slide + layout push */
.eco-feedback-container {
    position: fixed;
    top: 0;
    right: 0;
    width: 30%;
    min-width: 350px;
    height: 100vh;
    background-color: #2c2c3a;
    color: white;
    overflow-y: auto;
    box-shadow: -3px 0 10px rgba(0,0,0,0.4);
    transition: transform 0.35s ease;
    z-index: 999;
}

.eco-feedback-container.closed {
    transform: translateX(100%);
}



.global-query-container {
    width: calc(100% - 60px); /* leave space on both sides */
    margin: 0 30px 20px 30px; /* 30px side margin, 20px bottom */
    display: flex;
    justify-content: center;
    background-color: #2c2c3a;
    padding: 12px 20px;
    border-radius: 16px;
    position: fixed;
    bottom: 0;
    left: 0 ;
    right: 0;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.3);
    z-index: 100;
    transition: right 0.4s ease; 
}
.sidebar-open .global-query-container {
    width: 70%;
}
.eco-feedback-info {
    color: #ccc;
    font-size: 12px;
    margin-top: 4px;
    margin-left: 10px;
    opacity: 0.9;
}

/* ===================== Sidebar Push Fix ===================== */

/* When Eco Feedback is open, push the input bar left */
body.sidebar-open .global-query-container {
    right: 350px; /* match sidebar width */
    transition: right 0.35s ease;
}

/* When Eco Feedback is closed, reset position */
body.sidebar-closed .global-query-container {
    right: 0;
    transition: right 0.35s ease;
}
