/* Основные стили */
body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background: linear-gradient(120deg, #264653 0%, #2a9d8f 100%);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #264653;
    flex-direction: column;
}

/* Заголовки */
h1 {
    color: #2c3e50;
    text-align: center;
    font-size: 2.5em;
    margin-bottom: 30px;
    font-weight: 600;
}

/* Контейнеры */
.header {
    position: relative;
    top: 0;
    margin-bottom: 20px;
    width: 100%;
    text-align: center;
}

.button-container {
    position: absolute;
    top: 150px;
    width: 100%;
    text-align: center;
}

/* Кнопки */
.btn {
    display: inline-block;
    padding: 12px 30px;
    margin: 10px;
    font-size: 16px;
    color: #fff;
    background: linear-gradient(135deg, #2a9d8f 0%, #264653 100%);
    text-decoration: none;
    border-radius: 25px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(0,0,0,0.2);
    background: linear-gradient(135deg, #264653 0%, #2a9d8f 100%);
}

/* Формы */
form {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    position: relative;
}

.form-group {
    margin-bottom: 25px;
    position: relative;
}

.form-group label {
    position: absolute;
    left: 15px;
    top: -10px;
    background: white;
    padding: 0 8px;
    color: #2c3e50;
    font-weight: 500;
    font-size: 0.9em;
    border-radius: 4px;
    z-index: 1;
}

/* Поля ввода */
input[type="email"],
input[type="password"],
input[type="text"] {
    width: 100%;
    padding: 15px;
    padding-top: 20px;
    border: 2px solid #e1e8f0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.9);
}

input[type="email"]:focus,
input[type="password"]:focus,
input[type="text"]:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

input[type="email"]::placeholder,
input[type="password"]::placeholder,
input[type="text"]::placeholder {
    color: transparent;
}

/* Ссылки */
.links {
    margin-top: 25px;
    text-align: center;
}

.links a {
    color: #667eea;
    text-decoration: none;
    font-size: 0.9em;
    margin: 0 10px;
    transition: color 0.3s ease;
}

.links a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Сообщения об ошибках */
.error-message {
    color: #e74c3c;
    font-size: 0.9em;
    margin-top: 5px;
    text-align: center;
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

form, .btn {
    animation: fadeIn 0.5s ease-out;
}

/* Адаптивность */
@media (max-width: 480px) {
    form {
        padding: 20px;
        margin: 0 15px;
    }

    h1 {
        font-size: 2em;
    }

    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

.auth-container {
    width: 100%;
    max-width: 400px;
    margin: 80px auto 0; /* Добавляем отступ сверху для учета хедера */
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.header {
    position: relative;
    top: 0;
    margin-bottom: 20px;
    width: 100%;
    text-align: center;
}

.header h1 {
    margin: 0;
    color: #2c3e50;
    font-size: 2.2em;
}

form {
    margin: 0;
    width: 100%;
}

.links {
    margin-top: 20px;
    width: 100%;
    text-align: center;
}

.logout-container {
    text-align: right;
    padding: 10px;
}

.logout-container .btn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 25px;
    padding: 10px 20px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.logout-container .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(0,0,0,0.2);
    background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
}

/* Стили для контейнера в левом верхнем углу */
.top-left-container {
    position: fixed;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.logout-container .btn, .textbook-dropdown select {
    margin: 0;
    padding: 5px 10px;
    font-size: 14px;
    border-radius: 5px;
    background-color: #e74c3c;
    color: white;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.logout-container .btn:hover {
    background-color: #c0392b;
}

.textbook-dropdown select {
    background-color: #f8f9fa;
    color: #333;
    border: 1px solid #ddd;
}

.send-btn {
    background: linear-gradient(135deg, #e76f51 0%, #f4a261 100%);
    border: none;
    border-radius: 8px;
    padding: 0 20px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    font-size: 14px;
    min-width: 100px;
}

.send-btn:hover {
    background: linear-gradient(135deg, #f4a261 0%, #e76f51 100%);
    transform: translateY(-1px);
}

.new-chat-btn {
    width: 100%; /* Ширина кнопки по ширине контейнера */
    margin-bottom: 10px; /* Отступ снизу */
    padding: 10px 20px;
    background-color: #e76f51; /* Красный цвет */
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.new-chat-btn:hover {
    background-color: #f4a261;
}

.chat-box {
    position: relative; /* Для позиционирования кнопки "Новый чат" */

}

select {
    padding: 5px 10px;
    font-size: 14px;
    border-radius: 5px;
    background-color: #f8f9fa;
    color: #333;
    border: 1px solid #ddd;
    transition: background-color 0.3s ease;
}

select:hover {
    background-color: #e9ecef;
}

.main-container {
    flex: 1;
    display: flex;
    padding-top: 80px;
    min-height: calc(100vh - 100px);
    width: 100%;
    gap: 20px;
    padding: 20px;
    max-width: 1800px;
    margin: 0 auto;
}

.contents-container {
    width: 300px;
    padding: 20px;
    margin-top: 60px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(42, 157, 143, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    height: calc(100vh - 100px);
    overflow-y: auto;
    box-sizing: border-box;
    position: relative;
}

.chat-container {
    flex: 1;
    padding: 20px;
    margin-top: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.paragraph-info {
    width: 100%;
    max-width: 800px;
    margin-bottom: 15px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(42, 157, 143, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    font-size: 15px;
    color: #264653;
}

.chat-box {
    width: 100%;
    max-width: 800px;
    height: 100%;
    background: rgba(255, 255, 255, 0.75);
    border-radius: 16px;
    border: 1px solid rgba(42, 157, 143, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.messages-area {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-height: calc(100vh - 300px); /* Ограничиваем максимальную высоту */
    min-height: 400px; /* Устанавливаем минимальную высоту */
    /* Стили для скроллбара */
    scrollbar-width: thin; /* для Firefox */
    scrollbar-color: #2a9d8f #f0f0f0; /* для Firefox */
}

/* Стили для скроллбара (WebKit browsers) */
.messages-area::-webkit-scrollbar {
    width: 8px;
}

.messages-area::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

.messages-area::-webkit-scrollbar-thumb {
    background: #2a9d8f;
    border-radius: 4px;
}

.messages-area::-webkit-scrollbar-thumb:hover {
    background: #264653;
}

.message-input-container {
    display: flex;
    gap: 8px;
    align-items: center;
}

#message-input {
    flex: 1;
    padding: 14px 18px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    font-size: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    resize: none;
    overflow-y: auto;  // Добавляем вертикальную прокрутку
    min-height: 45px;
    max-height: 150px;
    line-height: 1.5;
    white-space: nowrap;
    overflow-x: hidden;
    transition: height 0.15s ease-out;
    width: 100%;
    box-sizing: border-box;
}

#message-input.multiline {
    white-space: pre-wrap;
}

#message-input:focus {
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.input-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Обновляем стили для загрузки файлов */
.file-upload {
    display: flex;
    align-items: center;
}

/* Обновляем стили для иконки скрепки */
.attachment-icon {
    width: 24px;
    height: 24px;
    transform: rotate(45deg);
}

.file-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 8px;
    background: transparent;
    color: #2a9d8f;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #2a9d8f;
}

.file-upload-label:hover {
    transform: translateY(-1px);
    background: rgba(42, 157, 143, 0.1);
    color: #264653;
    border-color: #264653;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .attachment-icon {
        width: 20px;
        height: 20px;
    }
}

/* Обновляем стили для кнопки отправки */
.send-btn {
    background: linear-gradient(135deg, #e76f51 0%, #f4a261 100%);
    border: none;
    border-radius: 8px;
    padding: 0 20px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    font-size: 14px;
    min-width: 100px;
}

.send-btn:hover {
    background: linear-gradient(135deg, #f4a261 0%, #e76f51 100%);
    transform: translateY(-1px);
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .file-upload-label {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .send-btn {
        min-width: 80px;
        height: 40px;
        padding: 0 15px;
    }
}

.action-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
    min-height: 32px;
    margin-bottom: 16px;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 4px;
    padding: 4px 8px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #ffffff;
    background: linear-gradient(135deg, #2a9d8f 0%, #264653 100%);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    font-weight: 600;
    height: 32px;
}

.action-btn:hover {
    background: linear-gradient(135deg, #264653 0%, #2a9d8f 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.25);
}

.btn-icon {
    font-size: 16px;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .message-input-container {
        flex-wrap: nowrap;
    }
    
    .action-buttons {
        flex-direction: row;
        width: 100%;
    }
    
    .action-btn {
        flex: 1;
        justify-content: center;
        padding: 3px 6px;
        font-size: 13px;
        height: 28px;
    }
    
    .btn-icon {
        font-size: 14px;
    }
}

#contents-list {
    list-style-type: none;
    padding: 0;
}

#contents-list li {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 4px 0;
    transition: all 0.2s ease;
    border: none;
}

#contents-list li:hover {
    background-color: rgba(42, 157, 143, 0.1);
}

#contents-list > li {
    font-size: 15px;
    font-weight: 600;
    color: #2d3748;
    margin-top: 16px;
}

.textbook-dropdown {
    width: 100%;
    margin-bottom: 20px;
    box-sizing: border-box;
}

.textbook-dropdown label {
    display: block;
    margin-bottom: 8px;
    color: #264653;
    font-weight: 500;
}

.selected-textbook {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    color: #2d3748;
    line-height: 1.4;
    word-wrap: break-word;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.selected-book-cover {
    width: 60px;
    height: 80px;
    flex-shrink: 0;
}

.selected-book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.selected-book-info {
    flex: 1;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .selected-book-cover {
        width: 45px;
        height: 60px;
    }
}

.textbook-dropdown select {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background-color: white;
    font-size: 14px;
    color: #2d3748;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.textbook-dropdown select:hover {
    border-color: #cbd5e0;
}

#textbook-select option {
    white-space: normal;
    word-wrap: break-word;
}

.saved-chats-container {
    width: 300px;
    padding: 20px;
    margin-top: 60px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(42, 157, 143, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    height: calc(100vh - 100px);
    overflow-y: auto;
    box-sizing: border-box;
}

#saved-chats-list {
    list-style-type: none;
    padding: 0;
}

#saved-chats-list li {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 4px 0;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: none;
}

#saved-chats-list li:hover {
    background-color: #f1f5f9;
}

/* Стили для сообщений чата */
.message {
    padding: 16px 20px;
    border-radius: 18px 18px 4px 18px;
    max-width: 85%;
    word-wrap: break-word;
    line-height: 1.5;
    position: relative;
    animation: messageAppear 0.3s ease-out;
}

/* Анимация появления сообщения */
@keyframes messageAppear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Стили для сообщений пользователя */
.user-message {
    background: linear-gradient(135deg, #2a9d8f 0%, #264653 100%);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 132, 255, 0.2);
}

/* Стили для сообщений ChatGPT */
.chatgpt-message {
    background: #fff;
    border: 1px solid #e9c46a;
    border-radius: 18px 18px 18px 4px;
    color: #264653;
    align-self: flex-start;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Метки отправителя */
.message::before {
    content: attr(data-sender);
    position: absolute;
    top: -20px;
    font-size: 0.8em;
    color: #666;
}

.user-message::before {
    right: 10px;
}

.chatgpt-message::before {
    left: 10px;
}

/* Стили для кода в сообщениях */
.chatgpt-message pre {
    background-color: #2d2d2d;
    color: #f8f8f2;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 10px 0;
}

.chatgpt-message code {
    font-family: 'Fira Code', monospace;
    font-size: 0.9em;
}

/* Стили для ссылок в сообщениях */
.message a {
    color: inherit;
    text-decoration: underline;
}

.user-message a {
    color: white;
}

.chatgpt-message a {
    color: #0084ff;
}

.summary-message {
    background-color: #f0f8ff;
    color: #333;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
    font-weight: bold;
    text-align: center;
}

.chat-options {
    position: relative;
    display: inline-block;
}

.options-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 0 5px;
}

.options-menu {
    display: none;
    position: absolute;
    right: 0;
    background-color: white;
    border: 1px solid #ddd;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.options-menu button {
    display: block;
    width: 100%;
    padding: 10px;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
}

.options-menu button:hover {
    background-color: #f0f0f0;
}

.chat-options:hover .options-menu {
    display: block;
}

.predefined-buttons {
    display: flex;
    gap: 10px;
}

.explain-btn, .example-btn {
    display: none; /* По умолчанию скрыты */
}

/* Анимация солнечного блика */
@keyframes sunGlare {
    0% {
        background: linear-gradient(135deg, #ffd700 0%, #ffa500 50%, #daa520 100%);
    }
    50% {
        background: linear-gradient(135deg, 
            rgba(255, 255, 255, 0.9) 0%,
            #ffd700 30%,
            #ffa500 60%,
            #daa520 100%
        );
    }
    100% {
        background: linear-gradient(135deg, #ffd700 0%, #ffa500 50%, #daa520 100%);
    }
}

/* Анимация сияния */
@keyframes glowing {
    0% {
        box-shadow: 0 0 2px #ffd700,
                   0 0 4px #ffd700,
                   0 0 6px #ffa500,
                   inset 0 0 3px rgba(255, 255, 255, 0.2);
    }
    50% {
        box-shadow: 0 0 8px #ffd700,
                   0 0 12px #ffd700,
                   0 0 15px #ffa500,
                   inset 0 0 8px rgba(255, 255, 255, 0.4);
    }
    100% {
        box-shadow: 0 0 2px #ffd700,
                   0 0 4px #ffd700,
                   0 0 6px #ffa500,
                   inset 0 0 3px rgba(255, 255, 255, 0.2);
    }
}

/* Анимация горизонтального переливания */
@keyframes horizontalShimmer {
    0% {
        background: linear-gradient(90deg, 
            #ffd700 0%, 
            #ffa500 25%, 
            #daa520 50%,
            #ffa500 75%,
            #ffd700 100%
        );
        background-size: 200% 100%;
        background-position: 0% 0;
    }
    100% {
        background: linear-gradient(90deg, 
            #ffd700 0%, 
            #ffa500 25%, 
            #daa520 50%,
            #ffa500 75%,
            #ffd700 100%
        );
        background-size: 200% 100%;
        background-position: -200% 0;
    }
}

.start-explanation-btn {
    display: none; /* Скрываем кнопку по умолчанию */
    min-width: 180px;
    background: linear-gradient(90deg, 
        #e9c46a 0%, 
        #f4a261 25%, 
        #e76f51 50%,
        #f4a261 75%,
        #e9c46a 100%
    );
    background-size: 200% 100%;
    color: #264653;
    font-weight: 700;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5);
    box-shadow: 0 1px 3px rgba(218, 165, 32, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: horizontalShimmer 3s linear infinite;
}

/* Создаем постоянный эффект свечения при наведении */
.start-explanation-btn:hover {
    transform: translateY(-1px);
    animation: none;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.9) 0%,
        #e9c46a 30%,
        #f4a261 60%,
        #e76f51 100%
    );
    box-shadow: 
        0 0 2px #ffd700,
        0 0 4px #ffd700,
        0 0 6px #ffa500,
        inset 0 0 3px rgba(255, 255, 255, 0.2);
    cursor: pointer;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .explain-btn, .example-btn {
        min-width: 130px;
        font-size: 13px;
        height: 28px;
    }
    
    .start-explanation-btn {
        min-width: 150px;
    }
}

/* Анимация появления кнопок */
@keyframes buttonAppear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.button-appear {
    animation: buttonAppear 0.3s ease-out forwards;
}

/* Стили для математических формул */
.katex-display {
    margin: 1.5em 0;
    padding: 1em;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.katex {
    font-size: 1.1em;
    text-align: center;
}

.katex-html {
    overflow-x: auto;
    overflow-y: hidden;
}

/* Для мобильных устройств */
@media (max-width: 768px) {
    .katex {
        font-size: 1em;
    }
    
    .katex-display {
        font-size: 0.9em;
        padding: 0.3em 0;
    }
}

.term {
    text-decoration: none;
    border-bottom: 1px dashed currentColor;
    cursor: pointer;
    position: relative;
    display: inline;
}

.definition {
    display: none;
    position: absolute;
    left: -9999px;
    top: -9999px;
}

.tooltip {
    position: absolute;
    background-color: #fff;
    border: 1px solid #ddd;
    padding: 5px 10px; /* Изменяем отступы для приплюснутой формы */
    border-radius: 20px; /* Закруглённые края */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-width: 60px; /* Ширина кнопки */
    max-height: 30px; /* Высота кнопки */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    animation: fadeIn 0.2s ease-in-out;
}

.quote-icon {
    font-size: 18px;
    color: #333;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Стили для шапки сайта */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 65px; /* Добавляем фиксированную высоту */
    background: rgba(38, 70, 83, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex; /* Добавляем flex для вертикального центрирования */
    align-items: center; /* Центрируем содержимое по вертикали */
}

/* Обновляем padding для header-container */
.header-container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo h1 {
    margin: 0;
    font-size: 1.8em;
    cursor: pointer;
}

.logo-link {
    text-decoration: none;
    color: inherit;
    background: linear-gradient(135deg, #e9c46a 0%, #f4a261 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: opacity 0.3s ease;
}

.logo-link:hover {
    opacity: 0.8;
}

.main-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    padding: 0;
    margin: 0;
    list-style: none;
}

.main-nav a {
    text-decoration: none;
    color: #ffffff;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 1em;
}

.main-nav a:hover {
    background-color: rgba(233, 196, 106, 0.2);
}

.user-menu {
    position: relative;
}

.user-menu-trigger {
    color: #ffffff; /* Белый цвет текста */
    cursor: pointer;
    padding: 8px 20px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.user-menu-trigger:hover {
    background-color: rgba(233, 196, 106, 0.2); /* Легкий фон при наведении */
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #264653; /* Цвет фона выпадающего меню */
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 8px 0;
    min-width: 150px;
}

.user-menu:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 8px 16px;
    color: #ffffff; /* Белый цвет текста */
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.dropdown-menu a:hover {
    background-color: #2a9d8f; /* Цвет фона при наведении */
}

.logout-link {
    color: #e76f51 !important;
}

.logout-link:hover {
    background-color: rgba(231, 111, 81, 0.1) !important;
}

/* Обновляем медиа-запрос для мобильных устройств */
@media (max-width: 768px) {
    .site-header {
        height: auto; /* На мобильных убираем фиксированную высоту */
        min-height: 65px; /* Задаем минимальную высоту */
        padding: 10px 0;
    }
    
    .header-container {
        flex-direction: column;
    }
    
    .logo h1 {
        margin-bottom: 10px;
    }

    .main-nav a {
        font-size: 0.95em;
        padding: 6px 16px;
    }
}

/* Стили для страницы приветствия */
.welcome-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    background: linear-gradient(120deg, #264653 0%, #2a9d8f 100%);
}

.welcome-content {
    max-width: 1200px;
    width: 100%;
    text-align: center;
    color: #fff;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.welcome-header {
    margin-bottom: 60px;
}

.welcome-header h1 {
    font-size: 3.5em;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #e9c46a 0%, #f4a261 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.welcome-subtitle {
    font-size: 1.5em;
    color: #e9c46a;
    margin-bottom: 40px;
}

.welcome-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
    padding: 0 20px;
}

.feature-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 15px;
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-card i {
    font-size: 2.5em;
    color: #e9c46a;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 1.5em;
    margin-bottom: 15px;
    color: #f4a261;
}

.feature-card p {
    color: #fff;
    line-height: 1.6;
}

.welcome-cta {
    margin-top: 40px;
}

.cta-button {
    display: inline-block;
    padding: 15px 40px;
    margin: 0 10px;
    border-radius: 30px;
    font-size: 1.2em;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.cta-button.primary {
    background: linear-gradient(135deg, #e9c46a 0%, #f4a261 100%);
    color: #264653;
}

.cta-button.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 2px solid #e9c46a;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.cta-button.primary:hover {
    background: linear-gradient(135deg, #f4a261 0%, #e9c46a 100%);
}

.cta-button.secondary:hover {
    background: rgba(233, 196, 106, 0.2);
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .welcome-header h1 {
        font-size: 2.5em;
    }

    .welcome-subtitle {
        font-size: 1.2em;
    }

    .welcome-features {
        grid-template-columns: 1fr;
    }

    .cta-button {
        display: block;
        margin: 10px auto;
        max-width: 80%;
    }
}

.nav-btn {
    padding: 8px 20px;
    border-radius: 20px;
    transition: all 0.3s ease;
    text-decoration: none;
    font-weight: 500;
}

.nav-btn:hover {
    transform: translateY(-2px);
}

.nav-btn.register {
    background: linear-gradient(135deg, #2a9d8f 0%, #264653 100%);
    color: white;
    margin-left: 10px;
}

.nav-btn.register:hover {
    background: linear-gradient(135deg, #264653 0%, #2a9d8f 100%);
}

/* Стили для страницы выбора учебника */
.textbook-selection-container {
    min-height: calc(100vh - 100px);
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 20px 20px;
    box-sizing: border-box;
}

.grade-section {
    scroll-margin-top: 150px; /* Добавляем отступ для плавного скролла */
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.grade-title {
    color: #264653;
    font-size: 1.8em;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #2a9d8f;
}

.textbooks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    width: 100%;
}

.textbook-card {
    display: flex;
    background: white;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
    height: 255px;
    box-sizing: border-box;
    overflow: hidden;
}

.textbook-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.textbook-cover-container {
    width: 120px;
    height: 150px;
    margin-right: 15px;
    flex-shrink: 0;
}

.textbook-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.textbook-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Распределяем пространство между элементами */
}

.textbook-name {
    font-size: 1em;
    color: #2196f3;
    margin-bottom: 8px;
    font-weight: 600;
    text-decoration: none;
}

.textbook-details {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 10px;
}

.textbook-details p {
    margin: 4px 0;
    line-height: 1.2;
}

.textbook-card form {
    margin: 0; /* Убираем отступы у формы */
    padding: 0;
    width: auto; /* Убираем фиксированную ширину */
    background: none; /* Убираем фоновый цвет */
    box-shadow: none; /* Убираем тень */
}

.select-btn {
    padding: 8px 12px;
    font-size: 0.85em;
    background: linear-gradient(135deg, #2a9d8f 0%, #264653 100%);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: auto;
}

.select-btn:hover {
    background: linear-gradient(135deg, #264653 0%, #2a9d8f 100%);
}

@media (max-width: 768px) {
    .textbooks-grid {
        grid-template-columns: 1fr;
    }
    
    .textbook-card {
        height: auto;
        min-height: 180px;
    }
}

/* Стили для кнопки выбора учебника */
.select-textbook-btn {
    width: 100%;
    padding: 12px 20px;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #2a9d8f 0%, #264653 100%);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.select-textbook-btn:hover {
    background: linear-gradient(135deg, #264653 0%, #2a9d8f 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Стили для панели с кнопками классов */
.grade-buttons {
    position: sticky;
    top: 80px;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 12px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    z-index: 100;
}

.grade-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #2a9d8f 0%, #264653 100%);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.grade-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(42, 157, 143, 0.2);
    background: linear-gradient(135deg, #264653 0%, #2a9d8f 100%);
}

.grade-btn.active {
    background: linear-gradient(135deg, #e9c46a 0%, #f4a261 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(233, 196, 106, 0.3);
}

/* Стили для поисковой строки */
.search-container {
    margin-bottom: 20px;
    padding: 0 10px;
}

.search-input {
    width: 100%;
    padding: 12px 20px;
    font-size: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background-color: white;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #2a9d8f;
    box-shadow: 0 0 0 3px rgba(42, 157, 143, 0.1);
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .grade-buttons {
        padding: 10px;
        gap: 5px;
    }

    .grade-btn {
        padding: 8px 15px;
        min-width: 80px;
        font-size: 14px;
    }

    .search-input {
        font-size: 14px;
        padding: 10px 15px;
    }
}

/* Стили для кнопок навигации */
.navigation-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    justify-content: flex-start;
    padding: 0 10px;
}

.nav-btn {
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    color: white;
}

.nav-btn.back {
    background: linear-gradient(135deg, #264653 0%, #2a9d8f 100%);
}

.nav-btn.chat {
    background: linear-gradient(135deg, #e9c46a 0%, #f4a261 100%);
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Обновляем отступ для контейнера */
.textbook-selection-container {
    padding: 80px 20px 20px;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .navigation-buttons {
        flex-direction: row;
        padding: 0 5px;
    }
    
    .nav-btn {
        padding: 8px 15px;
        font-size: 14px;
    }
}

/* Стили для выпадающего списка выбора класса */
.grade-select-container {
    margin: 20px 0;
    padding: 0 10px;
}

.grade-select {
    width: 100%;
    max-width: 300px;
    padding: 12px 20px;
    font-size: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background-color: white;
    transition: all 0.3s ease;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%23264653' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.grade-select:focus {
    outline: none;
    border-color: #2a9d8f;
    box-shadow: 0 0 0 3px rgba(42, 157, 143, 0.1);
}

.grade-select option {
    padding: 12px;
    font-size: 16px;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .grade-select {
        font-size: 14px;
        padding: 10px 15px;
    }
    
    .grade-select option {
        padding: 10px;
        font-size: 14px;
    }
}

.alert {
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
}

.alert-error {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.alert-success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.page-title {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 2em;
}

.textbook-cover {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 10px;
    object-fit: cover;
}

/* Стили для загрузки файлов */
.file-upload {
    margin-right: 10px;
}

.file-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2a9d8f 0%, #264653 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-upload-label:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #264653 0%, #2a9d8f 100%);
}

.message-image {
    max-width: 300px;
    max-height: 300px;
    border-radius: 8px;
    margin: 10px 0;
    display: block;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .message-image {
        max-width: 200px;
        max-height: 200px;
    }
}

/* Обновляем стили для контейнера авторизации */
.auth-container {
    width: 100%;
    max-width: 400px;
    margin: 80px auto 0; /* Добавляем отступ сверху для учета хедера */
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* Обновляем стили для форм */
.auth-container form {
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

/* Обновляем стили для адаптивности */
@media (max-width: 768px) {
    .auth-container {
        padding: 10px;
        margin-top: 60px; /* Уменьшаем отступ на мобильных устройствах */
    }
    
    .auth-container form {
        padding: 20px;
    }
}

/* Стили для модального окна авторизации */
.auth-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.auth-modal-content {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    position: relative;
}

.auth-modal-content h2 {
    color: #2d3748;
    font-size: 24px;
    margin-bottom: 24px;
    text-align: center;
    margin-top: 0;
}

.modal-form {
    margin: 0;
    padding: 0;
    background: none;
    box-shadow: none;
}

.modal-form .form-group {
    margin-bottom: 20px;
    position: relative;
}

.modal-form .form-group label {
    display: block;
    margin-bottom: 8px;
    color: #4a5568;
    font-size: 14px;
    font-weight: 500;
}

.modal-form input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    color: #2d3748;
    background: white;
    transition: all 0.2s ease;
}

.modal-form input:focus {
    border-color: #2a9d8f;
    box-shadow: 0 0 0 3px rgba(42, 157, 143, 0.1);
    outline: none;
}

.auth-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #2a9d8f;  /* Общий цвет фона для обеих кнопок */
    color: white;  /* Общий цвет текста для обеих кнопок */
}

.auth-btn:hover {
    background: #238b7e;  /* Общий цвет при наведении */
}

/* Удаляем специфичные стили для register-btn, так как теперь они общие */

.form-footer {
    margin-top: 16px;
    text-align: center;
    font-size: 14px;
    color: #4a5568;
}

.form-footer a {
    color: #2a9d8f;
    text-decoration: none;
    font-weight: 500;
}

.form-footer a:hover {
    text-decoration: underline;
}

.close-modal-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: #4a5568;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.close-modal-btn:hover {
    color: #2d3748;
}

.form-error {
    background-color: #fff5f5;
    color: #c53030;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 16px;
    border: 1px solid #feb2b2;
    display: none;
}

.form-error.visible {
    display: block;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .auth-modal-content {
        width: 95%;
        padding: 24px;
    }

    .modal-form input {
        font-size: 16px;
    }
}

/* Добавляем стили для сообщения */
.auth-message {
    color: #2d3748;
    padding: 16px 20px;
    margin-bottom: 24px;
    font-size: 16px;
    line-height: 1.6;
    text-align: center;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.auth-message p {
    margin: 0 0 15px 0;
}

.auth-message p:last-child {
    margin-bottom: 0;
}

/* Стили для модального окна выбора учебника */
.textbook-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.textbook-modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.textbook-modal-content h2 {
    color: #2d3748;
    font-size: 24px;
    margin-bottom: 24px;
    text-align: center;
    margin-top: 0;
}

/* Добавляем стили для нового модального окна */
.welcome-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1100; /* Выше, чем у auth-modal */
    backdrop-filter: blur(5px);
}

.welcome-modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    position: relative;
    text-align: center;
}

.welcome-message {
    color: #2d3748;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 24px;
}

.welcome-message p {
    margin: 0 0 15px 0;
}

.welcome-message p:first-child {
    font-size: 20px;
    font-weight: 600;
    color: #2a9d8f;
}

.welcome-btn {
    background: #2a9d8f;
    color: white;
    border: none;
    padding: 12px 40px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.welcome-btn:hover {
    background: #238b7e;
    transform: translateY(-2px);
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .welcome-modal-content {
        width: 95%;
        padding: 24px;
    }
    
    .welcome-message {
        font-size: 15px;
    }
    
    .welcome-btn {
        padding: 10px 30px;
        font-size: 15px;
    }
}

/* Обновляем стили для глав и параграфов в списке */
.chapter-title {
    color: #2a9d8f;  /* Цвет для заголовков глав */
    font-size: 1.1em;
    font-weight: 600;
    padding: 12px 16px;
    margin: 16px 0 8px 0;
    background: rgba(42, 157, 143, 0.1);
    border-radius: 8px;
    border-left: 4px solid #2a9d8f;
}

.paragraph-item {
    color: #2d3748;
    padding: 8px 16px 8px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 8px;
    margin: 4px 0;
}

.paragraph-item:hover {
    background-color: rgba(42, 157, 143, 0.05);
    color: #2a9d8f;
}

#contents-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

#contents-list ul {
    list-style-type: none;
    padding: 0;
    margin: 0 0 16px 0;
}

/* Стили для футера */
.site-footer {
    background: rgba(38, 70, 83, 0.95);
    backdrop-filter: blur(10px);
    color: #fff;
    padding: 40px 0 20px;
    margin-top: auto;
    width: 100%;
}

.footer-container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: 600px 200px;
    justify-content: center;
    gap: 40px;
    margin-bottom: 30px;
    margin-left: -200px;  /* Смещаем весь контент влево */
}

.footer-section {
    max-width: 600px;
    margin-bottom: 20px;
}

.footer-section:first-child {
    padding-right: 20px;
    text-align: left;
}

.footer-section h3 {
    color: #e9c46a;
    font-size: 1.2em;
    margin-bottom: 15px;
    font-weight: 600;
}

.footer-section p {
    color: #fff;
    line-height: 1.6;
    margin-bottom: 10px;
    font-size: 0.9em;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section ul li a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.9em;
}

.footer-section ul li a:hover {
    color: #e9c46a;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85em;
    margin: 0;
}

/* Обновляем стили для основного контейнера, чтобы футер всегда был внизу */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
}

.main-container {
    flex: 1;
    display: flex;
    padding-top: 80px;
    min-height: calc(100vh - 100px);
    width: 100%;
    gap: 20px;
    padding: 20px;
    max-width: 1800px;
    margin: 0 auto;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
        margin-left: 0;  /* Убираем смещение на мобильных */
    }
    
    .footer-section {
        text-align: center;
        max-width: 100%;
        padding: 0 20px;
    }
    
    .footer-section:first-child {
        text-align: center;
    }
    
    .site-footer {
        padding: 30px 0 15px;
    }
}

/* Стили для страницы обратной связи */
body .feedback-container {
    max-width: 1200px;
    margin: 80px auto 0;
    padding: 20px;
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
}

body .feedback-form {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    box-sizing: border-box;
}

body .feedback-form h1 {
    color: #264653;
    text-align: center;
    margin-bottom: 30px;
}

body .feedback-form textarea {
    width: 100%;
    min-height: 300px;
    padding: 15px;
    border: 2px solid #e1e8f0;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 16px;
    resize: vertical;
    font-family: inherit;
    box-sizing: border-box;
}

body .feedback-form textarea:focus {
    border-color: #2a9d8f;
    outline: none;
    box-shadow: 0 0 0 3px rgba(42, 157, 143, 0.1);
}

body .feedback-form .file-input {
    margin-bottom: 20px;
}

body .feedback-form .file-input label {
    display: block;
    margin-bottom: 10px;
    color: #264653;
}

body .feedback-form .submit-btn {
    background: linear-gradient(135deg, #2a9d8f 0%, #264653 100%);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    display: block;
    width: 100%;
}

body .feedback-form .submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(0,0,0,0.2);
    background: linear-gradient(135deg, #264653 0%, #2a9d8f 100%);
}

body .feedback-form .success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: none;
}

body .feedback-form .error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: none;
}

/* Адаптивность для страницы обратной связи */
@media (max-width: 768px) {
    body .feedback-container {
        padding: 10px;
        margin-top: 60px;
    }
    
    body .feedback-form {
        padding: 20px;
    }
}

/* Стили для меню предметов */
.subjects-menu {
    position: relative;
}

.subjects-menu-trigger {
    color: #ffffff;
    cursor: pointer;
    padding: 8px 20px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.subjects-menu-trigger:hover {
    background-color: rgba(233, 196, 106, 0.2);
}

.subjects-dropdown {
    min-width: 200px;
    max-height: 400px;
    overflow-y: auto;
}

.subjects-dropdown::-webkit-scrollbar {
    width: 8px;
}

.subjects-dropdown::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.subjects-dropdown::-webkit-scrollbar-thumb {
    background: rgba(233, 196, 106, 0.3);
    border-radius: 4px;
}

.subject-link {
    display: block;
    padding: 8px 16px;
    color: #ffffff;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.subject-link:hover {
    background-color: rgba(233, 196, 106, 0.2);
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .subjects-dropdown {
        position: static;
        max-height: none;
        overflow: visible;
    }
    
    .subjects-menu-trigger {
        width: 100%;
        text-align: center;
    }
}

/* Стили для сообщения о недоступном предмете */
.disabled-subject-message {
    position: absolute;
    background: rgba(128, 128, 128, 0.95);  /* Изменяем на серый цвет */
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    z-index: 1100;
    white-space: nowrap;
    animation: messageAppear 0.3s ease-out;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Анимация появления сообщения */
@keyframes messageAppear {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Обновляем цвет стрелочки */
.disabled-subject-message::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 10px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid rgba(128, 128, 128, 0.95);  /* Изменяем на тот же серый цвет */
}

/* Стили для неактивных предметов */
.subject-disabled {
    opacity: 0.5;
    cursor: default;
    background-color: rgba(255, 255, 255, 0.05);
}

.subject-disabled:hover {
    background-color: rgba(255, 255, 255, 0.05);
    transform: none;
    box-shadow: none;
}

/* Стили для переключателя режима решения задач */
.switch-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    padding: 4px 8px;
    gap: 8px;
}

.switch-button input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
    background-color: #ccc;
    border-radius: 24px;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: .4s;
}

input:checked + .slider {
    background: linear-gradient(135deg, #2a9d8f 0%, #264653 100%);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.switch-label {
    font-size: 14px;
    color: #264653;
    font-weight: 500;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .switch-button {
        flex-direction: column;
        gap: 4px;
    }
    
    .switch-label {
        font-size: 12px;
    }
}

/* Стили для системного сообщения */
.system-message {
    background-color: #f8f9fa;
    color: #2d3748;
    border: 1px solid #e2e8f0;
    text-align: center;
    font-style: italic;
    padding: 12px 16px;
    margin: 8px 0;
    border-radius: 8px;
    align-self: center;
    max-width: 80%;
}

.system-message::before {
    content: '🔄';
    margin-right: 8px;
}

/* Добавляем стили для уведомления об обдумывании */
.thinking-notification {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(128, 128, 128, 0.9); /* Меняем на серый цвет */
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    z-index: 1000;
    animation: fadeIn 0.3s ease-in;
}

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

.image-message {
    max-width: 100%;
    margin: 10px 0;
}

.image-message img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.welcome-container {
    padding-top: 80px; /* Добавляем отступ для header */
    min-height: calc(100vh - 80px); /* Учитываем высоту header */
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(120deg, #264653 0%, #2a9d8f 100%);
}

.welcome-content {
    max-width: 1200px;
    width: 100%;
    text-align: center;
    color: #fff;
    padding: 40px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.welcome-header h1 {
    font-size: 3.5em;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #e9c46a 0%, #f4a261 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
}

.feature-card {
    background: rgba(42, 157, 143, 0.1);
    border: 1px solid rgba(233, 196, 106, 0.2);
    padding: 30px;
    border-radius: 15px;
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    background: rgba(42, 157, 143, 0.2);
    border-color: rgba(233, 196, 106, 0.4);
}

.feature-card i {
    font-size: 2.5em;
    color: #e9c46a;
    margin-bottom: 20px;
}

.cta-button.primary {
    background: linear-gradient(135deg, #2a9d8f 0%, #264653 100%);
    color: #fff;
    border: none;
}

.cta-button.secondary {
    background: transparent;
    color: #e9c46a;
    border: 2px solid #e9c46a;
}

.cta-button.primary:hover {
    background: linear-gradient(135deg, #264653 0%, #2a9d8f 100%);
    transform: translateY(-2px);
}

.cta-button.secondary:hover {
    background: rgba(233, 196, 106, 0.1);
    transform: translateY(-2px);
}

.welcome-subtitle {
    color: #e9c46a;
    font-size: 1.5em;
    margin-bottom: 40px;
    font-weight: 300;
}

@media (max-width: 768px) {
    .welcome-container {
        padding: 100px 20px 40px;
    }

    .welcome-content {
        padding: 20px;
    }

    .welcome-header h1 {
        font-size: 2.5em;
    }

    .welcome-subtitle {
        font-size: 1.2em;
    }

    .feature-card {
        margin-bottom: 20px;
    }
}
.google-btn {
    width: 100%;
    background: white;
    color: #757575;
    border: 1px solid #ddd;
    padding: 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.google-btn:hover {
    background: #f5f5f5;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.google-btn img {
    width: 20px;
    height: 20px;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    color: #666;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #ddd;
}

.divider span {
    padding: 0 10px;
}
.google-btn {
    width: 100%;
    background: white;
    color: #757575;
    border: 1px solid #ddd;
    padding: 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.google-btn:hover {
    background: #f5f5f5;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.google-btn img {
    width: 20px;
    height: 20px;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    color: #666;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #ddd;
}

.divider span {
    padding: 0 10px;
}