/* Base styles */
body, html {
    margin: 0;
    padding: 0;
    font-family: 'Manrope', sans-serif;
    height: 100%;
    width: 100%;
}

body {
    background-image: url('/static/CEG_bg.png');
    background-repeat: repeat;
    display: flex;
}

.background-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: inherit;
    background-repeat: inherit;
    background-size: inherit;
    opacity: 0.8;
    z-index: -1;
}

.mobile-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
}

/* Left sidebar styles */
.left-bar {
    width: 325px;
    height: 100vh;
    background-color: #6F5E55;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
}

.left-bar.chat-collapsed {
    height: auto;
    min-height: 140px; /* Adjust this value based on your logo size and desired padding */
}

.chat-container.collapsed {
    height: 40px;
    overflow: hidden;
}

.logo {
    padding: 20px;
    z-index: 2;
}

.logo img {
    width: 100px;
    height: auto;
}

/* Chat container styles */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px;
    box-sizing: border-box;
    margin-top: 20px;
    height: calc(100vh - 120px);
    transition: height 0.3s ease;
}

.chat-toggle {
    display: none;
    justify-content: center;
    align-items: center;
    background-color: #0085D1;
    color: white;
    height: 40px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.chat-toggle svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.chat-iframe {
    flex: 1;
    width: 100%;
    border: none;
    transition: display 0.3s ease;
}

/* Recipe output styles */
.recipe-output {
    width: calc(100% - 325px);
    padding: 20px;
    box-sizing: border-box;
    font-family: "Manrope", sans-serif;
    font-optical-sizing: auto;
    font-weight: 200;
    font-style: normal;
    display: none;
    justify-content: flex-start;
    align-items: center;
    margin-left: 325px;
}

.recipe-content {
    max-width: 680px;
    margin: 0 auto;
    padding: 40px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.recipe-detail {
    font-family: "Special Elite", system-ui;
    font-weight: 400;
    font-style: normal;
    color: #333;
    position: relative;
    padding-bottom: 40px;
    height: 100%;
}

.recipe-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    border-top: 1px solid #d3c7b6;
    padding-top: 20px;
}

.recipe-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.action-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #6F5E55;
    transition: color 0.3s ease;
}

.action-button:hover {
    color: #4a3f39;
}

.action-button svg {
    width: 24px;
    height: 24px;
}

.copyright {
    font-size: 12px;
    color: #888;
}

/* Chat styles */
#chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: #fff;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.message {
    max-width: 80%;
    margin-bottom: 10px;
    clear: both;
}

.message p {
    padding: 8px;
    border-radius: 15px;
    margin: 0;
    font-size: 14px;
}

.user {
    float: right;
}

.user p {
    background-color: #0085D1;
    color: white;
}

.bot {
    float: left;
}

.bot p {
    background-color: #f0f0f0;
    color: #333;
}

#chat-form {
    display: flex;
    align-items: center;
    padding: 10px;
    border-top: 1px solid #eee;
    background-color: #fff;
}

#user-message {
    flex-grow: 1;
    border: 1px solid #ccc;
    padding: 8px;
    border-radius: 20px;
    font-size: 14px;
    margin-right: 10px;
}

#chat-form button {
    background-color: #0085D1;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
}

/* Scrollbar styling */
#chat-messages::-webkit-scrollbar {
    width: 6px;
}

#chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#chat-messages::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

#chat-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Mobile styles */
@media (max-width: 768px) {
    body {
        flex-direction: column;
        height: auto;
        overflow-y: auto;
    }

    .left-bar {
        width: 100%;
        height: auto;
        position: static;
        padding-bottom: 10px;
    }

    .chat-container {
        width: 100%;
        left: 0;
        transform: none;
        height: 60vh;
        min-height: 300px;
    }

    .chat-toggle {
        display: flex;
    }

    .chat-iframe {
        height: calc(100% - 40px);
        min-height: 260px;
    }

    .recipe-output {
        width: 100%;
        margin-left: 0;
        padding: 10px;
        height: auto;
        display: block;
    }

    .recipe-content {
        max-width: 100%;
        padding: 20px;
    }

    .recipe-detail {
        font-size: 14px;
    }

    .action-button svg {
        width: 20px;
        height: 20px;
    }
}

/* Desktop styles */
@media (min-width: 769px) {
    .chat-container {
        height: calc(100vh - 140px);
    }

    .chat-container.collapsed {
        height: calc(100vh - 140px);
    }

    .chat-toggle {
        display: none;
    }

    .recipe-content::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: 
            linear-gradient(to right, #f9f2e8 0%, transparent 20%, transparent 80%, #f9f2e8 100%),
            linear-gradient(to bottom, #f9f2e8 0%, transparent 20%, transparent 80%, #f9f2e8 100%);
        pointer-events: none;
    }

    #chat-messages {
        height: calc(100% - 60px);
    }

    .message p {
        font-size: 16px;
        padding: 10px;
    }

    #chat-form {
        flex-shrink: 0;
    }
}

body.chat-agent {
    background-image: none;
    background-color: #6F5E55; /* This is the brown color you're using for the left bar */
}

.chat-agent #chat-container {
    background-color: white;
    height: 100vh;
    border-radius: 0;
    box-shadow: none;
}

.chat-agent #chat-messages {
    background-color: #f9f9f9;
}