* {
    box-sizing: border-box;
}

/* h1, h2, h3, body, ul, li {
    margin: 0;
    padding: 0;
} */

body, html {
    height: 100vh;
    overflow: hidden;
}

/* General Styles */
body {
    font-family: 'Segoe UI', sans-serif;
    background-image: linear-gradient(to bottom, rgba(12, 154, 220, 0.2), transparent);
}

.main-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 12px 20px 20px 20px;
}

/*  TODO: исправить костыль с высотой */
.container {
    display: flex;
    width: 100%;
    height: calc(100vh - 40px - 36px);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    background-color: white;
}

/* Sidebar Styles */
.sidebar {
    background-image: radial-gradient(circle at 40% 20%, hsl(220, 20%, 35%), hsl(220, 30%, 6%));
    padding: 20px;
    color: white;
    width: 300px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    gap: 20px;
    border-bottom-left-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.upload-container {
    background-color: #e8e9ec;
    border: 1px solid hsla(220, 20%, 80%, 0.4); /* Светлая граница */
    border-radius: 8px; /* Скруглённые углы */
    padding: 16px 16px 2px 16px;
    flex-direction: column;
    gap: 16px; /* Пространство между элементами */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); /* Лёгкая тень */
}

.upload-container form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.file-input-container {
    display: flex;
    flex-direction: column;
    gap: 5px; /* Пространство между лейблом и инпутом */
    background-color: #ffffff; /* Белый фон */
    padding: 10px;
    border: 1px solid hsla(220, 20%, 80%, 0.4); /* Светлая граница */
    border-radius: 6px; /* Скруглённые углы */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05); /* Тень для инпута */
}

.file-input-container label {
    font-size: 14px;
    color: #374151; /* Тёмно-серый цвет текста */
    font-weight: bold;
}

#fileInput {
    width: 100%;
    padding: 5px;
}

.uploadStatus {
    color: darkgreen;
    margin-top: 10px;
}

.upload-btn {
    background-color: #30a9e1;
    color: white;
    margin-top: 10px;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #2c9ed3;
    cursor: pointer;
    border: none;
    text-align: center;
    width: 100%;
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15), inset 0 2px 2px rgba(255, 255, 255, 0.2);
    transition: background-color 0.3s ease;
}

.upload-btn:hover {
    background-color: #2c9ed3;
}

.upload-btn:disabled {
    background-color: #278ab8;
    cursor: default;
}

/* Changes Panel Styles */

.changes-panel {
    height: 100%;
    width: 80%;
    flex-grow: 1;
    gap: 12px;
    padding: 20px;
    display: none;
    justify-content: space-between;
    animation: fadeIn 0.5s ease;
}

.changes-panel.active {
    display: flex;
}

.changes-list-container {
    width: 18%;
    min-width: 260px;
    display: flex;
    flex-direction: column;
}

.changes-list-title {
    text-align: left;
    margin-bottom: 20px;
    color: #263745;
}

.changes-list-box {
    width: 100%;
    overflow-y: auto;
    border: 1px solid hsla(220, 20%, 80%, 0.4);
    padding: 12px;
    border-radius: 10px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.change-item {
    padding: 8px;
    border-radius: 8px;
    /* border: 1px solid #1895cf; */
    /*background: #929195;*/
    /*color: white;*/
    background-color: hsla(220, 20%, 88%, 0.3);
    color: #263745;
    cursor: pointer;
    transition: background-color ease 0.3s;
    font-size: 14px;
}

.change-item.active {
    /* border: 1px solid #1895cf; */
    background: rgb(48, 169, 225, 0.8);
    color: white;
    cursor: default;
    pointer-events: none;
}

.change-item:hover {
    background-color: hsla(220, 20%, 88%, 0.8);
}

.changes-content-title {
    text-align: left;
    margin-bottom: 20px;
      color: #263745;
}

.changes-content-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.changes-content-box {
    width: 100%;
    overflow-y: auto;
    border: 1px solid hsla(220, 20%, 80%, 0.4);
    background-color: hsla(220, 20%, 88%, 0.3);
    padding: 18px;
    border-radius: 10px;
    flex-grow: 1;
    color: #263745;
}

.empty-changes {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    color: #929195;
    font-size: 18px;
    height: 100%;
}

/* Chat Panel Styles */


.chat-error {
    color: red;
    margin-top: 14px;
}

.chat-panel {
    width: 80%;
    flex-grow: 1;
    padding: 20px;
    display: none;
    flex-direction: column;
    justify-content: space-between;
    animation: fadeIn 0.5s ease;
}

.chat-panel.active{
    display: flex;
}

.chat-title {
    text-align: left;
    margin-bottom: 20px;
    color: #263745;
}

.chat-box {
    flex-grow: 1; /* Позволяет блоку растягиваться внутри контейнера */
    overflow-y: auto; /* Добавляет вертикальную прокрутку при переполнении */
    background-color: hsla(220, 20%, 88%, 0.3);
    padding: 10px;
    border-radius: 10px;
}

#chatBox {
    width: 100%; /* Ширина контейнера */
    overflow-y: auto; /* Включаем вертикальную прокрутку */
    border: 1px solid hsla(220, 20%, 80%, 0.4); /* Граница для визуализации */
    padding: 10px; /* Отступы внутри контейнера */
    box-sizing: border-box; /* Учитываем padding в размерах */
}

/* Message Styles */
.message {
    margin: 10px;
    padding: 10px;
    border-radius: 16px;
    width: fit-content;
    max-width: 60%;
    word-wrap: break-word;
    position: relative;
    font-size: 16px;
    line-height: 130%
}

/* Updated User Message Color */
.user-message {
    /* background: rgb(48, 169, 225, 0.8); */
    background: hsla(220, 20%, 28%, 1);
    color: rgba(255, 255, 255, 0.9);
    align-self: flex-end;
    border-bottom-right-radius: 0;
    margin-left: auto;
}

/* Updated System Message Color */
.system-message {
    background-color: rgba(107, 108, 111, 0.2);
    color: #263745;
    align-self: flex-start;
    border-bottom-left-radius: 0;
    margin-right: auto;
}

/* Form Styles for Asking Questions */
#chatForm {
    display: flex;
    align-items: center;
    margin-top: 10px;
    gap: 10px;
}

#question {
    flex-grow: 1;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid hsla(220, 20%, 80%, 0.6);
    outline: none;
    cursor: pointer;
    transition: border 0.3 ease;
}

#question:hover {
    border: 1px solid hsla(220, 20%, 80%, 1);
}

#question:focus, #question:active {
    border: 1px solid rgb(164, 170, 180);
}

.ask-btn {
    width: 80px;
    background-color: #30a9e1;
    color: white;
    padding: 11px;
    border-radius: 5px;
    border: 1px solid #2c9ed3;
    cursor: pointer;
    border: none;
    text-align: center;
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15), inset 0 2px 2px rgba(255, 255, 255, 0.2);
    transition: background-color 0.3s ease;
}

.ask-btn:hover {
    background-color: #2c9ed3;
}

.predefined-questions button {
    background-color: #30A9E1;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-align: left;
    margin-left: auto; /* Гарантирует расположение кнопки справа */

}

/*.predefined-questions button:hover {*/
/*    background-color: #929195;*/
/*}*/

.logo-container {
    display: flex;
    justify-content: flex-start; /* Выравнивание по левому краю */
    align-items: flex-start; /* Выравнивание по верхнему краю */
    padding: 10px; /* Добавляем отступ от краёв */
}

.logo {
    max-height: 130px;
    max-width: 130px;
    object-fit: contain; /* Сохранение пропорций */
}


.tabs-container {
    display: flex;
    align-items: left;
    gap: 6px;
    /* padding-left: 20px; */
}

/* Tab Buttons Styled Horizontally */
.tab-button {
    background-color: white;
    color: #263745;
    padding: 10px 20px;
    border: none;
    border-top-right-radius: 5px;
    border-top-left-radius: 5px;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.tab-button.active {
    background-color: hsla(220, 20%, 28%, 1);
    color: white;
    cursor: default;
    pointer-events: none;
}

.tab-button.active:hover {
    background-color: hsla(220, 20%, 28%, 1);
}

.tab-button:hover {
    background-color: hsla(220, 20%, 28%, 1);
    color: white;
}

/* Анимация неонового свечения */
@keyframes neon-glow {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.tab-aside-content h2 {
    margin-bottom: 20px;
}

.tab-aside-content {
    display: none;
    flex-grow: 1;
    flex-direction: column;
    animation: fadeIn 0.5s ease;
}

.tab-aside-content.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Контейнер для спиннера */
.spinner-container {
    display: none; /* Скрываем по умолчанию */
    justify-content: center;
    align-items: center;
    margin-top: 20px; /* Добавляем отступ сверху, чтобы спиннер был ниже кнопки */
    width: 100%; /* Растягиваем контейнер по ширине родителя */
}

/* Анимация загрузочного колеса */
.loading-spinner {
    border: 4px solid #ffffff; /* Светлый цвет фона спиннера */
    border-top: 4px solid #263745;; /* Чёрный цвет верхней полосы */
    border-radius: 50%; /* Делаем круг */
    width: 40px; /* Диаметр спиннера */
    height: 40px; /* Диаметр спиннера */
    animation: spin 1s linear infinite; /* Анимация вращения */
}

.loading-spinner-message {
    border-radius: 50%; /* Делаем круг */
    width: 100%; /* Диаметр спиннера */
    height: 60px; /* Диаметр спиннера */
    animation: spin 1s linear infinite; /* Анимация вращения */
    color: #263745;
}

/* Ключевые кадры анимации вращения */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.predefined-questions {
    background-color: whitesmoke; /* Темный фон, гармонирующий с боковой панелью */
    padding: 16px;
    border-radius: 8px;
    margin-top: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Легкая тень */
    color: black;
    font-size: 14px;
    font-weight: 500;
}

.predefined-questions h3 {
    font-size: 16px;
    margin-bottom: 10px;
    color: black; /* Цвет заголовка */
}

.predefined-questions ul {
    list-style-type: none; /* Убираем маркеры списка */
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.predefined-questions li {
    padding: 8px;
    background-color: white; /* Более светлый серый для выделения */
    border-radius: 5px;
    cursor: text;
    transition: background-color 0.3s ease;
}

.predefined-questions li:hover {
    background-color: #e3f3ff; /* Немного темнее при наведении */
}

.editable-question {
    flex-grow: 1; /* Заставляет текст занимать доступное пространство */
    margin-right: 10px; /* Добавляет отступ между текстом и кнопкой */
}

.send-question-btn {
    background-color: #AB213A;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    padding: 5px 10px;
    text-align: center;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #000;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    margin: 10px auto;
}

/* Markdowm styles  */

blockquote {
    background: #fbfbfb;
    border-left: 6px solid rgba(107, 108, 111, 0.4);
    margin: 8px 6px;
    padding: 4px 8px;
    quotes: "\201C" "\201D" "\2018" "\2019";
}