/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background: linear-gradient(135deg, #f5f5f0 0%, #e8e8e3 100%);
    min-height: 100vh;
    color: #333;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Навигация */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    margin: 0 -20px 20px -20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    width: 100vw;
    left: 50%;
    margin-left: -50vw;
}

.navbar-content {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand h1 {
    color: #4a5568;
    font-size: 1.8rem;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    color: #4a5568;
    font-weight: 500;
}

/* Кнопки */
.btn {
    position: relative;
    overflow: hidden;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
}

/* Убираем сложные эффекты hover для быстродействия */

.btn-primary, .btn-secondary {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #f7dc6f 0%, #f4d03f 50%, #f8e27d 100%);
    color: #2c3e50;
    text-decoration: none;
    text-align: center;
    padding: 2rem 3rem;
    border-radius: 20px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 700;
    font-size: 1.5rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 30px rgba(247, 220, 111, 0.3);
}

.btn-primary:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(247, 220, 111, 0.4);
    background: linear-gradient(135deg, #f4d03f 0%, #d4ac0d 50%, #f7dc6f 100%);
}

.btn-logout {
    background: linear-gradient(135deg, #ff8a80 0%, #ffab91 100%);
    color: white;
    padding: 8px 16px;
    font-size: 14px;
}

.btn-logout:hover {
    background: linear-gradient(135deg, #ff7043 0%, #ff5722 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 112, 67, 0.3);
}

.btn-login {
    width: 100%;
    padding: 12px;
    font-size: 16px;
}

/* Основной контент */
.main-content {
    flex: 1;
    padding: 2rem 0;
}

.hero-section {
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 3rem 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
}

.hero-section h2 {
    font-size: 2.5rem;
    color: #4a5568;
    margin-bottom: 1rem;
}

.hero-section p {
    font-size: 1.2rem;
    color: #718096;
}

/* Карточки функций */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.feature-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    transition: transform 0.3s ease;
}

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

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #4a5568;
}

.feature-card p {
    color: #718096;
}

/* Дашборд пользователя */
.user-dashboard {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 15px;
    margin: 2rem 0;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
}

.user-dashboard h3 {
    color: #4a5568;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.user-details p {
    margin: 0.5rem 0;
    color: #718096;
    font-size: 1.1rem;
}

/* Стили для страницы входа */
.login-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 0;
    margin: 0;
}

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 100px);
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 20px;
}

.login-form-wrapper {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    color: #4a5568;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: #718096;
    font-size: 1.1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #4a5568;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.error-message {
    background: #fed7d7;
    color: #c53030;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    text-align: center;
    border: 1px solid #feb2b2;
}

.login-help {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

.login-help h4 {
    color: #4a5568;
    margin-bottom: 0.5rem;
}

.login-help p {
    color: #718096;
    font-size: 0.9rem;
    margin: 0.25rem 0;
}

/* Адаптивность */
@media (max-width: 768px) {
    .navbar-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: 0 1rem;
    }
    
    .nav-menu {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }
    
    .hero-section h2 {
        font-size: 2rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 0 10px;
    }
}

/* Стили для новых страниц */
.button-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 3rem;
}

.buttons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 3rem;
    max-width: 1200px;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #f7dc6f 0%, #f4d03f 50%, #f8e27d 100%);
    color: #2c3e50;
    text-decoration: none;
    text-align: center;
    padding: 2rem 3rem;
    border-radius: 20px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 700;
    font-size: 1.5rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 30px rgba(247, 220, 111, 0.3);
    transform: translateY(0);
}

.btn-primary:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(247, 220, 111, 0.4);
    background: linear-gradient(135deg, #f4d03f 0%, #d4ac0d 50%, #f7dc6f 100%);
}

.btn-secondary {
    background: linear-gradient(135deg, #d5dbdb 0%, #aeb6bf 50%, #e5e8e8 100%);
    color: #2c3e50;
    text-decoration: none;
    text-align: center;
    padding: 2rem 3rem;
    border-radius: 20px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 700;
    font-size: 1.5rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 30px rgba(213, 219, 219, 0.3);
    transform: translateY(0);
}

.btn-secondary:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(213, 219, 219, 0.4);
    background: linear-gradient(135deg, #aeb6bf 0%, #85929e 50%, #d5dbdb 100%);
}

.btn-home {
    background: linear-gradient(135deg, #f8c471 0%, #f5b041 100%);
    color: #2c3e50;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 500;
    margin-right: 1rem;
    transition: all 0.3s ease;
    font-size: 14px;
}

.btn-home:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(248, 196, 113, 0.3);
    background: linear-gradient(135deg, #f5b041 0%, #d68910 100%);
}

.page-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 3rem 2rem;
    border-radius: 15px;
    margin: 2rem 0;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
}

.page-content h2 {
    color: #4a5568;
    margin-bottom: 1rem;
    font-size: 2.5rem;
    text-align: center;
}

.page-content p {
    color: #718096;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.content-section {
    margin: 2rem 0;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
}

.content-section h3 {
    color: #4a5568;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.feature-showcase ul {
    list-style: none;
    padding: 0;
}

.feature-showcase li {
    padding: 0.5rem 0;
    color: #718096;
    border-bottom: 1px solid rgba(113, 128, 150, 0.2);
}

.feature-showcase li:last-child {
    border-bottom: none;
}

.navigation-buttons {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.navigation-buttons .btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: 15px;
    min-width: 200px;
}

.navigation-buttons .btn-primary {
    background: linear-gradient(135deg, #f7dc6f 0%, #f4d03f 100%);
    box-shadow: 0 4px 20px rgba(247, 220, 111, 0.3);
}

.navigation-buttons .btn-primary:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(247, 220, 111, 0.4);
    background: linear-gradient(135deg, #f4d03f 0%, #d4ac0d 100%);
}

.navigation-buttons .btn-secondary {
    background: linear-gradient(135deg, #d5dbdb 0%, #aeb6bf 100%);
    box-shadow: 0 4px 20px rgba(213, 219, 219, 0.3);
}

.navigation-buttons .btn-secondary:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(213, 219, 219, 0.4);
    background: linear-gradient(135deg, #aeb6bf 0%, #85929e 100%);
}

@media (max-width: 480px) {
    .buttons-grid {
        grid-template-columns: 1fr;
    }
    
    .navigation-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
}

/* Анимации для переходов между страницами */
.page-transition {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, transform;
}

.page-transition.fade-out {
    opacity: 0;
    transform: translateY(-20px);
}

/* Убираем все анимации переходов страниц для скорости */

/* Стили для прелоадера */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #f5f5f0 0%, #e8e8e3 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
    overflow: hidden;
}

.page-loader.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(244, 208, 63, 0.3);
    border-top: 4px solid #f4d03f;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Стили для чата */
.chat-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 0;
    margin: 0;
    box-shadow: none;
    overflow: hidden;
    height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    width: 100%;
}

.chat-header {
    background: linear-gradient(135deg, #f7dc6f 0%, #f4d03f 100%);
    color: #2c3e50;
    padding: 0.8rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid rgba(44, 62, 80, 0.2);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 60px;
}

.chat-header-content {
    flex: 1;
    text-align: center;
}

.chat-header h2 {
    margin: 0 0 0.2rem 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.chat-header p {
    margin: 0;
    opacity: 0.85;
    font-size: 0.8rem;
}

.chat-nav-buttons {
    display: flex;
    gap: 0.4rem;
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
}

.chat-nav-btn {
    padding: 0.3rem 0.7rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.chat-nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.logout-btn {
    background: rgba(255, 107, 107, 0.3) !important;
    border: 1px solid rgba(255, 107, 107, 0.5) !important;
    cursor: pointer;
}

.logout-btn:hover {
    background: rgba(255, 107, 107, 0.5) !important;
}

.main-content {
    flex: 1;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    padding: 2rem 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f8fafc;
    gap: 0;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.message {
    display: flex;
    gap: 0;
    max-width: 800px;
    width: 100%;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.ai-message {
    align-self: center;
    justify-content: flex-start;
}

.user-message {
    align-self: center;
    justify-content: flex-end;
}

.message-avatar {
    display: none;
}

.message-content {
    flex: 0 1 auto;
    max-width: 70%;
}

.message-text {
    padding: 1.2rem 1.5rem;
    border-radius: 18px;
    font-size: 1rem;
    line-height: 1.6;
    word-wrap: break-word;
    max-width: 100%;
}

.ai-message .message-text {
    background: white;
    color: #2d3748;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-bottom-left-radius: 6px;
}

.user-message .message-text {
    background: linear-gradient(135deg, #f7dc6f 0%, #f4d03f 100%);
    color: #2c3e50;
    border-bottom-right-radius: 6px;
}

.message-time {
    font-size: 0.75rem;
    color: #a0aec0;
    margin-top: 0.3rem;
    padding: 0 1.5rem;
}

.user-message .message-time {
    text-align: right;
    color: rgba(44, 62, 80, 0.7);
}

/* Форматирование текста в сообщениях */
.message-text h1, .message-text h2, .message-text h3, .message-text h4, .message-text h5, .message-text h6 {
    margin: 0.8em 0 0.4em 0;
    font-weight: 600;
    line-height: 1.3;
}

.message-text h1 { font-size: 1.4em; }
.message-text h2 { font-size: 1.3em; }
.message-text h3 { font-size: 1.2em; }
.message-text h4 { font-size: 1.1em; }

.message-text h1:first-child,
.message-text h2:first-child,
.message-text h3:first-child,
.message-text h4:first-child {
    margin-top: 0;
}

.message-text p {
    margin: 0.8em 0;
    line-height: 1.6;
}

.message-text p:first-child {
    margin-top: 0;
}

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

/* Списки */
.message-text ul, .message-text ol {
    margin: 0.8em 0;
    padding-left: 1.5em;
    line-height: 1.6;
}

.message-text li {
    margin: 0.3em 0;
}

.message-text ul li {
    list-style-type: disc;
}

.message-text ol li {
    list-style-type: decimal;
}

/* Вложенные списки */
.message-text ul ul, .message-text ol ol, .message-text ul ol, .message-text ol ul {
    margin: 0.3em 0;
}

.message-text ul ul li {
    list-style-type: circle;
}

/* Жирный и курсивный текст */
.message-text strong, .message-text b {
    font-weight: 700;
    color: inherit;
}

.message-text em, .message-text i {
    font-style: italic;
}

/* Код */
.message-text code {
    background: rgba(0, 0, 0, 0.1);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    color: #e91e63;
    font-weight: 500;
}

.user-message .message-text code {
    background: rgba(255, 255, 255, 0.2);
    color: #ffeb3b;
}

/* Блоки кода */
.message-text pre {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1em;
    margin: 0.8em 0;
    overflow-x: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.85em;
    line-height: 1.4;
}

.user-message .message-text pre {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #f8f9fa;
}

.message-text pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

/* Цитаты */
.message-text blockquote {
    border-left: 4px solid #f7dc6f;
    padding-left: 1em;
    margin: 0.8em 0;
    font-style: italic;
    color: #6c757d;
}

.user-message .message-text blockquote {
    border-left-color: rgba(44, 62, 80, 0.5);
    color: rgba(44, 62, 80, 0.9);
}

/* Разделители */
.message-text hr {
    border: none;
    height: 1px;
    background: linear-gradient(to right, transparent, #ccc, transparent);
    margin: 1.2em 0;
}

.user-message .message-text hr {
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.5), transparent);
}

/* Ссылки */
.message-text a {
    color: #f7dc6f;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.message-text a:hover {
    border-bottom-color: #f7dc6f;
}

.user-message .message-text a {
    color: #2c3e50;
}

.user-message .message-text a:hover {
    border-bottom-color: #2c3e50;
}

/* Таблицы */
.message-text table {
    border-collapse: collapse;
    width: 100%;
    margin: 0.8em 0;
    font-size: 0.9em;
}

.message-text th, .message-text td {
    border: 1px solid #dee2e6;
    padding: 0.6em 0.8em;
    text-align: left;
}

.message-text th {
    background: #f8f9fa;
    font-weight: 600;
}

.user-message .message-text th {
    background: rgba(255, 255, 255, 0.1);
}

.user-message .message-text th, .user-message .message-text td {
    border-color: rgba(255, 255, 255, 0.2);
}

/* Выделения */
.message-text mark {
    background: #fff3cd;
    padding: 0.1em 0.2em;
    border-radius: 2px;
}

.user-message .message-text mark {
    background: rgba(255, 235, 59, 0.3);
}

/* Адаптивные стили для чата */
@media (max-width: 768px) {
    .chat-container {
        height: calc(100vh - 60px);
        margin: 0;
        border-radius: 0;
    }
    
    .fullscreen-chat .chat-container {
        height: 100vh;
    }
    
    .chat-header {
        padding: 0.6rem 1rem;
        flex-direction: column;
        gap: 0.6rem;
        min-height: 50px;
    }
    
    .chat-nav-buttons {
        position: static;
        transform: none;
        order: -1;
        justify-content: center;
    }
    
    .chat-header-content {
        text-align: center;
    }
    
    .chat-header h2 {
        font-size: 1.2rem;
    }
    
    .chat-header p {
        font-size: 0.75rem;
    }
    
    .chat-messages {
        padding: 1rem 0.5rem;
    }
    
    .message {
        max-width: 100%;
        padding: 0 0.5rem;
        margin-bottom: 1.5rem;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .message-time {
        padding: 0 1rem;
    }
    
    .chat-input-container {
        padding: 1rem;
    }
    
    .chat-input-wrapper {
        flex-direction: row;
        gap: 0.8rem;
        max-width: 100%;
    }
    
    .send-button {
        flex-shrink: 0;
        min-width: 100px;
    }
    
    .chat-nav-btn {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }
}

/* Полноэкранный режим чата */
.fullscreen-chat .navbar {
    display: none;
}

.fullscreen-chat .container {
    padding: 0;
    max-width: 100%;
}

.fullscreen-chat .main-content {
    padding: 0;
}

.fullscreen-chat .chat-container {
    height: 100vh;
    border-radius: 0;
    margin: 0;
}

.message-time {
    font-size: 0.75rem;
    color: #a0aec0;
    margin-top: 0.3rem;
    padding: 0 1.2rem;
}

.user-message .message-time {
    text-align: right;
    color: rgba(44, 62, 80, 0.7);
}

.chat-input-container {
    background: #f8fafc;
    padding: 1.5rem;
    border-top: none;
    display: flex;
    justify-content: center;
}

.chat-input-wrapper {
    display: flex;
    gap: 1rem;
    max-width: 800px;
    width: 100%;
}

.chat-input {
    flex: 1;
    padding: 0.8rem 1.2rem;
    border: 2px solid #e2e8f0;
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    background: white;
    box-shadow: none;
    resize: none;
    font-family: inherit;
    line-height: 1.4;
    min-height: 44px;
    max-height: 120px;
    overflow-y: auto;
}

.chat-input:focus {
    border-color: #f7dc6f;
    background: white;
    box-shadow: 0 0 0 3px rgba(247, 220, 111, 0.1);
}

/* Стили для прокрутки в textarea */
.chat-input::-webkit-scrollbar {
    width: 4px;
}

.chat-input::-webkit-scrollbar-track {
    background: transparent;
}

.chat-input::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.chat-input::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.send-button {
    padding: 0.8rem 1.5rem;
    background: linear-gradient(135deg, #f7dc6f 0%, #f4d03f 100%);
    color: #2c3e50;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.send-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(247, 220, 111, 0.3);
    background: linear-gradient(135deg, #f4d03f 0%, #d4ac0d 100%);
}

.send-button:active {
    transform: translateY(0);
}

.send-button svg {
    transition: transform 0.2s ease;
}

.send-button:hover svg {
    transform: translateX(2px);
}

/* Дополнительные отступы для лучшей читаемости */
@media (min-width: 1200px) {
    .chat-messages {
        padding: 2rem 2rem;
    }
    
    .message {
        max-width: 900px;
    }
    
    .chat-input-wrapper {
        max-width: 900px;
    }
}

@media (min-width: 1400px) {
    .message {
        max-width: 1000px;
    }
    
    .chat-input-wrapper {
        max-width: 1000px;
    }
}

/* Убираем блокировку скролла - замедляет загрузку */
body.transition-active {
    /* overflow: hidden; */
    /* height: 100vh; */
}

/* Альтернативный вариант для ровно 3 кнопки */
@media (min-width: 768px) {
    .buttons-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: 1000px;
    }
}

@media (max-width: 767px) {
    .buttons-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* Стили для голосового интерфейса */
.voice-interface {
    background: linear-gradient(135deg, #2d3436 0%, #636e72 100%);
    min-height: 100vh;
}

.voice-main {
    padding: 0;
    min-height: calc(100vh - 80px);
}

.voice-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 80px);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

.voice-header {
    background: linear-gradient(135deg, #e17055 0%, #d63031 100%);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.voice-nav-buttons {
    display: flex;
    gap: 0.5rem;
}

.voice-nav-btn {
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.voice-nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.voice-nav-btn.logout-btn {
    background: rgba(255, 107, 107, 0.3) !important;
    border: 1px solid rgba(255, 107, 107, 0.5) !important;
    cursor: pointer;
}

.voice-title {
    text-align: center;
    flex: 1;
}

.voice-title h2 {
    margin: 0 0 0.3rem 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.voice-title p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.9rem;
}

.voice-interface-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    padding: 2rem;
}

/* Стили для голосовой сферы */
.voice-sphere-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.voice-sphere {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e17055 0%, #d63031 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(225, 112, 85, 0.3);
}

.voice-sphere:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(225, 112, 85, 0.4);
}

.voice-sphere.recording {
    animation: pulse-recording 1.5s infinite ease-in-out;
    box-shadow: 0 0 30px rgba(225, 112, 85, 0.8);
}

@keyframes pulse-recording {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.sphere-inner {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Убираем тяжёлую анимацию сферы - замедляет загрузку */
.sphere-numbers {
    position: absolute;
    width: 100%;
    height: 100%;
    /* animation: rotate-numbers 20s linear infinite; */
}

.sphere-numbers span {
    position: absolute;
    color: rgba(255, 255, 255, 0.6);
    font-weight: bold;
    font-size: 0.9rem;
    transform-origin: 100px 100px;
}

.sphere-numbers span:nth-child(1) { transform: rotate(0deg) translate(80px) rotate(-0deg); }
.sphere-numbers span:nth-child(2) { transform: rotate(18deg) translate(80px) rotate(-18deg); }
.sphere-numbers span:nth-child(3) { transform: rotate(36deg) translate(80px) rotate(-36deg); }
.sphere-numbers span:nth-child(4) { transform: rotate(54deg) translate(80px) rotate(-54deg); }
.sphere-numbers span:nth-child(5) { transform: rotate(72deg) translate(80px) rotate(-72deg); }
.sphere-numbers span:nth-child(6) { transform: rotate(90deg) translate(80px) rotate(-90deg); }
.sphere-numbers span:nth-child(7) { transform: rotate(108deg) translate(80px) rotate(-108deg); }
.sphere-numbers span:nth-child(8) { transform: rotate(126deg) translate(80px) rotate(-126deg); }
.sphere-numbers span:nth-child(9) { transform: rotate(144deg) translate(80px) rotate(-144deg); }
.sphere-numbers span:nth-child(10) { transform: rotate(162deg) translate(80px) rotate(-162deg); }
.sphere-numbers span:nth-child(11) { transform: rotate(180deg) translate(80px) rotate(-180deg); }
.sphere-numbers span:nth-child(12) { transform: rotate(198deg) translate(80px) rotate(-198deg); }
.sphere-numbers span:nth-child(13) { transform: rotate(216deg) translate(80px) rotate(-216deg); }
.sphere-numbers span:nth-child(14) { transform: rotate(234deg) translate(80px) rotate(-234deg); }
.sphere-numbers span:nth-child(15) { transform: rotate(252deg) translate(80px) rotate(-252deg); }
.sphere-numbers span:nth-child(16) { transform: rotate(270deg) translate(80px) rotate(-270deg); }
.sphere-numbers span:nth-child(17) { transform: rotate(288deg) translate(80px) rotate(-288deg); }
.sphere-numbers span:nth-child(18) { transform: rotate(306deg) translate(80px) rotate(-306deg); }
.sphere-numbers span:nth-child(19) { transform: rotate(324deg) translate(80px) rotate(-324deg); }
.sphere-numbers span:nth-child(20) { transform: rotate(342deg) translate(80px) rotate(-342deg); }

@keyframes rotate-numbers {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.sphere-center {
    font-size: 2.5rem;
    z-index: 2;
    position: relative;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.voice-status {
    color: white;
    font-size: 1.1rem;
    font-weight: 500;
    text-align: center;
    opacity: 0.9;
}

/* Стили для области ответа ИИ */
.ai-response-area {
    width: 100%;
    max-width: 800px;
}

.response-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.response-placeholder {
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    font-style: italic;
    font-size: 1.1rem;
}

.ai-response {
    color: white;
    font-size: 1.1rem;
    line-height: 1.6;
    text-align: center;
    animation: fadeInResponse 0.5s ease-in-out;
}

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

/* Адаптивность для голосового интерфейса */
@media (max-width: 768px) {
    .voice-sphere {
        width: 150px;
        height: 150px;
    }
    
    .sphere-numbers span {
        transform-origin: 75px 75px;
        font-size: 0.8rem;
    }
    
    .sphere-numbers span:nth-child(1) { transform: rotate(0deg) translate(60px) rotate(-0deg); }
    .sphere-numbers span:nth-child(2) { transform: rotate(18deg) translate(60px) rotate(-18deg); }
    .sphere-numbers span:nth-child(3) { transform: rotate(36deg) translate(60px) rotate(-36deg); }
    .sphere-numbers span:nth-child(4) { transform: rotate(54deg) translate(60px) rotate(-54deg); }
    .sphere-numbers span:nth-child(5) { transform: rotate(72deg) translate(60px) rotate(-72deg); }
    .sphere-numbers span:nth-child(6) { transform: rotate(90deg) translate(60px) rotate(-90deg); }
    .sphere-numbers span:nth-child(7) { transform: rotate(108deg) translate(60px) rotate(-108deg); }
    .sphere-numbers span:nth-child(8) { transform: rotate(126deg) translate(60px) rotate(-126deg); }
    .sphere-numbers span:nth-child(9) { transform: rotate(144deg) translate(60px) rotate(-144deg); }
    .sphere-numbers span:nth-child(10) { transform: rotate(162deg) translate(60px) rotate(-162deg); }
    .sphere-numbers span:nth-child(11) { transform: rotate(180deg) translate(60px) rotate(-180deg); }
    .sphere-numbers span:nth-child(12) { transform: rotate(198deg) translate(60px) rotate(-198deg); }
    .sphere-numbers span:nth-child(13) { transform: rotate(216deg) translate(60px) rotate(-216deg); }
    .sphere-numbers span:nth-child(14) { transform: rotate(234deg) translate(60px) rotate(-234deg); }
    .sphere-numbers span:nth-child(15) { transform: rotate(252deg) translate(60px) rotate(-252deg); }
    .sphere-numbers span:nth-child(16) { transform: rotate(270deg) translate(60px) rotate(-270deg); }
    .sphere-numbers span:nth-child(17) { transform: rotate(288deg) translate(60px) rotate(-288deg); }
    .sphere-numbers span:nth-child(18) { transform: rotate(306deg) translate(60px) rotate(-306deg); }
    .sphere-numbers span:nth-child(19) { transform: rotate(324deg) translate(60px) rotate(-324deg); }
    .sphere-numbers span:nth-child(20) { transform: rotate(342deg) translate(60px) rotate(-342deg); }
    
    .sphere-center {
        font-size: 2rem;
    }
    
    .voice-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .voice-nav-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .response-container {
        padding: 1.5rem;
        margin: 0 1rem;
    }
}

/* Темная тема для голосового интерфейса */
.dark-theme {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #ffffff;
    min-height: 100vh;
}

.dark-theme .container {
    background: transparent;
}

.dark-theme .navbar {
    background: rgba(40, 40, 40, 0.95);
    border-bottom: 1px solid #444444;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.dark-theme .nav-brand h1 {
    color: #ffffff;
}

.dark-theme .user-info {
    color: #cccccc;
}

.dark-theme .chat-container {
    background: rgba(45, 45, 45, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid #444444;
}

.dark-theme .chat-header {
    background: rgba(55, 55, 55, 0.95);
    border-bottom: 1px solid #555555;
}

.dark-theme .chat-header h2 {
    color: #ffffff;
}

.dark-theme .chat-header p {
    color: #cccccc;
}

.dark-theme .chat-nav-btn {
    background: rgba(70, 70, 70, 0.8);
    color: #ffffff;
    border: 1px solid #555555;
}

.dark-theme .chat-nav-btn:hover {
    background: rgba(90, 90, 90, 0.9);
    border-color: #666666;
    transform: translateY(-2px);
}

.dark-theme .chat-messages {
    background: rgba(35, 35, 35, 0.8);
    border: 1px solid #444444;
}

.dark-theme .voice-sphere {
    background: linear-gradient(135deg, #333333 0%, #555555 100%);
    border: 2px solid #666666;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.dark-theme .voice-sphere:hover {
    background: linear-gradient(135deg, #444444 0%, #666666 100%);
    border-color: #777777;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}

.dark-theme .sphere-numbers span {
    color: #888888;
    text-shadow: 0 0 10px rgba(136, 136, 136, 0.5);
}

.dark-theme .sphere-center {
    color: #ffffff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.dark-theme .voice-status {
    color: #cccccc;
    background: rgba(45, 45, 45, 0.9);
    border: 1px solid #555555;
}

.dark-theme .response-container {
    background: rgba(45, 45, 45, 0.9);
    border: 1px solid #555555;
}

.dark-theme .response-placeholder,
.dark-theme .ai-response {
    color: #ffffff;
}

.dark-theme .chat-input-container {
    background: rgba(45, 45, 45, 0.95);
    border-top: 1px solid #555555;
}

.dark-theme .voice-controls-info {
    color: #cccccc;
    text-align: center;
    padding: 1rem;
    font-style: italic;
}

/* Стили для переключателя режимов */
.mode-selector-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.mode-selector {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.mode-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    gap: 10px;
}

.mode-toggle input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 50px;
    height: 24px;
    background: #ccc;
    border-radius: 24px;
    transition: background 0.3s;
}

.toggle-slider:before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
}

.mode-toggle input[type="checkbox"]:checked + .toggle-slider {
    background: #4CAF50;
}

.mode-toggle input[type="checkbox"]:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.toggle-label {
    font-weight: 600;
    color: #fff;
    font-size: 16px;
}

.mode-description {
    margin-top: 10px;
    font-size: 14px;
    color: #b0b0b0;
    font-style: italic;
}

/* Темная тема для переключателя */
.dark-theme .mode-selector {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dark-theme .toggle-label {
    color: #e0e0e0;
}

.dark-theme .mode-description {
    color: #a0a0a0;
}

/* Индикатор состояния сервера */
.server-status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 2px solid transparent;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-left: 15px;
}

.server-status-indicator.online {
    background: rgba(76, 175, 80, 0.15);
    border-color: #4caf50;
    color: #2e7d32;
}

.server-status-indicator.offline {
    background: rgba(244, 67, 54, 0.15);
    border-color: #f44336;
    color: #c62828;
}

.server-status-indicator.checking {
    background: rgba(255, 193, 7, 0.15);
    border-color: #ffc107;
    color: #f57c00;
}

.server-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.server-status-indicator.online .server-status-dot {
    background: #4caf50;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.6);
    animation: pulse-online 2s infinite;
}

.server-status-indicator.offline .server-status-dot {
    background: #f44336;
}

.server-status-indicator.checking .server-status-dot {
    background: #ffc107;
    animation: pulse-checking 1s infinite;
}

.server-status-text {
    font-size: 13px;
    white-space: nowrap;
}

@keyframes pulse-online {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

@keyframes pulse-checking {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Темная тема для индикатора */
.dark-theme .server-status-indicator {
    background: rgba(0, 0, 0, 0.6);
}

.dark-theme .server-status-indicator.online {
    background: rgba(76, 175, 80, 0.2);
    color: #81c784;
}

.dark-theme .server-status-indicator.offline {
    background: rgba(244, 67, 54, 0.2);
    color: #e57373;
}

.dark-theme .server-status-indicator.checking {
    background: rgba(255, 193, 7, 0.2);
    color: #ffb74d;
}

/* Адаптивность */
@media (max-width: 768px) {
    .server-status-indicator {
        padding: 6px 10px;
        margin-left: 10px;
    }
    
    .server-status-text {
        font-size: 12px;
    }
    
    .server-status-dot {
        width: 8px;
        height: 8px;
    }
}

@media (max-width: 480px) {
    .server-status-text {
        display: none;
    }
    
    .server-status-indicator {
        padding: 8px;
        margin-left: 8px;
    }
} 