@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --font-family: ui-sans-serif,-apple-system,system-ui,Segoe UI,Helvetica,Apple Color Emoji,Arial,sans-serif,Segoe UI Emoji,Segoe UI Symbol;
    --font-size-base: 16px;
    --font-size-sm: 14px;
    --font-size-lg: 18px;
    --font-weight-light: 300;
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-bold: 600;
    --line-height-base: 1.6;
    --line-height-title: 1.4;
    --letter-spacing: 0.02em;
    --image-bg: #f4f4f4;
    --sub-bar-color: transparent;
    --border-color:#10a37f;
    --green-color: #10a37f;
    --red-color: #ff3d71;
    --bg-color: #202123;
    --bar-color: #292b2f;
    --panel-bg: #3a3e44;
    --split-pane-color:#2d2f36;
    --text-color: #d1d5db;
    --light-bub-color: yellow;
    --button-bg: #10a37f;
    --button-hover: #0e8a6e;
    --input-bg: #2d2f36;
    --input-border: #555;
    --shadow-color: rgba(1, 1, 1, 0.2);
}

footer{
    z-index:51;
}

body {
    font-family: var(--font-family), ui-sans-serif;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-base);
    letter-spacing: var(--letter-spacing);
}

h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-title);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-base);
}

button, input, select, textarea {
    font-family: inherit;
    font-size: var(--font-size-base);
}

button {
    font-weight: var(--font-weight-medium);
}


[data-theme="light"] {
    --bg-color: #ececec;
    --bar-color: #f4f4f4;
    --panel-bg: lightgrey;
    --text-color: #333;
    --light-bub-color: black;
    --button-bg: #007bff;
    --button-hover: #0056b3;
    --input-bg: #fff;
    --input-border: #ccc;
    --sub-bar-color: transparent;

    --shadow-color: rgba(0, 0, 0, 0.2);
    --split-pane-color:white;
    --border-color:#007bff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    display: flex; flex-direction: column; height: 100vh; background: var(--bg-color); color: var(--text-color);
}

.top-bar {
    background: var(--bar-color); padding: 4px; display: flex; justify-content: space-between; align-items: center;
    /*box-Shadow: "0 4px 10px rgba(0, 0, 0, 0.2)";*/
    box-shadow: rgba(0, 0, 0, 0.2) 10px 4px 10px;
    z-index: 51;
}

.theme-toggle {
    background: transparent; border: none; cursor: pointer; font-size: 24px; transition: transform 0.3s;
}

.theme-toggle svg { width: 24px; height: 24px; fill: var(--text-color); }
.theme-toggle:active { transform: rotate(180deg); }

.side-panel {
    width: 250px;
    background: var(--bar-color);
    padding: 15px; transition: transform 0.3s ease-in-out;
    position: absolute;
    top: 55px;
    left: 0;
    margin: auto;
    height: calc(100% - 55px);
    overflow-y: auto;
    z-index: 50;
    box-Shadow: rgba(0, 0, 0, 0.2) 0 4px 10px ;
}



.side-panel.hidden { transform: translateX(-100%); }


.chat-container {
    width: 100%;
    height: calc(100vh - 100px);
    display: flex;
    background: var(--bg-color);
    position: relative;
}

.panels{width:100%}

.toggle-btn {
    background: transparent; border: none; cursor: pointer; font-size: 24px;
}

.toggle-btn span {
    display: block; width: 24px; height: 3px; background: var(--text-color);
    margin: 5px auto; transition: all 0.3s;
}

.toggle-btn.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.toggle-btn.active span:nth-child(2) { opacity: 0; }
.toggle-btn.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.input-container {
    position: fixed;
    bottom: 0;
    width: 100%;
    background: var(--bar-color);
    padding: 2px;
    display: flex;
    gap: 10px;
    justify-content: center;
    z-index: 60;
    box-shadow: rgba(0, 0, 0, 0.2) 10px 10px 10px 10px;
}

input, select, textarea {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-color);
    padding: 10px;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--button-bg);
}

button {
    background: var(--button-bg);
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    color: white;
    cursor: pointer;
}

button:hover {
    background: var(--button-hover);
}

button:active {
    background: var(--button-active);
}

@media (max-width: 768px) {
    .side-panel {
        width: 200px;
    }
}

.icon-btn {
    position: relative;
}
.icon-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 99;
}

.icon-btn:hover::after {
    opacity: 1;
}

.icon-btn[data-tooltip]:hover::after {
    bottom: auto;
    top: calc(100% + 5px);
}

.icon-btn[data-tooltip]:hover::after[data-position="top"] {
    bottom: calc(100% + 5px);
    top: auto;
}

.icon-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, transform 0.2s;
}

.icon-btn svg {
    width: 24px;
    height: 24px;
    stroke: var(--text-color);
    fill: none;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}

.icon-btn:active {
    transform: scale(0.95);
}

.scale-slider {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 5px;
    background: var(--bar-color);
    border-radius: 8px;
}
.scale-slider input {
    width: 150px;
}
.scale-slider span {
    color: var(--text-color);
    font-size: 14px;
    min-width: 35px;
    text-align: center;
    display: inline-block;
}

.buttons-group{
    display: flex; flex-direction: row;
}

.status-text{
    font-size: 14px;
    min-width: 180px;
    text-align: center;
    display: inline-block;
}


.split-container {
    position: relative;
    display: inline-block;
    text-align: center;
    width: 128px;
    height: 128px;
    background: var(--panel-bg);
    border-radius: 10px;
    overflow: hidden;
}

.split-image {
    border: 2px solid var(--border-color);
    width: 100%;
    height: 100%;
    object-fit: scale-down;
    border-radius: 10px;
    background:var(--image-bg);
}

.original-image {
    max-width: 100%;
    display: block;
    object-fit: scale-down;
}


.image-checkbox {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.split-image-view-button{
    background: var(--button-bg);
    position: absolute;
    bottom: 0px;
    left: 0px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    color: var(--text-color);
    padding: inherit;
}


.right-panel-grids {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
    gap: 12px;
    padding: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.split-pane {
    display: flex;
    width: 100%;
    position: relative;
}

.split-left {
    flex: 0 0 calc(30% - 20px);
    background: var(--split-pane-color);
    overflow: auto;
    min-width: 30%;
    min-height: 30%;
    /*max-width: 70%;*/
    padding: 20px 20px 20px 20px;
}

.split-right {
    flex: 1 1 auto;
    background: var(--split-pane-color);
    overflow: auto;
    /*min-width: 30%;*/
    /*min-height: 30%;*/
    /*min-width: 30%;*/
    /*max-width: 70%;*/
    padding: 10px;
}

.title{
    font-size: 18px;
    font-weight: var(--font-weight-bold);
    color: var(--text-color);
    margin-top: 10px;
}
.resizer {
    width: 3px;
    background: var(--border-color);
    cursor: ew-resize;
    position: relative;
    box-shadow: var(--shadow-color) 2px 2px 2px 2px;
}

.button-group{
    display: flex;
    background: var(--sub-bar-color);
    align-items: center;
    justify-content: center;
    gap: 8px;
}