[data-theme="light"] {
    --color-bg: #ffffff;
    --color-left: #f0f0f0;
    --user-msg: #d4edda;
    --bot-msg: #e2e3e5;
    --input-border-color: #eee;
    --msg-input-border-color: #ccc;
    --color-fg: #000000;
}

[data-theme="dark"] {
    --color-bg: #160719;
    --color-left: #1D0D20;
    --user-msg: #112D18;
    --bot-msg: #26182B;
    --input-border-color: #32223A;
    --msg-input-border-color: #32223A;
    --color-fg: #CCCCCC;
}

body {
    font-family: Consolas, monospace;
    margin: 0;
    padding: 0;
    background-color: var(--color-bg);
    color: var(--color-fg);
}

[data-theme="dark"] pre code {
    filter: invert(100%);
}

.cont {
    display: flex;
    height: 100dvh
}

.left {
    display: flex;
    width: 500px;
    background-color: var(--color-left);
    flex-direction: column;
    justify-content: space-between;
}

.header {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    color: #5cb85c;

}

.header h1 {
    font-weight: 800;
}

.header p {
    font-weight: 600;
    margin-top: -20px;
}

/*  Add this style for model selector */
.model-selector {
    padding: 10px;
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
}

.model-selector select {
    background-color: #5cb85c;
    width: 150%;
    padding: 8px;
    text-align: center;
    color: var(--color-bg);
    border-color: var(--input-border-color);
    border-radius: 10px;
    font-size: 16px;
}

.model-selector select option {
    border-radius: 10px;
    background-color: #5cb85c;
    color: var(--color-bg);
    padding: 5px 10px;
}

.model-selector select option:hover {
    background-color: #54ad54;
    color: var(--color-bg);
}

.model-selector select option:checked {
    background-color: #54ad54;
}

.footer {
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
}

.footer .links {
    margin-bottom: 7px;
    margin-top: 7px;
}

.footer .links a {
    color: #5cb85c;
    text-decoration: none;
    margin-right: 10px;
}

.footer .links a:hover {
    text-decoration: underline;
}

.footer .links a:last-child {
    margin-right: 0;
}

.footer .buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 10px;
}

.container {
    width: 100%;
    background-color: var(--color-bg);
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.chat-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
}

.message {
    padding: 8px;
    margin-bottom: 5px;
    border-radius: 8px;
    max-width: 70%;
    word-break: break-word;
    overflow-wrap: break-word;
    position: relative;
    display: flex;
    flex-direction: column;
}

.message-image {
    max-width: 300px;
    max-height: 300px;
    border-radius: 5px;
    margin-bottom: 10px;
    display: block;
    cursor: pointer;
}

.user-message {
    background-color: var(--user-msg);
    align-self: flex-end;
    white-space: pre-wrap;
}

.bot-message {
    background-color: var(--bot-msg);
    align-self: flex-start;

}

.bot-typing {
    background-color: var(--color-left);
    font-style: italic;
    align-self: flex-start;
}

pre {
    white-space: pre-wrap;
}

.input-area {
    display: flex;
    align-items: center;
    padding: 10px;
    border-top: 1px solid var(--input-border-color);
    flex-wrap: wrap;
}

.input-container {
    display: flex;
    flex-grow: 1;
}

#message-input {
    flex-grow: 1;
    padding: 10px 8px;
    border: 1px solid var(--msg-input-border-color);
    border-radius: 10px;
    margin-right: 10px;
    background-color: var(--color-bg);
    color: var(--color-fg);
    resize: none;
}

#send-button {
    padding: 8px 15px;
    background-color: #5cb85c;
    color: var(--color-bg);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    flex-shrink: 0;
}

.clear-button {
    background-color: #5cb85c;
    color: var(--color-bg);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    padding: 8px;
    height: 35px; /* Added height to match message input*/
    box-sizing: border-box; /* Added to include padding in height */
    flex-shrink: 0;
}

@media (max-width: 440px) {
    .input-container {
        flex-direction: column; /*меняем flex direction на column */
    }

    #message-input {
        margin-bottom: 10px;
        margin-right: 0;
    }

    .clear-button {
        margin-right: 10px;
        margin-bottom: 10px;
    }
}

.material-symbols-outlined {
    font-size: 1.2em;
}

.copy-button {
    padding: 5px 8px;
    background-color: var(--color-left);
    color: var(--color-fg);
    border: 1px solid var(--input-border-color);
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8em;
    opacity: 0.8;
}

.copy-button:hover {
    opacity: 1;
}

@media (max-width: 768px) {
    .left {
        width: 100%;
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        z-index: 1000;
        transform: translateX(-100%);

        transition: transform 0.3s ease-in-out;
        overflow-y: auto;
    }

    .left.mobile-hidden {
        transform: translateX(0);
    }

    .container {
        margin-top: 0;
    }

    .menu-toggle {
        position: fixed;
        top: 10px;
        left: 10px;
        background-color: #5cb85c;
        color: var(--color-bg);
        border: none;
        border-radius: 5px;
        padding: 10px 15px;
        cursor: pointer;
        z-index: 1001;
        display: block;
    }
}

@media (min-width: 769px) {
    .menu-toggle {
        display: none;
    }
}

.slider-container {
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80%; /* Adjust as needed */
    margin: 0 auto; /* Center the container */
}

.slider-container label {
    margin-bottom: 5px;
    color: var(--color-fg); /* Or any color you prefer */
    font-size: 14px;
}

.slider-container input[type="range"] {
    width: 100%;
    margin-bottom: 15px;
    -webkit-appearance: none;  /* Override default styles for Chrome/Safari */
    appearance: none;
    height: 7px; /* Set a specific height */
    background: #d3d3d3; /* Grey background */
    outline: none; /* Remove outline */
    opacity: 0.7; /* Set transparency (for mouse-over effects) */
    -webkit-transition: .2s; /* 0.2 seconds transition on hover */
    transition: opacity .2s;
    border-radius: 5px;
}

/* Mouse-over effects */
.slider-container input[type="range"]:hover {
  opacity: 1; /* Fully shown on hover */
}

/* The slider handle (use -webkit- (Chrome, Opera, Safari, Edge) and -moz- (Firefox) to override default look) */
.slider-container input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; /* Override default look */
  appearance: none;
  width: 15px; /* Set a specific width */
  height: 15px; /* Slider handle height */
  background: #5cb85c; /* Green background */
  cursor: pointer; /* Cursor on hover */
  border-radius: 50%;
}

.slider-container input[type="range"]::-moz-range-thumb {
  width: 15px;
  height: 15px;
  background: #5cb85c;
  cursor: pointer;
  border-radius: 50%;
}

.system-prompt-container {
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80%;
    margin: 0 auto;
}

.system-prompt-container label {
    margin-bottom: 5px;
    color: var(--color-fg);
    font-size: 14px;
}

.system-prompt-container textarea {
    width: 100%;
    height: 60px;
    padding: 8px;
    border: 1px solid var(--msg-input-border-color);
    border-radius: 10px;
    background-color: var(--color-bg);
    color: var(--color-fg);
    resize: vertical;
    font-family: inherit;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1002;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background-color: var(--color-bg);
    color: var(--color-fg);
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

#chats-list {
    list-style: none;
    padding: 0;
}

#chats-list li {
    margin-bottom: 10px;
    padding: 5px;
    border-bottom: 1px solid var(--input-border-color);
}

#chats-list li:last-child {
    border-bottom: none;
}

#chats-list a {
    color: var(--color-fg);
    text-decoration: none;
    display: block; /* Make the link fill the list item */
    padding: 5px 0;
}

#chats-list a:hover {
    background-color: var(--color-left); /* Highlight on hover */
    border-radius: 5px; /* Optional: Add a border radius for visual effect */
}

.header a {
    text-decoration: none;
    color: #5cb85c;
}

.about {
    color: #5cb85c;
    text-align: center;
    font-weight: 900;
}

.about h1 {
    font-size: 300%;
    margin-bottom: -10px;
}

.download {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.download #download-button {
    width: 200px;
    height: 50px;
}

.download #download-button * {
    text-decoration: none;
    color: #ffffff;
    font-size: 115%;
}

.image-upload {
    display: none; /* Hidden by default, shown only for supported models */
    margin-right: 10px;
    position: relative;
}

.image-upload input[type="file"] {
    display: none;
}

.image-upload label {
    background-color: #5cb85c;
    color: var(--color-bg);
    border: none;
    border-radius: 10px;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    height: 50px;
    width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.drag-over {
    border: 2px dashed #5cb85c;
    background-color: rgba(92, 184, 92, 0.1);
}

.image-preview {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    padding: 5px;
    background: var(--color-left);
    border-radius: 5px;
    margin-bottom: 5px;
}

.image-preview img {
    max-width: 100px;
    max-height: 100px;
}

.image-preview .remove-image {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.image-viewer-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;
}

.image-viewer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.image-viewer-content img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.close-image-viewer {
    position: absolute;
    right: 25px;
    top: 15px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

.close-image-viewer:hover {
    color: #bbb;
}

.modal-content .ad-confirm-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.modal-content .ad-confirm-buttons button {
    padding: 10px 20px;
    font-size: 16px;
    min-width: 120px;
}

.modal-content .ad-confirm-buttons .btn-no {
    background-color: #dc3545;
}

.modal-content .ad-confirm-buttons .btn-yes {
    background-color: #5cb85c;
}

.upload-progress {
    position: absolute;
    bottom: 100%;
    left: 0;
    width: 100%;
    height: 4px;
    background: #eee;
    border-radius: 2px;
    margin-bottom: 5px;
    display: none;
}

.upload-progress-bar {
    height: 100%;
    background: #5cb85c;
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease;
}

.upload-error {
    position: absolute;
    bottom: 100%;
    left: 0;
    background: #dc3545;
    color: white;
    padding: 5px;
    border-radius: 5px;
    margin-bottom: 5px;
    font-size: 12px;
    display: none;
    white-space: nowrap;
}

.prompts-gallery-button {
    display: block;
    padding: 8px 16px;
    margin-top: 10px;   
} 

.empty-chat-message {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    text-align: center;
}

.empty-chat-message h3 {
    margin-bottom: 10px;
    font-size: 1.5em;
}

.empty-chat-message p {
    font-size: 1em;
    opacity: 0.8;
}