/* Основные стили */
:root {
    --primary-color: #4361ee;
    --secondary-color: #3a0ca3;
    --success-color: #4cc9f0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --accent-color: #f72585;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8fafc;
    color: var(--dark-color);
    line-height: 1.6;
}

/* Карточки */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 1.5rem;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 12px 12px 0 0 !important;
    padding: 1.2rem 1.5rem;
    font-weight: 600;
}

/* Кнопки */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.4);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Навигация */
.navbar {
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Таблицы */
.table {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.table thead th {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem;
    font-weight: 600;
}

.table tbody tr {
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background-color: rgba(67, 97, 238, 0.05);
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-color: #e9ecef;
}

/* Чат-интерфейс */
.chat-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.chat-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1.5rem;
    text-align: center;
}

.chat-messages {
    height: 500px;
    overflow-y: auto;
    padding: 1.5rem;
    background-color: #f8fafc;
}

.message {
    margin-bottom: 1.2rem;
    max-width: 80%;
    clear: both;
}

.message-user {
    float: right;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 18px 18px 4px 18px;
}

.message-ai {
    float: left;
    background: white;
    color: var(--dark-color);
    border: 1px solid #e9ecef;
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.message-content {
    padding: 1rem 1.2rem;
    word-wrap: break-word;
}

.message-time {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 0.3rem;
}

.chat-input-area {
    border-top: 1px solid #e9ecef;
    padding: 1.5rem;
    background: white;
}

/* Панель преподавателя */
.teacher-dashboard {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    color: white;
    padding: 2rem;
    margin-bottom: 2rem;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15);
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Адаптивность */
@media (max-width: 768px) {
    .chat-messages {
        height: 400px;
    }
    
    .message {
        max-width: 90%;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
}

/* Анимации */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Формы */
.form-control, .form-select {
    border-radius: 8px;
    padding: 0.75rem 1rem;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(67, 97, 238, 0.25);
}

/* Уведомления */
.alert {
    border-radius: 10px;
    border: none;
    padding: 1rem 1.5rem;
}

















/* Стили для текста ответа ИИ */
.message-ai .message-content {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 18px 18px 18px 4px;
    padding: 0.75rem 1rem;
    max-width: 80%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Жирный текст */
.message-ai strong {
    font-weight: 700;
    color: #2c3e50;
}

/* Курсив */
.message-ai em {
    font-style: italic;
    color: #5a6c7e;
}

/* Заголовки */
.message-ai h1, .message-ai h2, .message-ai h3, 
.message-ai h4, .message-ai h5, .message-ai h6 {
    margin: 0.75rem 0 0.5rem 0;
    font-weight: 600;
    line-height: 1.3;
}

.message-ai h1 { font-size: 1.4rem; }
.message-ai h2 { font-size: 1.2rem; border-bottom: 1px solid #e9ecef; padding-bottom: 0.3rem; }
.message-ai h3 { font-size: 1.05rem; }
.message-ai h4 { font-size: 1rem; }

/* Списки */
.message-ai ul, .message-ai ol {
    margin: 0.5rem 0 0.5rem 1.5rem;
    padding: 0;
}

.message-ai li {
    margin: 0.25rem 0;
}

/* Параграфы */
.message-ai p {
    margin: 0.5rem 0;
    line-height: 1.5;
}

/* Цитаты */
.message-ai blockquote {
    margin: 0.5rem 0;
    padding-left: 0.8rem;
    border-left: 3px solid #4361ee;
    color: #5a6c7e;
    font-style: italic;
}

/* Код внутри текста */
.message-ai code {
    background: #f4f4f5;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.85rem;
}

/* Таблицы */
.message-ai table {
    border-collapse: collapse;
    width: 100%;
    margin: 0.5rem 0;
    font-size: 0.85rem;
}

.message-ai th, .message-ai td {
    border: 1px solid #dee2e6;
    padding: 0.4rem;
    text-align: left;
}

.message-ai th {
    background: #f8f9fa;
    font-weight: 600;
}
