/*styles.css*/

html {
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

h3 {
    margin-top: 5px;
}

p {
    margin-top: 5px;
    margin-bottom: 0px;
    white-space: pre-wrap;
}

.page-container {
    display: flex;
    flex-direction: column;
}

.top-section {
    background-color: #3498db;
    color: #fff;
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: space-between;
    padding-top: 5px;
    padding-bottom: 5px;
    padding-left: 10px;
    padding-right: 10px;
    max-height: 30px;
}

.top-section .button-container {
    display: flex;
    gap: 10px; /* Adjust as needed */
}

.top-section button {
    background-color: #007bff; 
    border: none;
    color: white;
    padding: 5px 5px; /* Adjust padding to control button size */
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 12px;
    margin: 0px 0px;
    cursor: pointer;
    border-radius: 5px; /* Rounded corners */
    min-width: 30px; 
    margin-right: 0px !Important;
}

.top-section button:hover {
    background-color: #0056b3;
}

.top-section button i {
    /* Style the icon itself (size, margin, etc.) */
    font-size: 1.2em; /* Adjust icon size */
    margin-right: 0px; /* Adjust spacing between icon and text (if any) */
    vertical-align: middle;
}

.subtop-section {
    background-color: gray;
    color: #fff;
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: space-between;
    padding-top: 0px;
    padding-bottom: 4px;
    padding-left: 12px;
    padding-right: 15px;
}

.welcome-user {
    font-size: 9pt;
    color: white;
}

.chat-name {
    font-size: 9pt;
    color: white;
}

.button-container {
    display: flex;
    justify-content: space-between;
}

.button-container button {
    margin-right: 5px;
}

.chat-container {
    margin-left: 10%;
    margin-right: 10%;
    margin-top: 15px;
    margin-bottom: 15px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    flex: 1;
    display: flex;
    position: relative;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 0px;
    padding-top: 0px;
}

.message {
    position: relative;
    margin-bottom: 20px;
    padding: 12px 15px;
    border-radius: 15px;
    line-height: 1.3;
    word-wrap: break-word;
}

.message-timestamp {
    font-size: 0.6rem;
    color: #6c757d;
    position: absolute;
    bottom: -14px;
    right: 12px;
}

.message-actions {
    position: absolute;
    right: 10px;
    top: 6px;
    display: inline-block;
}

.message:hover .message-actions {
    display: flex;
    gap: 0px;
}

.action-button {
    background: none;
    border: none;
    padding: 0px 0px;
    cursor: pointer;
    font-size: 11px;
    color: gray;
    font-style: italic;
    min-width: 20px !important;
    margin-right: 7px;
}

.action-button:hover {
    color: black;
    background: none;
}

.action-button-user {
    background: none;
    border: none;
    padding: 0px 0px;
    cursor: pointer;
    font-size: 11px;
    color: whitesmoke;
    opacity: 1;
    transition: opacity 0.2s;
    font-style: italic;
    min-width: 20px !important;
    margin-right: 7px;
}

.action-button-user:hover {
    color: wheat;
    background: none;
    opacity: 1;
}

/* Markdown styles */
.message-content {
    margin-right: 10px;
    margin-top: 5px;
    font-size: 14px;
    border-radius: 10px;
}

/* New wrapper styles */
.code-wrapper {
    position: relative;
    /* Important for absolute positioning of button */
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    /*margin: 1em 0;*/
}

.code-header {
    padding-left: 15px;
    padding-right: 5px;
    padding-top: 5px;
    padding-bottom: 5px;
    border-radius: 10px 10px 0 0;
    font-size: 0.8em;
    font-weight: bold;
    color: #666;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    margin-bottom: -9px;
}

.message-content pre {
    background-color: transparent;
    /* Remove background as it's now on wrapper */
    overflow-x: auto;
    line-height: 0.9 !important;
    padding-top: 5px !important;
    padding-bottom: 5px !important;
    margin-bottom: 15px !important;
}

.message-content code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.8em !important;
}

/* For inline code */
.message-content :not(pre)>code {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 0.2em 0.4em;
    border-radius: 3px;
}

.message-content a {
    color: #007bff;
    text-decoration: none;
}

.message-content a:hover {
    text-decoration: underline;
}

.copy-code-button {
    position: static;
    top: 2px;
    right: 4px;
    padding: 3px 5px !important;
    min-width: 5px !important;
    color: gray;
    background: transparent;
    /*border: 1px solid #ddd;*/
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
    display: block;
    /* Hidden by default */
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.code-wrapper:hover .copy-code-button {
    opacity: 1;
}

.copy-code-button:hover {
    color: black;
    background: transparent;
}

.user-message {
    background-color: #007bff;
    color: white;
    margin-left: 20%;
    margin-right: 0;
}

.user-message a {
    color: white !important;
}

.user-message-line {
    font-size: 0.7rem;
    color: floralwhite;
    height: 18px;
    border-bottom: 1px solid;
    border-bottom-color: floralwhite;
    position: relative;
    margin-top: -6px;
    font-style: italic;
}

.assistant-message {
    background-color: #e9ecef;
    color: black;
    margin-right: 20%;
    margin-left: -15px;
}

.assistant-message-line {
    font-size: 0.7rem;
    color: #5a6268;
    height: 18px;
    border-bottom: 1px solid;
    border-bottom-color: #5a6268;
    position: relative;
    margin-top: -6px;
    font-style: italic;
}

.system-message {
    background-color: transparent;
    color: black;
    margin-right: 10px;
    margin-left: -17px;
    font-style: italic;
}

.system-message-line {
    font-size: 0.7rem;
    color: #5a6268;
    height: 16px;
    position: relative;
}

.scroll-controls {
    width: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 10px 5px;
}

.scroll-icon {
    width: 15px;
    height: 15px;
    background-color: gray;
    color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s;
}

.scroll-icon i {
    font-size: 9px;
}

.scroll-icon:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.top-icon {
    top: 10px;
    position: absolute;
}

.bottom-icon {
    bottom: 10px;
    position: absolute;
}

.chat-input-container {
    height: 110px;
    background-color: #f0f0f0;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    bottom: 0px;
    z-index: 100;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    /* Prevent text size adjustment */
    user-select: auto;
    /* Allow user text selection */
    -webkit-user-select: auto;
    /* Allow user text selection */
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    /* Disable tap highlight */
    max-height: 100%;
    /* Set maximum height for the text area */
}

/* Optional: Add a backdrop when expanded*/
.textarea-container::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

.textarea-container.expanded::after {
    display: block;
}

.chat-input-container textarea {
    width: 80%;
    padding: 0px;
    margin: 10px;
    box-sizing: border-box;
}

#chat-form {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    width: 80%
}

.textarea-container {
    display: grid;
    position: relative;
    width: 100%;
    padding-right: 16px;
}

.expand-icon {
    position: absolute;
    top: 8px;
    right: -14px;
    cursor: pointer;
    background: transparent;
    padding: 2px;
    z-index: 10001;
}

#message-input {
    flex: 1;
    padding-top: 5px;
    padding-bottom: 5px;
    padding-left: 7px;
    padding-right: 15px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    font-family: inherit;
    font-size: 14px;
    resize: none;
    line-height: 1.5;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    transition: height 0.3s ease;
}

#message-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

#email {
    flex: 1;
    padding: 5px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    font-family: inherit;
    font-size: 14px;
    box-sizing: border-box;
    width: 100%;
}

#email:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.char-count {
    font-size: 10px;
    color: #6c757d;
    margin-right: 200px;
    position: absolute;
    margin-top: 92px;
    z-index: 2000;
    width: 80%;
    text-align: right;
}

.selected-model {
    font-size: 10px;
    color: #6c757d;
    margin-left: 16px;
    position: absolute;
    margin-top: -4px;
    z-index: 2000;
    text-align: left;
}

button {
    padding: 6px 10px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    min-width: 70px;
    text-align: center;
}

button:hover {
    background-color: #0056b3;
}

/* New styles for settings */
.settings-container {
    padding-top: 10px !important;
    max-width: 600px;
    margin: 20px auto 20px auto;
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
}

.text-muted {
    color: #6c757d;
    font-size: 0.875rem;
    min-height: 63px;
}

#cost-info {
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 4px;
    margin-top: 5px;
}

/* Custom Select Styles */
.custom-select-container {
    position: relative;
    width: 100%;
}

.custom-select-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 8px 12px;
    /*background-color: #fff;*/
    border: 1px solid #ced4da;
    border-radius: 4px;
    cursor: pointer;
    text-align: left;
    font-size: 14px;
}

.custom-select-button:hover {
    border-color: #adb5bd;
}

.dropdown-arrow {
    font-size: 0.8rem;
    transition: transform 0.2s;
}

.custom-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 350px;
    overflow-y: auto;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    display: none;
}

.model-dropdown-header {
    display: flex;
    padding: 8px 12px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-weight: bold;
    font-size: 12px;
    position: sticky;
    top: 0;
    z-index: 1;
}

.model-option {
    display: flex;
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.model-option:hover {
    background-color: #f8f9fa;
}

.model-option.selected {
    background-color: #e9ecef;
}

.model-column {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.model-column.vendor {
    width: 25%;
    flex: 0 0 25%;
}

.model-column.name {
    width: 25%;
    flex: 0 0 25%;
}

.model-column.cost {
    width: 25%;
    flex: 0 0 25%;
}

.model-column.cutoff {
    width: 25%;
    flex: 0 0 25%;
}

.model-options-container {
    max-height: 300px;
    font-size: 12px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .model-column.cost, .model-column.cutoff {
        display: none;
    }
    
    .model-column.vendor {
        width: 50%;
        flex: 0 0 50%;
    }
    
    .model-column.name {
        width: 50%;
        flex: 0 0 50%;
    }
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: inline-flex;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input {
    width: 60px;
    padding: 8px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    font-size: 14px;
}

.form-group textarea {
    width: 97%;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    font-size: 12px;
    resize: none;
    height: 150px;
    padding: 7px;
}

.error {
    color: #dc3545;
    background-color: #f8d7da;
}

.folder-selection-area {
    height: 40px;
    /* Set this to accommodate the taller of your two elements */
    position: relative;
}

#folder-select, #new-folder-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}

.form-group select {
    padding: 8px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    font-size: 14px;
    background-color: white;
}

.form-group select:focus {
    outline: none;
    border-color: #007bff;
}

.button-group {
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.secondary-button {
    background-color: #6c757d;
}

.secondary-button:hover {
    background-color: #5a6268;
}

.system-prompt-container {
    position: relative;
}

.overlay-message {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: -77px;
    background-color: rgba(245, 245, 245, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px;
    font-size: 14px;
    color: #666;
    z-index: 1000;
}

#system-prompt:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

/* Typing indicator */
.typing-indicator {
    margin-top: 10px !important;
    padding: 10px;
    border-radius: 15px;
    display: block;
    gap: 4px;
    width: fit-content;
    margin-left: 5px;
    height: 28px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background-color: #666;
    border-radius: 50%;
    animation: bounce 1.5s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-4px);
    }
}

.model-info {
    font-size: 0.7rem;
    color: #6c757d;
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.user-message .model-info {
    border-top-color: rgba(255, 255, 255, 0.2);
}

/* The Modal (background) */
.modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    /* Stay in place */
    z-index: 1000;
    /* Sit on top */
    left: 0;
    top: 0;
    width: 100%;
    /* Full width */
    height: 100%;
    /* Full height */
    overflow: auto;
    /* Enable scroll if needed */
    background-color: rgba(0, 0, 0, 0.4);
    /* Black w/ opacity */
}

/* Modal Content */
.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    /* 15% from the top and centered */
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    /* Could be more or less, depending on screen size */
}

/* The Registration form (background) */
.registration-form {
    display: none;
    /* Hidden by default */
    position: fixed;
    /* Stay in place */
    z-index: 1000;
    /* Sit on top */
    left: 0;
    top: 0;
    width: 100%;
    /* Full width */
    height: 100%;
    /* Full height */
    overflow: auto;
    /* Enable scroll if needed */
    background-color: rgba(0, 0, 0, 0.4);
    /* Black w/ opacity */
}

.registration-form-container {
    padding-top: 10px !important;
    max-width: 800px;
    margin: 0 auto 20px auto;
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40%;
}

/* The Close Button */
.close {
    color: #aaaaaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

/* The Close Button */
.close-regform {
    color: #aaaaaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close-regform:hover,
.close-regform:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

.textarea-container textarea.expanded {
    position: fixed;
    top: 57px;
    left: -5px;
    width: calc(100vw - 10px) !important;
    height: calc(100vh - 70px) !important;
    z-index: 10000;
    background: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 20px;
}

.textarea-container textarea.expanded+.expand-icon {
    position: fixed;
    -webkit-transform: rotate(-180deg);
    -moz-transform: rotate(-180deg);
    transform: rotate(-180deg);
    top: 71px;
    right: 9px;
}

@media (hover: none) {
    .message-actions {
        display: flex;
    }

    .conversation-actions {
        opacity: 1 !important;
    }

    .form-group textarea {
        width: 95%;
    }

    .chat-container {
        margin-left: 0%;
        margin-right: 0%;
    }

    #chat-form {
        width: 95%;
    }

    .char-count {
        margin-right: 140px;
    }

    .chat-messages {
        height: calc(100vh - 285px);
        padding-left: 10px;
        padding-right: 10px;
    }

    .user-message {
        margin-left: 7%;
    }

    .assistant-message {
        margin-right: 7%;
    }

    .system-message {
        margin-left: 0%;
        margin-right: 0%;
    }

    .copy-code-button {
        opacity: 1;
    }
}

@media (hover: hover) {
    .message-actions {
        display: none;
    }

    .conversation-actions {
        opacity: 1 !important;
    }

    .chat-messages {
        height: calc(100vh - 200px);
        padding-left: 15px;
        padding-right: 20px;
    }

    .message-content code:hover .copy-code-button {
        display: block;
    }
}

.conversation-selector {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.save-conversation {
    background: white;
    padding-top: 10px;
    padding-bottom: 20px;
    padding-left: 20px;
    padding-right: 20px;
    border-radius: 8px;
    width: 400px;
    height: 225px;
    overflow-y: auto;
}

.folder-select-container select {
    border-radius: 4px;
    max-width: 200px;
    height: 35px;
    font-size: 14px;
}

.new-folder {
    width: 200px !important;
}

.conversation-selector-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.conversation-selector-content label {
    font-weight: bold;
}

.conversation-preview {
    font-size: 0.9em;
    color: #666;
}

.form-group {
    margin-bottom: 15px;
}

.form-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.dialog-footer {
    float: right;
    margin-top: 10px;
}

.dialog-buttons {
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.dialog-buttons button {
    padding: 8px 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* Group the right buttons together */
.dialog-buttons .right-buttons {
    display: flex;
    gap: 10px;
    /* Space between right buttons */
}

.save-button {
    background-color: #007bff;
    color: white;
}

.cancel-button {
    background-color: #6c757d;
    color: white;
}

.conversation-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.conversation-preview {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.conversation-date {
    color: #999;
    font-size: 0.7em;
    margin-top: 10px;
}

.new-folder-button {
    width: 100px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.folder-section {
    margin-bottom: 20px;
}

.folder-header {
    font-weight: bold;
    padding: 4px;
    padding-left: 10px;
    color: white;
    background-color: #28a745;
    border-radius: 4px;
    margin-bottom: 10px;
}

.conversation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.conversation-item:hover {
    background-color: #f8f9fa;
    background: #f5f5f5;
}

.conversation-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.conversation-preview {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.folder-select-container select {
    border-radius: 4px;
    max-width: 200px;
    height: 35px;
    font-size: 14px;
}

.folder-filter {
    border-radius: 4px;
    width: 200px !important;
    height: 35px !important;
    font-size: 14px;
}

.conversation-content {
    flex-grow: 1;
}

.conversation-actions {
    display: flex;
    gap: 0px;
    opacity: 0;
    transition: opacity 0.2s;
}

.conversation-item:hover .conversation-actions {
    opacity: 1;
}

.publish-btn,
.manage-published-btn,
.rename-btn,
.delete-btn {
    background: none;
    min-width: 30px !important;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    color: #666;
    transition: color 0.2s;
    display: block;
    font-size: 16px;
}

.publish-btn:hover,
.manage-published-btn:hover,
.rename-btn:hover {
    color: #007bff;
    background: none !important;
}

.delete-btn:hover {
    color: #dc3545;
    background: none !important;
}

.name-edit {
    width: 95%;
    padding: 4px;
    border: 1px solid #007bff;
    border-radius: 4px;
    font-size: inherit;
}

.conversation-name {
    position: relative;
}

.name-text {
    display: inline-block;
    width: 100%;
}

/* Hidden input fields */
.hidden-input {
    display: none;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    /* semi-transparent white */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    /* Make sure this is higher than your modal's z-index */
}

.loading-spinner {
    text-align: center;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.loading-spinner::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Minimize/Maximize Tab Styling */
.input-minimize-tab {
    position: absolute;
    top: -24px;
    right: 20px;
    background-color: #f0f0f0;
    border: 1px solid #dee2e6;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    padding: 4px 12px;
    cursor: pointer;
    z-index: 99;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
}

.input-minimize-tab i {
    font-size: 14px;
    color: #6c757d;
}

.input-minimize-tab:hover i {
    color: #007bff;
}

.chat-input-container {
    position: relative;
    /*transition: height 0.3s ease;*/
}

/* Minimized state styling */
.chat-input-container.minimized .input-minimize-tab {
    position: fixed;
    bottom: 0;
    top: auto;
    right: 20px;
    border: 1px solid #dee2e6;
    border-radius: 8px 8px 0 0;
}

.chat-input-container.minimized .char-count,
.chat-input-container.minimized #chat-form {
    display: none;
}

/* Ensure the chat messages area expands when input is minimized */
.chat-input-container.minimized+.chat-messages {
    height: calc(100vh - 100px);
}

/* Copy conversation button styling */
.copy-conversation-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(240, 240, 240, 0.8);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.copy-conversation-button:hover {
    background-color: rgba(0, 123, 255, 0.2);
}

.copy-conversation-button i {
    color: #6c757d;
    font-size: 14px;
}

.copy-conversation-button:hover i {
    color: #007bff;
}

/* Add a tooltip for feedback */
.copy-conversation-button::after {
    content: "Copy conversation as Markdown";
    position: absolute;
    bottom: -25px;
    right: 0;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    white-space: nowrap;
}

.copy-conversation-button:hover::after {
    opacity: 1;
}

/* Feedback for successful copy */
.copy-conversation-button.copied i {
    color: #28a745;
}

.copy-conversation-button.copied::after {
    content: "Copied!";
    opacity: 1;
}

/* Dialog content */
.dialog-content {
    height: 450px;
    overflow-y: auto;
    padding: 10px 0;
}

/* Dialog tabs */
.dialog-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 15px;
}

.tab-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-right: 5px;
    transition: all 0.2s;
}

.tab-item:hover {
    background-color: #f5f5f5;
}

.tab-item.active {
    border-bottom: 2px solid #1890ff;
    color: #1890ff;
    font-weight: bold;
}

.tab-item i {
    margin-right: 5px;
}

/* Navigation items */
.nav-item {
    padding: 12px 10px;
    cursor: pointer;
    border-radius: 4px;
    margin-bottom: 5px;
    transition: background-color 0.2s;
}

.nav-item:hover {
    background-color: #f0f0f0;
}

.nav-item.active {
    background-color: #e6f7ff;
    color: #1890ff;
    font-weight: bold;
}

.nav-item i {
    margin-right: 5px;
    width: 16px;
    text-align: center;
}

/* Page styling */
.page-header {
    margin-bottom: -10px;
    padding-bottom: 10px;
}

.page-header label {
    display: block;
    margin-bottom: 5px;
}

/* Search page */
.search-container {
    display: flex;
    margin-bottom: 10px;
}

.search-container input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    margin-right: 10px;
}

.search-container button {
    padding: 8px 12px;
    background: #1890ff;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

.search-placeholder,
.no-results,
.loading-indicator,
.error-message {
    padding: 20px;
    text-align: center;
    color: #888;
}

.error-message {
    color: #ff4d4f;
}

/* Recent conversations page */
.conversation-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
    color: #666;
}

.conversation-folder {
    background-color: #f0f0f0;
    padding: 2px 6px;
    margin-top: 3px;
    font-size: 0.9em;
    border-radius: 4px;
    margin-right: 25px;
}

.highlight {
    background-color: #ffeb3b;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: bold;
}

/* Make sure the match preview text wraps properly */
.match-text {
    color: #666;
    white-space: normal;
    word-break: break-word;
    line-height: 1.4;
    font-size: 11px;
}

/* Add to your styles.css file */
.preset-selector {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.preset-selector label {
    margin-right: 10px;
}

.preset-selector select {
    flex-grow: 1;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

.preset-description {
    font-size: 14px;
    font-style: italic;
    color: #555;
    margin-bottom: 8px;
    padding: 8px;
    background-color: #f5f5f5;
    border-radius: 4px;
}

label.disabled {
    color: #999;
}

/* Style for label and icon container */
.label-with-icon {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative; /* For tooltip positioning */
}

/* Make sure the label doesn't wrap or push the icon down */
.label-with-icon label {
    display: inline-block;
    margin: 0; /* Remove any default margins */
}

/* Icon container */
.icon-container {
    display: inline-flex; /* Changed to inline-flex */
    position: relative;
    align-items: center;
    justify-content: center;
}

/* Info icon style */
.info-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #007bff;
    color: white;
    font-size: 12px;
    font-style: normal;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
}

/* Tooltip style */
.tooltip {
    visibility: hidden;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    text-align: left;
    padding: 8px 12px;
    border-radius: 6px;
    width: 255px; /* Adjust as needed */
    font-size: 14px;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Arrow at the bottom of the tooltip */
.tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

/* For desktop: Show the tooltip on hover */
@media (hover: hover) {
    .icon-container:hover .tooltip {
        visibility: visible;
        opacity: 1;
    }
}

/* For mobile: Handle with click/tap - class added via JS */
.tooltip-visible {
    visibility: visible !important;
    opacity: 1 !important;
}
