/* Переменные для светлой темы (по умолчанию) */
:root {
    --bg-color: #f5f7fa;
    --card-bg-color: #ffffff;
    --text-color: #333;
    --text-muted: #777;
    --border-color: #eee;
    --accent-color: #4285f4;
    --accent-hover: #3367d6;
    --chat-user-bg: #e3f2fd;
    --chat-bot-bg: #f1f1f1;
    --header-bg: #ffffff;
    --footer-bg: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.05);
    --loader-bg: rgba(255, 255, 255, 0.85);
}

/* Переменные для темной темы */
html[data-theme="dark"] {
    --bg-color: #121212;
    --card-bg-color: #1e1e1e;
    --text-color: #e8e8e8;
    --text-muted: #b0b0b0;
    --border-color: #333;
    --accent-color: #4285f4;
    --accent-hover: #5294ff;
    --chat-user-bg: #3367d6;
    --chat-bot-bg: #2a2a2a;
    --header-bg: #121212;
    --footer-bg: #121212;
    --shadow-color: rgba(0, 0, 0, 0.2);
    --loader-bg: rgba(18, 18, 18, 0.85);
}

/* Прямые стили для темной темы без CSS-переменных */
html[data-theme="dark"] body {
    background-color: #121212 !important;
    color: #e8e8e8 !important;
}

html[data-theme="dark"] header {
    background-color: #121212 !important;
    box-shadow: none !important;
    border-bottom: none !important;
}

html[data-theme="dark"] footer {
    background-color: #121212 !important;
    color: #b0b0b0 !important;
    border-top: 1px solid #333 !important;
}

html[data-theme="dark"] main {
    background-color: #121212 !important;
}

html[data-theme="dark"] .files-container, 
html[data-theme="dark"] .chat-container {
    background-color: #1e1e1e !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

html[data-theme="dark"] h2, 
html[data-theme="dark"] h3,
html[data-theme="dark"] p {
    color: #e8e8e8 !important;
}

html[data-theme="dark"] .file-item {
    border-bottom: 1px solid #333 !important;
}

html[data-theme="dark"] .file-info a {
    color: #e8e8e8 !important;
}

html[data-theme="dark"] .file-date {
    color: #b0b0b0 !important;
}

html[data-theme="dark"] input[type="text"], 
html[data-theme="dark"] input[type="password"], 
html[data-theme="dark"] input[type="email"] {
    background-color: #1e1e1e !important;
    color: #e8e8e8 !important;
    border: 1px solid #333 !important;
}

/* Цвета кнопок */
html[data-theme="dark"] button:not(.theme-toggle):not(.item-action-btn):not(.restore-btn):not(.delete-permanent-btn):not(.delete-btn):not(.record-btn):not(.upload-btn):not(.storage-upgrade-btn):not(.action-btn):not(.modal-close):not(.btn-primary):not(.btn-cancel):not(.btn-danger):not(.upload-bot-button):not(.upload-close-btn):not(.chat-bot-button):not(.chat-close-btn) {
    background-color: transparent !important;
    border: 1px solid #333 !important;
    color: #e8e8e8 !important;
}

html[data-theme="dark"] button:not(.theme-toggle):not(.item-action-btn):not(.restore-btn):not(.delete-permanent-btn):not(.delete-btn):not(.record-btn):not(.upload-btn):not(.storage-upgrade-btn):not(.action-btn):not(.modal-close):not(.btn-primary):not(.btn-cancel):not(.btn-danger):not(.upload-bot-button):not(.upload-close-btn):not(.chat-bot-button):not(.chat-close-btn):hover {
    background-color: rgba(66, 133, 244, 0.1) !important;
    border-color: #4285f4 !important;
}

/* Переопределение стилей кнопки переключения темы */
html[data-theme="dark"] button.theme-toggle {
    background-color: transparent !important;
    box-shadow: none !important;
    background-image: none !important;
    border: none !important;
}

html[data-theme="dark"] button.theme-toggle:hover,
html[data-theme="dark"] button.theme-toggle:active,
html[data-theme="dark"] button.theme-toggle:focus {
    background-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    background-image: none !important;
    border: none !important;
}

/* Сохраняем зеленый цвет кнопки "Записать" в темной теме */
html[data-theme="dark"] button.record-btn,
button.record-btn {
    background-color: #34a853 !important;
}

html[data-theme="dark"] button.record-btn:hover,
button.record-btn:hover {
    background-color: #2d9249 !important;
}

/* Сохраняем красный цвет кнопки удаления в темной теме */
html[data-theme="dark"] button.delete-btn,
button.delete-btn {
    background-color: #ea4335 !important;
}

html[data-theme="dark"] button.delete-btn:hover,
button.delete-btn:hover {
    background-color: #d33426 !important;
}

html[data-theme="dark"] .upload-box {
    border: 2px dashed #333 !important;
}

html[data-theme="dark"] #chat-history {
    background-color: #1e1e1e !important;
    border: 1px solid #333 !important;
}

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

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

html[data-theme="dark"] .loader-overlay {
    background-color: rgba(18, 18, 18, 0.85) !important;
}

html[data-theme="dark"] .loader-text {
    color: #4285f4 !important;
}

/* Стили для переключателя темы */
.theme-toggle {
    background-color: transparent !important;
    border: none !important;
    cursor: pointer;
    padding: 8px;
    margin: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    /* Полное удаление всех эффектов */
    box-shadow: none !important;
    outline: none !important;
}

html[data-theme="dark"] .theme-toggle:hover {
    /* Полное удаление всех эффектов при наведении */
    background-color: transparent !important;
    box-shadow: none !important;
}

.theme-toggle:hover {
    /* Полное удаление всех эффектов при наведении */
    background-color: transparent !important;
    box-shadow: none !important;
}

.sun-icon, .moon-icon {
    position: absolute;
    transition: transform 0.5s ease, opacity 0.5s ease;
    /* Убедимся, что иконки всегда видны */
    z-index: 5;
}

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

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

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

html[data-theme="dark"] .moon-icon {
    opacity: 1;
    transform: translateY(0) rotate(0);
    color: #e8e8e8 !important;
}

/* Дополнительные стили для темной темы */
html[data-theme="dark"] header h1 {
    color: #4285f4 !important;
}

html[data-theme="dark"] header a {
    color: #b0b0b0 !important;
}

html[data-theme="dark"] header a:hover {
    color: #4285f4 !important;
    background-color: rgba(66, 133, 244, 0.1) !important;
}

/* Стили для главной страницы */
html[data-theme="dark"] .welcome-content {
    background-color: #1e1e1e !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

html[data-theme="dark"] .welcome-content h1 {
    color: #e8e8e8 !important;
}

html[data-theme="dark"] .welcome-content p {
    color: #b0b0b0 !important;
}

html[data-theme="dark"] .btn-secondary {
    background-color: #333 !important;
    color: #e8e8e8 !important;
}

html[data-theme="dark"] .btn-secondary:hover {
    background-color: #444 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2) !important;
}

/* Стили для форм авторизации */
html[data-theme="dark"] .auth-container {
    background-color: #121212 !important;
}

html[data-theme="dark"] .auth-form-box {
    background-color: #1e1e1e !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2) !important;
}

html[data-theme="dark"] .auth-form-box h2 {
    color: #e8e8e8 !important;
}

html[data-theme="dark"] .form-group label {
    color: #b0b0b0 !important;
}

html[data-theme="dark"] .help-text,
html[data-theme="dark"] .strength-text,
html[data-theme="dark"] .password-requirements {
    color: #b0b0b0 !important;
}

html[data-theme="dark"] .form-group input {
    background-color: #333 !important;
    border-color: #444 !important;
    color: #e8e8e8 !important;
}

html[data-theme="dark"] .form-group input:focus {
    border-color: #4285f4 !important;
    background-color: #333 !important;
}

html[data-theme="dark"] .auth-link {
    color: #b0b0b0 !important;
}

html[data-theme="dark"] .auth-divider {
    color: #b0b0b0 !important;
}

html[data-theme="dark"] .strength-bar-container {
    background-color: #333 !important;
}

/* Стили для сообщения об ошибке */
html[data-theme="dark"] .form-error-message {
    background-color: rgba(211, 47, 47, 0.2) !important;
    color: #ff6b6b !important;
    border-left: 3px solid #d32f2f !important;
}

html[data-theme="dark"] .error-message {
    color: #ff6b6b !important;
}

/* Стили для анимации волны */
.theme-wave-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
    overflow: hidden;
    visibility: hidden;
    max-width: 100vw; /* Ограничение максимальной ширины */
}

.theme-wave {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    transition: transform 1s ease-out;
}

.theme-wave.active {
    animation: wave-animation 1s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

@keyframes wave-animation {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 1;
    }
}

/* Адаптивные стили для переключателя темы */
@media (max-width: 768px) {
    .theme-toggle {
        padding: 10px;
        background-color: transparent !important;
        box-shadow: none !important;
    }
}

/* Убедимся, что кнопка не имеет синего фона при нажатии и не отбрасывает тень */
button.theme-toggle {
    background-color: transparent !important;
    box-shadow: none !important;
}

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

/* Полностью перекрываем стили кнопок в темной теме */
html[data-theme="dark"] button.delete-btn,
html[data-theme="dark"] button.delete-permanent-btn,
html[data-theme="dark"] button.restore-btn {
    background-color: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 6px !important;
    margin: 0 !important;
}

html[data-theme="dark"] button.delete-btn:hover,
html[data-theme="dark"] button.delete-permanent-btn:hover {
    background-color: rgba(255, 59, 48, 0.15) !important;
    box-shadow: none !important;
}

html[data-theme="dark"] button.restore-btn:hover {
    background-color: rgba(52, 199, 89, 0.15) !important;
    box-shadow: none !important;
}

/* Стили для поискового поля в темной теме */
html[data-theme="dark"] .search-box {
    background-color: #303134 !important; /* Темно-серый цвет для темной темы */
    border-color: transparent !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important; /* Всегда показывать легкую тень в темной теме */
}

html[data-theme="dark"] .search-box:hover,
html[data-theme="dark"] .search-box:focus-within {
    background-color: #303134 !important; /* Оставляем тот же цвет при наведении */
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.5) !important;
}

html[data-theme="dark"] .search-icon {
    color: #9aa0a6 !important; /* Светло-серый цвет для иконки в темной теме */
}

html[data-theme="dark"] #search-input {
    color: #e8eaed !important; /* Светлый цвет текста для темной темы */
    background-color: transparent !important; /* Явно указываем прозрачный фон */
}

html[data-theme="dark"] #search-input::placeholder {
    color: #9aa0a6 !important; /* Светло-серый цвет для плейсхолдера в темной теме */
}

/* Стили для шапки в светлой теме */
header {
    border-bottom: none !important; /* Убираем границу снизу */
    box-shadow: none !important; /* Убираем тень */
}

/* Специальные стили для item-action-btn в темной теме */
html[data-theme="dark"] .item-action-btn {
    background-color: transparent !important;
    color: #9aa0a6 !important;
}

html[data-theme="dark"] .item-action-btn:hover {
    background-color: rgba(66, 133, 244, 0.1) !important; /* Легкий голубой фон при наведении */
    color: #5294ff !important; /* Голубой цвет иконки при наведении */
}

/* Сохраняем зеленый цвет кнопки загрузки файлов в темной теме */
html[data-theme="dark"] button.upload-btn,
html[data-theme="dark"] .upload-btn {
    background-color: #34a853 !important;
    color: white !important;
    border: none !important;
}

html[data-theme="dark"] button.upload-btn:hover,
html[data-theme="dark"] .upload-btn:hover {
    background-color: #2d9249 !important;
}

/* Стили для кнопки увеличения хранилища в темной теме */
html[data-theme="dark"] .storage-upgrade-btn {
    background: none !important;
    border: 1px solid #333 !important;
    color: #e8e8e8 !important;
}

html[data-theme="dark"] .storage-upgrade-btn:hover {
    background-color: rgba(66, 133, 244, 0.1) !important;
    border-color: #4285f4 !important;
    color: #4285f4 !important;
}

/* Стили для кнопок модальных окон в темной теме */
html[data-theme="dark"] .modal-close {
    background: none !important;
    border: none !important;
    color: #e8e8e8 !important;
}

html[data-theme="dark"] .modal-close:hover {
    background-color: rgba(66, 133, 244, 0.1) !important;
    color: #4285f4 !important;
}

html[data-theme="dark"] .btn-primary {
    background-color: #4285f4 !important;
    color: white !important;
    border: none !important;
}

html[data-theme="dark"] .btn-primary:hover {
    background-color: #5294ff !important;
}

html[data-theme="dark"] .btn-cancel {
    background-color: transparent !important;
    border: 1px solid #333 !important;
    color: #e8e8e8 !important;
}

html[data-theme="dark"] .btn-cancel:hover {
    background-color: rgba(66, 133, 244, 0.1) !important;
    border-color: #4285f4 !important;
    color: #4285f4 !important;
}

html[data-theme="dark"] .btn-danger {
    background-color: #ea4335 !important;
    color: white !important;
    border: none !important;
}

html[data-theme="dark"] .btn-danger:hover {
    background-color: #d33426 !important;
}

/* Сохраняем зеленый цвет кнопки с плюсиком в темной теме */
html[data-theme="dark"] .upload-bot-button {
    background-color: #4caf50 !important;
    color: white !important;
    border: none !important;
}

html[data-theme="dark"] .upload-bot-button:hover {
    background-color: #3e9142 !important;
}

/* Стили для кнопки закрытия окна загрузки в темной теме */
html[data-theme="dark"] .upload-close-btn {
    background: none !important;
    border: none !important;
    color: white !important;
}

html[data-theme="dark"] .upload-close-btn:hover {
    opacity: 0.8 !important;
} 