/* Импорт шрифтов Google */
@import url('https://fonts.googleapis.com/css2?family=Google+Sans:wght@400;500;700&family=Roboto:wght@300;400;500;700&display=swap');

/* Базовые переменные */
:root {
    --font-primary: 'Google Sans', 'Roboto', sans-serif;
    --font-secondary: 'Roboto', sans-serif;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --bg-color: #ffffff;
    --bg-secondary: #f8f9fa;
    --accent-color: #1a73e8;
    --accent-hover: #1557b0;
    --border-color: #dadce0;
    --shadow-color: rgba(0, 0, 0, 0.08);
    --header-height: 64px;
    --sidebar-width: 256px;
}

/* Темная тема */
html[data-theme="dark"] {
    --text-primary: #e8eaed;
    --text-secondary: #9aa0a6;
    --bg-color: #202124;
    --bg-secondary: #2d2e31;
    --border-color: #3c4043;
    --shadow-color: rgba(0, 0, 0, 0.3);
}

/* Базовые стили */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: var(--font-secondary);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Типография */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
}

h1 {
    font-size: 22px;
    line-height: 28px;
}

h2 {
    font-size: 18px;
    line-height: 24px;
}

p {
    margin: 0 0 16px;
    color: var(--text-secondary);
}

/* Кнопки */
.btn {
    font-family: var(--font-primary);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 24px;
    border-radius: 24px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background-color: #4caf50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 24px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.btn-primary:hover {
    background-color: #45a049;
}

.btn-primary:disabled {
    background-color: #4caf50;
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-secondary {
    background-color: transparent;
    color: var(--accent-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: rgba(26, 115, 232, 0.04);
    border-color: var(--accent-color);
}

/* Ссылки */
a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* Формы */
input, textarea, select {
    font-family: var(--font-secondary);
    font-size: 14px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background-color: var(--bg-color);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

/* Макет */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    display: flex;
    flex: 1;
}

/* Header */
header {
    height: 56px; /* Уменьшаем высоту header */
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 100%;
    margin: 0 auto;
    padding: 12px 16px 0; /* Увеличиваем отступ сверху и удаляем отступ снизу */
    width: 100%;
    height: 100%;
}

/* Контейнер поиска */
.search-container {
    flex: 1;
    max-width: 600px;
    margin: 0 20px 0 8px; /* Уменьшаем левый отступ */
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background-color: #f1f3f4;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 0 16px;
    height: 36px;
    transition: all 0.2s ease;
}

.search-box:hover,
.search-box:focus-within {
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--accent-color);
}

.search-icon {
    margin-right: 12px;
    color: #5f6368;
    flex-shrink: 0;
}

#search-input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 16px;
    color: #202124;
    padding: 0;
    margin: 0;
    height: auto;
}

#search-input::placeholder {
    color: #5f6368;
}

/* Навигация */
header nav {
    display: flex;
    align-items: center;
}

header nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

header nav ul li {
    display: flex;
    align-items: center;
}

header nav ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
    padding: 8px 16px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    height: 36px;
}

header nav ul li a:hover {
    color: var(--accent-color);
    background-color: rgba(26, 115, 232, 0.04);
}

/* Кнопка переключения темы */
.theme-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    transition: background-color 0.2s ease;
}

.theme-toggle:hover {
    background-color: rgba(26, 115, 232, 0.04);
}

.sun-icon, .moon-icon {
    position: absolute;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

html[data-theme="light"] .sun-icon {
    opacity: 1;
    transform: rotate(0deg);
}

html[data-theme="light"] .moon-icon {
    opacity: 0;
    transform: rotate(180deg);
}

html[data-theme="dark"] .sun-icon {
    opacity: 0;
    transform: rotate(-180deg);
}

html[data-theme="dark"] .moon-icon {
    opacity: 1;
    transform: rotate(0deg);
}

/* Адаптивность */
@media (max-width: 768px) {
    :root {
        --header-height: 52px;
        --sidebar-width: 0px;
    }

    header {
        padding: 6px 12px;
    }

    .header-logo h1 {
        font-size: 20px;
    }

    .btn {
        padding: 8px 16px;
    }

    .cloud-container {
        grid-template-columns: 1fr;
    }
    
    .container-main {
        padding: 10px;
        width: 100%;
        max-width: 100%;
    }

    header .container {
        flex-direction: row;
        padding: 6px 12px;
        width: 100%;
    }
    
    .search-container {
        margin: 0 12px 0 4px;
    }
    
    header {
        padding: 0.5em 0;
        position: sticky;
        top: 0;
    }

    .search-box {
        height: 32px;
    }
}

/* Добавляем правила для html, чтобы предотвратить горизонтальную прокрутку */
/* Универсальный селектор для применения box-sizing ко всем элементам */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    width: 100%;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', 'Arial', sans-serif;
    background-color: var(--bg-color, #f5f7fa);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    color: var(--text-color, #333);
    transition: background-color 0.5s ease, color 0.5s ease;
    overflow-x: hidden; /* Запрещаем горизонтальную прокрутку */
    width: 100%; /* Устанавливаем ширину на 100% */
    box-sizing: border-box; /* Включаем box-sizing для правильного расчета ширины */
}

/* Новый контейнер приложения */
.app-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
    min-height: calc(100vh - 60px); /* Высота экрана минус footer */
    position: relative; /* Добавляем position: relative для корректного отображения дочерних элементов */
    z-index: 1; /* Гарантируем, что контейнер будет над подвалом */
}

/* Новый контейнер для макета */
.layout-container {
    display: flex;
    flex: 1;
    width: 100%;
    height: auto; /* Изменяем с min-height на height: auto для автоматического расширения */
    min-height: calc(100vh - 60px); /* Высота экрана минус footer */
}

/* Основной контент с шапкой */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: calc(100% - var(--sidebar-width, 240px));
    min-height: 100%;
}

/* Стили для глобального индикатора загрузки */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(66, 133, 244, 0.2);
    border-top: 5px solid #4285f4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loader-text {
    margin-top: 16px;
    font-size: 18px;
    color: #4285f4;
    font-weight: 500;
}

main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px; /* Уменьшаем отступы с 40px до 20px */
    background-color: var(--bg-color, #f5f7fa);
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.container-main {
    display: flex;
    flex-direction: column;
    background-color: transparent;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.cloud-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    width: 100%;
    align-items: flex-start;
    position: relative;
}

/* Убираем скрытие чата по умолчанию */
.chat-container {
    position: relative; /* Добавляем position: relative вместо display: none */
    z-index: 2; /* Устанавливаем z-index для нормального отображения */
}

/* Стили для плавающего чат-бота */
.chat-bot-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    display: flex;
    flex-direction: row; /* Изменяем на горизонтальное расположение */
    align-items: center;
    gap: 15px; /* Добавляем отступ между кнопками */
}

/* Кнопка открытия чата (кружок) - синий цвет в светлой теме */
.chat-bot-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #4285f4; /* Синий цвет для кнопки чата в светлой теме */
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1001;
    border: none;
    overflow: hidden;
}

.chat-bot-button:hover {
    background-color: #3367d6; /* Более темный синий при наведении в светлой теме */
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
}

.chat-bot-button:active {
    transform: scale(0.95);
}

.chat-bot-button svg {
    width: 30px;
    height: 30px;
    fill: none;
    stroke: white;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Окно чата */
.chat-popup {
    display: none;
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 350px;
    height: 500px;
    background-color: #fff;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    flex-direction: column;
    transition: all 0.3s ease, transform 0.1s ease;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
}

/* Стиль для окна в режиме перетаскивания */
.chat-popup.dragging {
    transition: none;
    opacity: 0.95;
    cursor: move;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
    user-select: none;
}

/* Анимация при открытии */
.chat-popup.open {
    display: flex;
    opacity: 1;
    transform: translateY(0) scale(1);
    animation: popIn 0.3s ease forwards;
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Заголовок чата - синий в светлой теме */
.chat-header {
    padding: 15px;
    background-color: #4285f4; /* Синий цвет для заголовка чата в светлой теме */
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    cursor: move;
}

.chat-header h3 {
    margin: 0;
    color: white;
    font-size: 16px;
    font-weight: 500;
}

.chat-close-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    margin: 0;
    width: 24px;
    height: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.chat-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Тело чата с сообщениями */
.chat-body {
    padding: 15px;
    overflow-y: auto;
    flex-grow: 1;
    background-color: #f8f9fa;
}

/* Стили для мобильной версии */
@media (max-width: 480px) {
    .chat-popup {
        width: 90vw;
        max-width: 350px;
        right: 10px;
    }
    
    .chat-bot-container {
        gap: 10px; /* Уменьшаем отступ между кнопками на мобильных */
    }
    
    .chat-bot-button,
    .upload-bot-button {
        width: 50px;
        height: 50px;
    }
    
    .chat-bot-button svg,
    .upload-bot-button svg {
        width: 25px;
        height: 25px;
    }
    
    .upload-popup {
        bottom: 75px; /* Меньший отступ для мобильных */
        right: 10px;
        width: 90vw;
        max-width: 320px;
    }
}

h2 {
    color: #333;
    font-size: 1.8em;
    margin-bottom: 20px;
    font-weight: 500;
    text-align: left;
}

h3 {
    color: #555;
    font-size: 1.3em;
    margin-bottom: 15px;
    font-weight: 500;
    text-align: left;
}

p {
    color: #555;
    font-size: 1em;
    line-height: 1.6;
    margin-bottom: 20px;
}

.file-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
}

.file-item:hover {
    background-color: rgba(66, 133, 244, 0.05);
}

.file-item:last-child {
    border-bottom: none;
}

.file-actions {
    margin-right: 15px;
}

.file-info {
    flex-grow: 1;
    text-align: left;
}

.file-info a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
}

.file-info a:hover {
    color: #4285f4;
    text-decoration: underline;
}

.file-date {
    color: #888;
    font-size: 0.85em;
    margin-left: 10px;
}

input[type="text"], input[type="password"], input[type="email"], input[type="file"] {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

input[type="text"]:focus, input[type="password"]:focus, input[type="email"]:focus {
    border-color: #4285f4;
    outline: none;
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.2);
}

.upload-box {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    background-color: #f9f9f9;
}

.upload-box:hover,
.upload-box.highlight {
    border-color: #2196F3;
    background-color: #e3f2fd;
}

.upload-box svg {
    margin-bottom: 10px;
    color: #2196F3;
}

.upload-box p {
    margin: 10px 0;
    color: #666;
}

/* Кнопка загрузки файлов */
#upload-form button[type="submit"] {
    background-color: #2196F3;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
    margin-top: 10px;
    width: 100%;
}

#upload-form button[type="submit"]:hover {
    background-color: #1976D2;
}

#upload-form button[type="submit"]:disabled {
    background-color: #2196F3;
    opacity: 0.7;
    cursor: not-allowed;
}

/* Прогресс-бар */
.upload-progress {
    width: 100%;
    height: 4px;
    background-color: #e0e0e0;
    border-radius: 4px;
    margin: 10px 0;
    overflow: hidden;
    display: none;
}

.upload-progress-bar {
    height: 100%;
    background-color: #2196F3;
    width: 0;
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* Темная тема */
html[data-theme="dark"] .upload-box {
    background-color: #2a2a2a;
    border-color: #444;
}

html[data-theme="dark"] .upload-box:hover,
html[data-theme="dark"] .upload-box.highlight {
    background-color: #333;
    border-color: #2196F3;
}

html[data-theme="dark"] .upload-box p {
    color: #ccc;
}

html[data-theme="dark"] .upload-progress {
    background-color: #424242;
}

html[data-theme="dark"] .upload-progress-bar {
    background-color: #2196F3;
}

html[data-theme="dark"] #upload-form button[type="submit"] {
    background-color: #2196F3;
}

html[data-theme="dark"] #upload-form button[type="submit"]:hover {
    background-color: #1976D2;
}

html[data-theme="dark"] #upload-form button[type="submit"]:disabled {
    background-color: #2196F3;
    opacity: 0.7;
}

button {
    background-color: #4285f4;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    cursor: pointer;
    margin: 10px 0;
    transition: all 0.3s ease;
    font-weight: 500;
}

button:hover {
    background-color: #3367d6;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

button.delete-btn {
    background-color: #ea4335;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.85em;
}

button.delete-btn:hover {
    background-color: #c82333;
}

button.record-btn {
    background-color: #34a853;
    display: flex;
    align-items: center;
    justify-content: center;
}

button.record-btn:hover {
    background-color: #2d9249;
}

.mic-icon {
    margin-right: 8px;
}

.tg-form {
    display: flex;
    margin-top: 20px;
}

.tg-form input {
    flex-grow: 1;
    margin-right: 10px;
}

footer {
    background-color: #fff;
    color: #777;
    padding: 20px;
    text-align: center;
    width: 100%;
    border-top: 1px solid #eee;
    box-sizing: border-box;
    overflow-x: hidden;
}

footer .container {
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

/* Дополнительные стили для улучшения адаптивности */
input, select, textarea, button {
    font-size: 16px; /* Предотвращает автоматическое масштабирование на iOS */
}

@media (max-width: 768px) {
    .cloud-container {
        grid-template-columns: 1fr;
    }
    
    .container-main {
        padding: 10px;
        width: 100%;
        max-width: 100%;
    }

    header {
        height: 52px; /* Уменьшенная высота на планшетах */
    }
    
    header .container {
        padding: 6px 12px; /* Уменьшаем padding на планшетах */
    }
    
    .search-container {
        margin: 0 12px 0 4px; /* Уменьшаем отступы на мобильных */
    }
    
    .search-box {
        height: 32px; /* Еще меньшая высота на планшетах */
    }
    
    header h1 {
        font-size: 1.3em;
    }
    
    .logo-image {
        width: 32px;
        height: 32px;
        margin-right: 8px;
    }
    
    header nav {
        margin-top: 0;
        width: auto;
    }
    
    header nav ul {
        justify-content: flex-end;
        width: auto;
    }
    
    header nav ul li {
        margin: 0 8px;
    }
    
    header nav ul li a {
        font-size: 0.9em;
        padding: 6px 10px;
    }
    
    .header-logo {
        justify-content: flex-start;
    }
    
    main {
        padding: 15px 10px;
    }
    
    .files-container, .chat-container {
        padding: 15px;
    }
    
    /* В мобильной версии блоки должны идти друг за другом, поэтому отключаем sticky для чата */
    .chat-container {
        position: relative !important;
        top: auto !important;
    }
    
    h2 {
        font-size: 1.5em;
        margin-bottom: 15px;
    }
    
    h3 {
        font-size: 1.2em;
        margin-bottom: 12px;
    }
    
    p {
        font-size: 0.95em;
    }
    
    button {
        padding: 10px 15px;
        font-size: 0.95em;
    }
    
    .file-info {
        font-size: 0.9em;
        word-break: break-word;
    }
    
    .file-date {
        display: block;
        margin-left: 0;
        margin-top: 5px;
        font-size: 0.8em;
    }
    
    .tg-form {
        flex-direction: column;
    }
    
    .tg-form input {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    /* Увеличиваем размеры точек касания для мобильных устройств */
    header nav ul li a,
    .file-info a,
    button,
    .auth-link a {
        padding: 8px 12px;
        display: inline-block;
    }
    
    /* Улучшаем доступность кнопок */
    button, 
    .delete-btn,
    .auth-button {
        min-height: 40px;
    }
    
    input[type="text"], input[type="password"], input[type="email"], input[type="file"] {
        padding: 10px;
        font-size: 0.95em;
    }
    
    footer {
        padding: 15px;
    }
    
    footer p {
        font-size: 0.85em;
    }
}

@media (max-width: 480px) {
    .auth-form-box {
        padding: 20px;
    }

    h2 {
        font-size: 1.5em;
        margin-bottom: 15px;
    }

    h3 {
        font-size: 1.2em;
        margin-bottom: 10px;
    }

    .files-container, .chat-container, .welcome-content {
        padding: 15px;
        margin: 15px 0;
        border-radius: 10px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .chat-controls {
        flex-direction: column;
    }

    button.record-btn {
        width: 100%;
        margin-bottom: 10px;
    }

    .file-item {
        padding: 10px 8px;
        font-size: 13px;
    }

    .file-actions {
        flex-direction: column;
        gap: 5px;
        width: auto;
        min-width: 60px;
    }

    /* Мобильный header */
    header {
        height: 48px; /* Еще меньшая высота на телефонах */
        padding: 0;
    }

    header .container {
        padding: 4px 8px; /* Минимальный padding */
    }

    .search-container {
        margin: 0 8px 0 2px; /* Минимальные отступы */
    }

    .search-box {
        height: 28px; /* Компактная поисковая строка */
        padding: 0 12px;
    }

    #search-input {
        font-size: 14px;
    }

    header h1 {
        font-size: 1.2em;
    }

    .logo-image {
        width: 20px;
        height: 20px;
        margin-right: 6px;
    }

    header nav ul li {
        margin: 0 2px;
    }

    header nav ul li a {
        padding: 6px 8px;
        font-size: 12px;
    }

    .theme-toggle {
        width: 32px;
        height: 32px;
        padding: 4px;
    }

    .sun-icon, .moon-icon {
        width: 16px;
        height: 16px;
    }

    p {
        font-size: 14px;
        line-height: 1.4;
    }

    button {
        font-size: 14px;
        padding: 8px 12px;
    }

    input[type="text"], input[type="password"], input[type="email"], input[type="file"] {
        font-size: 14px;
        padding: 8px;
    }
}

/* Стили для логотипа */
.header-logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
    margin: 0;
    margin-right: 16px;
}

.logo-image {
    width: 40px;
    height: 40px;
    margin-right: 10px;
}

.header-logo h1 {
    margin: 0;
}

.files-container {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 30px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    position: relative;
    width: 100%; /* Добавляю ширину 100% */
}

#files-container {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
    scrollbar-width: thin;
    scrollbar-color: #4285f4 #f1f1f1;
    width: 100%; /* Добавляю ширину 100% */
}

#files-container::-webkit-scrollbar {
    width: 8px;
}

#files-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#files-container::-webkit-scrollbar-thumb {
    background-color: #4285f4;
    border-radius: 4px;
    border: 2px solid #f1f1f1;
}

/* Адаптация для темной темы - кнопка чата синяя */
html[data-theme="dark"] .chat-bot-button {
    background-color: #4285f4; /* Синий цвет для кнопки чата в темной теме */
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .chat-bot-button:hover {
    background-color: #3367d6; /* Более темный синий при наведении в темной теме */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .chat-bot-button svg {
    stroke: white;
}

html[data-theme="dark"] .chat-popup {
    background-color: #1e1e1e;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.4);
    border: 1px solid #333;
}

html[data-theme="dark"] .chat-header {
    background-color: #4285f4; /* Синий цвет для заголовка чата в темной теме */
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .chat-header h3 {
    color: #e8e8e8;
}

html[data-theme="dark"] .chat-close-btn {
    color: #e8e8e8;
}

html[data-theme="dark"] .chat-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

html[data-theme="dark"] .chat-body {
    background-color: #1e1e1e;
}

html[data-theme="dark"] .chat-footer {
    background-color: #1e1e1e;
    border-top: 1px solid #333;
}

html[data-theme="dark"] .chat-footer input {
    background-color: #2a2a2a;
    color: #e8e8e8;
    border: 1px solid #444;
}

html[data-theme="dark"] .chat-footer input:focus {
    border-color: #4285f4;
}

html[data-theme="dark"] .chat-message.user {
    background-color: #3367d6;
    color: #ffffff;
}

html[data-theme="dark"] .chat-message.bot {
    background-color: #2a2a2a;
    color: #e8e8e8;
}

html[data-theme="dark"] .record-status {
    color: #b0b0b0;
}

/* Стили для перетаскиваемого чата в темной теме */
html[data-theme="dark"] .chat-popup.dragging {
    background-color: rgba(30, 30, 30, 0.95);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.theme-toggle {
    padding: 5px;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

.theme-toggle:hover,
.theme-toggle:active,
.theme-toggle:focus {
    background-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Стили для кнопки загрузки файлов - зеленый цвет */
.upload-bot-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #4caf50; /* Зеленый цвет для кнопки загрузки */
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
    border: none;
    z-index: 1001;
    transition: all 0.3s ease;
    overflow: hidden;
}

.upload-bot-button:hover {
    background-color: #3e9142; /* Более темный зеленый при наведении */
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
}

.upload-bot-button:active {
    transform: scale(0.95);
}

/* Улучшаем отображение плюса */
.upload-bot-button svg {
    width: 30px; /* Делаем такого же размера как в кнопке чата */
    height: 30px; /* Делаем такого же размера как в кнопке чата */
    stroke-width: 3; /* Делаем линии толще */
}

/* Стили для окна загрузки */
.upload-popup {
    position: fixed;
    bottom: 105px; /* Увеличиваем отступ снизу */
    right: 30px; /* Выравниваем с контейнером кнопок */
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.25);
    z-index: 1000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    width: 320px;
    max-height: 80vh;
}

/* Анимация при открытии */
.upload-popup.open {
    display: flex;
    opacity: 1;
    transform: translateY(0) scale(1);
    animation: popIn 0.3s ease forwards;
}

/* Стиль для окна в режиме перетаскивания */
.upload-popup.dragging {
    transition: none;
    opacity: 0.95;
    cursor: move;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
    user-select: none;
}

/* Заголовок окна загрузки */
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #4caf50;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    cursor: move;
}

.upload-header h3 {
    margin: 0;
    font-size: 16px;
    color: white;
    font-weight: 500;
}

.upload-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: white;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.upload-close-btn:hover {
    opacity: 0.8;
}

/* Тело окна */
.upload-body {
    padding: 20px;
    overflow-y: auto;
}

/* Область загрузки */
.upload-box {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    background-color: #f9f9f9;
    position: relative;
}

.upload-box:hover,
.upload-box.highlight,
.upload-box.drag-over {
    border-color: #2196F3;
    background-color: #e3f2fd;
    transform: scale(1.02);
}

.upload-box svg {
    margin-bottom: 10px;
    color: #2196F3;
}

.upload-box p {
    margin: 10px 0;
    color: #666;
}

.drag-hint {
    color: #666;
    margin-top: 10px;
    display: block;
    font-size: 0.9em;
}

/* Информация о выбранных файлах */
.selected-file-info {
    margin-top: 10px;
    font-size: 0.9em;
    color: #666;
    text-align: left;
    padding: 5px;
    border-radius: 4px;
    background-color: #f0f0f0;
    display: none;
}

/* Прогресс-бар */
.upload-progress {
    width: 100%;
    height: 4px;
    background-color: #e0e0e0;
    border-radius: 4px;
    margin: 10px 0;
    overflow: hidden;
    display: none;
}

.upload-progress-bar {
    height: 100%;
    background-color: #2196F3;
    width: 0;
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* Темная тема для окна загрузки */
html[data-theme="dark"] .upload-popup {
    background-color: #2a2f36;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .upload-box {
    background-color: #2a2a2a;
    border-color: #444;
}

html[data-theme="dark"] .upload-box:hover,
html[data-theme="dark"] .upload-box.highlight,
html[data-theme="dark"] .upload-box.drag-over {
    background-color: #333;
    border-color: #4caf50;
    transform: scale(1.02);
}

html[data-theme="dark"] .upload-box p {
    color: #ccc;
}

html[data-theme="dark"] .drag-hint {
    color: #aaa;
}

html[data-theme="dark"] .selected-file-info {
    background-color: #333;
    color: #ccc;
}

/* Кнопка загрузки */
#upload-form button[type="submit"] {
    background-color: #2196F3;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
    margin-top: 10px;
    width: 100%;
}

#upload-form button[type="submit"]:hover {
    background-color: #1976D2;
}

#upload-form button[type="submit"]:disabled {
    background-color: #2196F3;
    opacity: 0.7;
    cursor: not-allowed;
}

/* Стили для темной темы */
html[data-theme="dark"] header {
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
}

html[data-theme="dark"] .search-box {
    background-color: #1e1e1e; /* Меняем на цвет как в content-section в темной теме */
    border: 1px solid var(--border-color); /* Добавляем тонкую рамку для отделения от фона */
}

html[data-theme="dark"] .search-box:hover,
html[data-theme="dark"] .search-box:focus-within {
    background-color: #1e1e1e;
    border: 1px solid var(--accent-color); /* Меняем цвет рамки при наведении */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); /* Добавляем легкую тень при наведении */
}

html[data-theme="dark"] .search-icon {
    color: #9aa0a6;
}

html[data-theme="dark"] #search-input {
    color: #e8eaed;
}

html[data-theme="dark"] #search-input::placeholder {
    color: #9aa0a6;
}

html[data-theme="dark"] header nav ul li a {
    color: var(--text-secondary);
}

html[data-theme="dark"] header nav ul li a:hover {
    color: var(--accent-color);
}

html[data-theme="dark"] .theme-toggle:hover {
    background-color: rgba(26, 115, 232, 0.08);
}

/* Стили для уведомлений */
.notification {
    position: relative;
    top: auto;
    right: auto;
    background-color: #fff;
    color: #333;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 999999; /* Очень высокий z-index для отображения поверх всех элементов */
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 400px;
    border-left: 4px solid #4caf50;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    min-width: 250px;
    pointer-events: auto;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification.success {
    border-left-color: #4caf50;
}

.notification.error {
    border-left-color: #f44336;
}

.notification.warning {
    border-left-color: #ff9800;
}

.notification-icon {
    font-size: 18px;
    font-weight: bold;
    color: #4caf50;
    flex-shrink: 0;
}

.notification.error .notification-icon {
    color: #f44336;
}

.notification.warning .notification-icon {
    color: #ff9800;
}

.notification-message {
    flex: 1;
    font-size: 14px;
    word-wrap: break-word;
}

/* Темная тема для уведомлений */
html[data-theme="dark"] .notification {
    background-color: #2a2a2a;
    color: #e8e8e8;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Контейнер для уведомлений */
.notifications-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999999;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

/* Адаптивные стили для уведомлений */
@media (max-width: 768px) {
    .notifications-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .notification {
        max-width: none;
        min-width: auto;
        width: 100%;
        font-size: 13px;
        padding: 12px 16px;
    }
}

@media (max-width: 480px) {
    .notifications-container {
        top: 5px;
        right: 5px;
        left: 5px;
    }
    
    .notification {
        font-size: 12px;
        padding: 10px 14px;
        border-radius: 6px;
    }
    
    .notification-icon {
        font-size: 16px;
    }
}