/* /home/admin/web/apps/mindalai_app/static/css/base.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100dvh; /* Вся висота видимого екрана */
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    transition: background-color 0.3s, color 0.3s, font-size 0.3s;
    overflow-y: auto; /* Дозволяємо прокрутку сторінки */
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100dvh; /* Гарантуємо, що контент займає всю висоту */
}

main {
    flex: 1; /* Контент розтягується, щоб заповнити доступний простір */
    padding-top: 40px; /* Відступ зверху для фіксованого навбару */
    padding: 1px; /* Базові відступи */
    box-sizing: border-box;
}

@media screen and (max-width: 768px) {
    body {
        font-size: 14px;
    }
}

@media screen and (max-width: 480px) {
    body {
        font-size: 12px;
    }
}

body[data-theme="light"] {
    background-color: #f4f4f9;
    color: #333;
}

body[data-theme="dark"] {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

.chat-container {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 60px); /* Враховуємо висоту navbar */
    position: relative;
    padding: 1rem;
    border: 1px solid #ddd;
}

.chat-input-area {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.chat-input-area textarea {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ddd;
}

.chat-input-area button {
    padding: 0.5rem 1rem;
    border: none;
    cursor: pointer;
}

.message {
    margin: 0.5rem 0;
    padding: 0.5rem;
    border-radius: 8px;
}

.user-message {
    background-color: #e9f5ff;
    text-align: justify;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    margin: 0.5rem 0;
    word-wrap: break-word;
    display: block;
    clear: both;
}

.assistant-message {
    background-color: #f0f0f0;
}

/* Стилі для .file-upload перенесено з homepage.css */
.file-upload {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    position: relative;
    overflow: hidden;
}

.file-upload .file-icon {
    pointer-events: none;
}

.file-upload input[type="file"] {
    display: none !important;
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    border: 0 !important;
    opacity: 0 !important;
}

.file-upload::before,
.file-upload::after {
    content: none !important;
}

/* Темний режим */
body[data-theme="dark"] .centered-container {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

body[data-theme="dark"] .chat-container {
    border-color: #555;
}

body[data-theme="dark"] .user-message {
    background-color: #2a4a6e;
}

body[data-theme="dark"] .assistant-message {
    background-color: #3a3a3a;
}

body[data-theme="dark"] .chat-input-area textarea {
    background-color: #2a2a2a;
    color: #e0e0e0;
    border-color: #555;
}

body[data-theme="dark"] .chat-input-area button {
    background-color: #555;
    color: #e0e0e0;
}

/* Стилі для сендвіч-меню */
.menu-content {
    position: fixed;
    top: 0;
    left: -250px;
    width: 250px;
    height: 100%;
    padding: 1rem;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    transition: left 0.3s ease;
    z-index: 1000;
}

.menu-content.active {
    left: 0;
}

/* Фон для кожної кольорової маски */
body.theme-chatgpt.blue-mask .menu-content,
body.theme-grok.blue-mask .menu-content,
body.theme-unique.blue-mask .menu-content {
    background-color: #0056b3;
}

body.theme-chatgpt.green-mask .menu-content,
body.theme-grok.green-mask .menu-content,
body.theme-unique.green-mask .menu-content {
    background-color: #1d7a34;
}

body.theme-chatgpt.purple-mask .menu-content,
body.theme-grok.purple-mask .menu-content,
body.theme-unique.purple-mask .menu-content {
    background-color: #5a2d82;
}

body.theme-chatgpt.red-mask .menu-content,
body.theme-grok.red-mask .menu-content,
body.theme-unique.red-mask .menu-content {
    background-color: #a71d2a;
}

body.theme-chatgpt.yellow-mask .menu-content,
body.theme-grok.yellow-mask .menu-content,
body.theme-unique.yellow-mask .menu-content {
    background-color: #b38f00;
}

body.theme-colorblind .menu-content {
    background-color: #4a4a4a;
}

body.theme-high_contrast .menu-content {
    background-color: #333;
}

.menu-content a {
    color: #fff;
    text-decoration: none;
    display: block;
    padding: 0.5rem 0;
}

.menu-content a:hover {
    text-decoration: underline;
}

/* Полоса прокрутки до Chat */
#chat-messages::-webkit-scrollbar,
#chat-history::-webkit-scrollbar {
    width: 10px;
}

#chat-messages::-webkit-scrollbar-track,
#chat-history::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#chat-messages::-webkit-scrollbar-thumb,
#chat-history::-webkit-scrollbar-thumb {
    background: #888;
}

#chat-messages::-webkit-scrollbar-thumb:hover,
#chat-history::-webkit-scrollbar-thumb:hover {
    background: #555;
}

#chat-messages,
#chat-history {
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}

body[data-theme="dark"] #chat-messages::-webkit-scrollbar-track,
body[data-theme="dark"] #chat-history::-webkit-scrollbar-track {
    background: #2a2a2a;
}

body[data-theme="dark"] #chat-messages::-webkit-scrollbar-thumb,
body[data-theme="dark"] #chat-history::-webkit-scrollbar-thumb {
    background: #666;
}

body[data-theme="dark"] #chat-messages::-webkit-scrollbar-thumb:hover,
body[data-theme="dark"] #chat-history::-webkit-scrollbar-thumb:hover {
    background: #999;
}

body[data-theme="dark"] #chat-messages,
body[data-theme="dark"] #chat-history {
    scrollbar-color: #666 #2a2a2a;
}

/* Теми для прокрутки */
body.theme-chatgpt #chat-messages::-webkit-scrollbar-track,
body.theme-chatgpt #chat-history::-webkit-scrollbar-track {
    background: #f0f0f0;
}
body.theme-chatgpt[data-theme="dark"] #chat-messages::-webkit-scrollbar-track,
body.theme-chatgpt[data-theme="dark"] #chat-history::-webkit-scrollbar-track {
    background: #404040;
}

body.theme-grok #chat-messages::-webkit-scrollbar-track,
body.theme-grok #chat-history::-webkit-scrollbar-track {
    background: #e6e6e6;
}
body.theme-grok[data-theme="dark"] #chat-messages::-webkit-scrollbar-track,
body.theme-grok[data-theme="dark"] #chat-history::-webkit-scrollbar-track {
    background: #2d2d2d;
}

body.theme-unique #chat-messages::-webkit-scrollbar-track,
body.theme-unique #chat-history::-webkit-scrollbar-track {
    background: #f0f0f0;
}
body.theme-unique[data-theme="dark"] #chat-messages::-webkit-scrollbar-track,
body.theme-unique[data-theme="dark"] #chat-history::-webkit-scrollbar-track {
    background: #333333;
}

body.theme-colorblind #chat-messages::-webkit-scrollbar-track,
body.theme-colorblind #chat-history::-webkit-scrollbar-track {
    background: #d3d3d3;
}
body.theme-colorblind[data-theme="dark"] #chat-messages::-webkit-scrollbar-track,
body.theme-colorblind[data-theme="dark"] #chat-history::-webkit-scrollbar-track {
    background: #4a4a4a;
}

body.theme-high_contrast #chat-messages::-webkit-scrollbar-track,
body.theme-high_contrast #chat-history::-webkit-scrollbar-track {
    background: #cccccc;
}
body.theme-high_contrast[data-theme="dark"] #chat-messages::-webkit-scrollbar-track,
body.theme-high_contrast[data-theme="dark"] #chat-history::-webkit-scrollbar-track {
    background: #333333;
}

/* Універсальні стилі для сторінок у розробці */
.page-wrapper {
    min-height: calc(100vh - 60px);
    padding-top: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.content-section {
    width: 100%;
    max-width: 800px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-sizing: border-box;
}

.content-block {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background-color: #ffffff;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

h1, h2, h3 {
    margin-bottom: 0.5rem;
    color: #333;
}

p {
    margin-bottom: 0.5rem;
    line-height: 1.5;
    color: #555;
}

body[data-theme="dark"] .page-wrapper {
    background-color: #1a1a1a;
}

body[data-theme="dark"] .content-section {
    background-color: #1a1a1a;
}

body[data-theme="dark"] .content-block {
    background-color: #2a2a2a;
    color: #e0e0e0;
}

body[data-theme="dark"] h1,
body[data-theme="dark"] h2,
body[data-theme="dark"] h3 {
    color: #e0e0e0;
}

body[data-theme="dark"] p {
    color: #ccc;
}

@media screen and (max-width: 768px) {
    .page-wrapper {
        padding-top: 50px;
        min-height: calc(100vh - 50px);
    }
    .content-section {
        padding: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    .content-block {
        padding: 0.5rem;
        margin-bottom: 0.5rem;
    }
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    p { font-size: 0.9rem; }
}

@media screen and (max-width: 480px) {
    .page-wrapper {
        padding-top: 40px;
        min-height: calc(100vh - 40px);
    }
    .content-section {
        padding: 0.25rem;
        max-width: calc(100% - 0.5rem);
    }
    .content-block {
        padding: 0.25rem;
        margin-bottom: 0.25rem;
    }
    h1 { font-size: 1.25rem; }
    h2 { font-size: 1rem; }
    p { font-size: 0.875rem; }
}

/* Додати в кінець /static/css/core/base.css */
.centered-container {
    text-align: center;
    padding: 0 1rem;
    color: #333333;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    min-height: calc(100vh - 60px); /* Враховуємо навбар */
    display: flex;
    flex-direction: column;
    justify-content: center; /* Вертикальне центрування */
    align-items: center; /* Горизонтальне центрування */
}

body[data-theme="dark"] .centered-container {
    color: #e0e0e0;
}

/* /home/admin/web/apps/mindalai_app/static/css/core/base.css */
body {
    margin: 0;
    padding: 0;
    min-height: 100vh; /* Забезпечує, що body розтягується за вмістом */
    overflow-y: auto; /* Дозволяє вертикальну прокрутку */
}

main {
    min-height: 100%; /* Дозволяє вмісту розтягуватися */
    overflow-y: auto; /* Дозволяє прокрутку всередині main, якщо потрібно */
    padding-top: 7%; /* Відступ для фіксованої навігації, якщо вона є */
}

/* Якщо navbar фіксований */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}


/* Універсальний контейнер для всіх мобільних сторінок */
.mobile-container {
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
    font-family: Arial, sans-serif;
    border-radius: 8px;
}

/* Заголовки */
.mobile-container h1 {
    font-size: 24px;
    margin-bottom: 20px;
}

.mobile-container h2 {
    font-size: 20px;
    margin: 15px 0 10px;
}

/* Кнопки-посилання (для записів, планів тощо) */
.entry-btn {
    display: block;
    padding: 10px;
    margin: 10px 0;
    border-radius: 8px;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s;
}

.entry-btn small {
    display: block;
    font-size: 12px;
    opacity: 0.8;
}

/* Футер із кнопками */
.mobile-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    gap: 10px;
}

.add-btn, .trash-btn, .edit-btn, .back-btn {
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    text-align: center;
    transition: background-color 0.3s;
}

/* Світлий режим */
body[data-theme="light"] .mobile-container {
    background-color: #f4f4f9;
    color: #333;
}

body[data-theme="light"] .entry-btn {
    background-color: #ffffff;
    color: #333;
    border: 1px solid #ddd;
}

body[data-theme="light"] .entry-btn:hover {
    background-color: #e8e8e8;
}

body[data-theme="light"] .add-btn {
    background-color: #4CAF50;
    color: #fff;
    border: none;
}

body[data-theme="light"] .trash-btn {
    background-color: #f44336;
    color: #fff;
    border: none;
}

body[data-theme="light"] .edit-btn {
    background-color: #2196F3;
    color: #fff;
    border: none;
}

body[data-theme="light"] .back-btn {
    background-color: #9e9e9e;
    color: #fff;
    border: none;
}

/* Темний режим */
body[data-theme="dark"] .mobile-container {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

body[data-theme="dark"] .entry-btn {
    background-color: #2a2a2a;
    color: #e0e0e0;
    border: 1px solid #555;
}

body[data-theme="dark"] .entry-btn:hover {
    background-color: #3a3a3a;
}

body[data-theme="dark"] .add-btn {
    background-color: #388E3C;
    color: #e0e0e0;
}

body[data-theme="dark"] .trash-btn {
    background-color: #d32f2f;
    color: #e0e0e0;
}

body[data-theme="dark"] .edit-btn {
    background-color: #1976D2;
    color: #e0e0e0;
}

body[data-theme="dark"] .back-btn {
    background-color: #757575;
    color: #e0e0e0;
}

/* Адаптивність */
@media screen and (max-width: 480px) {
    .mobile-container {
        padding: 10px;
    }
    .mobile-container h1 {
        font-size: 20px;
    }
    .entry-btn {
        padding: 8px;
    }
    .mobile-footer {
        flex-direction: column;
        gap: 5px;
    }
    .add-btn, .trash-btn, .edit-btn, .back-btn {
        padding: 8px 15px;
    }
}

/* Світлий режим за замовчуванням */
body[data-theme="light"] .mobile-container {
    background-color: #f4f4f9;
    color: #333;
}

body[data-theme="light"] .entry-btn {
    background-color: #ffffff;
    color: #333;
    border: 1px solid #ddd;
}

body[data-theme="light"] .add-btn {
    background-color: #4CAF50;
    color: #fff;
}

body[data-theme="light"] .trash-btn {
    background-color: #f44336;
    color: #fff;
}

body[data-theme="light"] .edit-btn {
    background-color: #2196F3;
    color: #fff;
}

body[data-theme="light"] .back-btn {
    background-color: #9e9e9e;
    color: #fff;
}

/* Темний режим за замовчуванням */
body[data-theme="dark"] .mobile-container {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

body[data-theme="dark"] .entry-btn {
    background-color: #2a2a2a;
    color: #e0e0e0;
    border: 1px solid #555;
}

body[data-theme="dark"] .add-btn {
    background-color: #388E3C;
    color: #e0e0e0;
}

body[data-theme="dark"] .trash-btn {
    background-color: #d32f2f;
    color: #e0e0e0;
}

body[data-theme="dark"] .edit-btn {
    background-color: #1976D2;
    color: #e0e0e0;
}

body[data-theme="dark"] .back-btn {
    background-color: #757575;
    color: #e0e0e0;
}

.debug-hidden {
    display: none;
}

.cf-turnstile-invisible {
    display: none;
}

/* Прелоадер */
#preloader {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(26, 28, 46, var(--preloader-opacity, 0.7));
  display: none; /* Приховано за замовчуванням */
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.5s ease;
}

#preloader.active {
    display: flex; /* Показати, коли додано клас active */
}

#preloader.fade-out {
  opacity: 0;
  pointer-events: none;
}

.cssload-loader {
  position: relative;
  width: 64px;
  height: 64px;
  transform: rotateZ(45deg);
  perspective: 800px;
}

.cssload-inner {
  position: absolute;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  border-radius: 50%;
}

.cssload-one {
  left: 0;
  top: 0;
  animation: cssload-rotate-one 1.15s linear infinite;
  border-bottom: 3px solid #ffeb3b; /* Жовтий */
}

.cssload-two {
  right: 0;
  top: 0;
  animation: cssload-rotate-two 1.15s linear infinite;
  border-right: 3px solid rgba(211, 47, 47, 0.69);
}

.cssload-three {
  right: 0;
  bottom: 0;
  animation: cssload-rotate-three 1.15s linear infinite;
  border-top: 3px solid #2196f3; /* Блакитний (#C2185B;  Пурпурний) */
}

@keyframes cssload-rotate-one {
  0% { transform: rotateX(35deg) rotateY(-45deg) rotateZ(0deg); }
  100% { transform: rotateX(35deg) rotateY(-45deg) rotateZ(360deg); }
}

@keyframes cssload-rotate-two {
  0% { transform: rotateX(50deg) rotateY(10deg) rotateZ(0deg); }
  100% { transform: rotateX(50deg) rotateY(10deg) rotateZ(360deg); }
}

@keyframes cssload-rotate-three {
  0% { transform: rotateX(35deg) rotateY(55deg) rotateZ(0deg); }
  100% { transform: rotateX(35deg) rotateY(55deg) rotateZ(360deg); }
}

