/* Стили применяются только если body имеет класс chat-page */
body.chat-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ОСНОВНОЙ КОНТЕЙНЕР - ОБНОВЛЕННЫЙ */
body.chat-page .chat-main-container {
    display: flex;
    width: 100%;
    max-width: 1400px;
    height: 90vh;
    margin: 0 auto;
}

/* ЕДИНЫЙ КОНТЕЙНЕР ЧАТА */
body.chat-page .chat-container {
    flex: 1;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ЗАГОЛОВОК */
body.chat-page .chat-header {
    padding: 1.25rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    border-bottom: 3px solid #667eea;
    background: rgba(102, 126, 234, 0.1);
}

/* ВКЛАДКИ */


/* ЧАТ */
body.chat-page .chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* ПУСТОЙ ЧАТ */
body.chat-page .empty-chat {
    font-size: 2rem;
    font-weight: 600;
    text-align: center;
    color: #555;
    padding: 2rem 1rem;
}

/* СООБЩЕНИЯ */
body.chat-page .message {
    position: relative;
    max-width: 70%;
    padding: 0.75rem 1rem;
    border-radius: 20px;
    word-wrap: break-word;
    line-height: 1.4;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    animation: messageAppear 0.4s ease-out;
}
body.chat-page .user-message {
    align-self: flex-end;  /* Было flex-start */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-top-right-radius: 0;  /* Было border-top-left-radius */
    border-top-left-radius: 20px;  /* Добавили */
}
body.chat-page .gpt-message {
    align-self: flex-start;  /* Было flex-end */
    background: #e5e5ea;
    color: black;
    border-top-left-radius: 0;  /* Было border-top-right-radius */
    border-top-right-radius: 20px;  /* Добавили */
}
body.chat-page .gpt-typing {
    align-self: flex-start;  /* Оставляем слева как сообщения GPT */
    background: #e5e5ea;
    border: 1px solid #dcdcdc;
    border-radius: 20px;
    padding: 14px 18px;
    max-width: 180px;
    margin: 8px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-top-left-radius: 0;  /* Скос слева */
}

body.chat-page .typing-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

body.chat-page .typing-dots {
    display: flex;
    gap: 4px;
}

body.chat-page .typing-dots i {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: #6c757d;
    border-radius: 50%;
    animation: typingBounce 1.4s ease-in-out infinite both;
}

body.chat-page .typing-dots i:nth-child(1) { animation-delay: -0.32s; }
body.chat-page .typing-dots i:nth-child(2) { animation-delay: -0.16s; }

body.chat-page .typing-text {
    font-size: 0.9em;
    color: #6c757d;
    font-style: italic;
    white-space: nowrap;
    font-weight: 500;
}

/* СЕКЦИЯ ВВОДА */
body.chat-page .chat-input-section {
    flex: 0 0 auto;
    padding: 1rem 1.5rem;
    border-top: 2px solid #eee;
    background: #fafafa;
}

body.chat-page .chat-input {
    width: 100%;
    resize: none;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid #ccc;
    font-size: 1rem;
}

/* КНОПКА ОТПРАВКИ */
body.chat-page .send-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    margin-left: 0.75rem;
    transition: all 0.2s ease;
}

body.chat-page .send-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* МАСТЕР ПРЕЗЕНТАЦИИ */
body.chat-page .presentation-wizard {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

body.chat-page .wizard-header {
    text-align: center;
    margin-bottom: 2rem;
}

body.chat-page .wizard-header h3 {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

body.chat-page .wizard-form {
    max-width: 800px;
    margin: 0 auto;
}

body.chat-page .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

body.chat-page .features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

body.chat-page .feature-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
}

body.chat-page .feature-checkbox:hover {
    background: #e9ecef;
}

body.chat-page .wizard-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

body.chat-page .generate-presentation-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
    border-radius: 12px;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    flex: 1;
    transition: all 0.3s ease;
}

body.chat-page .generate-presentation-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.3);
}

body.chat-page .secondary-btn {
    background: #6c757d;
    border: none;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}
/* Стили для форматированного текста GPT */
.gpt-message .formatted-text {
    background: #f8f9fa;
    color: #2d3748;
    padding: 1.25rem;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    line-height: 1.7;
    font-size: 0.95rem;
    max-width: 100%;
    overflow-wrap: break-word;
}

/* Заголовки */
.gpt-message .formatted-text h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
    margin: 1.5rem 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #667eea;
}

.gpt-message .formatted-text h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #4a5568;
    margin: 1.25rem 0 0.75rem 0;
}

.gpt-message .formatted-text h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #718096;
    margin: 1rem 0 0.5rem 0;
}

/* Параграфы */
.gpt-message .formatted-text p {
    margin: 0.75rem 0;
    color: #4a5568;
}

/* Списки */
.gpt-message .formatted-text ul,
.gpt-message .formatted-text ol {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
}

.gpt-message .formatted-text li {
    margin: 0.4rem 0;
    padding-left: 0.5rem;
}

.gpt-message .formatted-text ul li::before {
    content: "•";
    color: #667eea;
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

.gpt-message .formatted-text ol {
    list-style-type: decimal;
}

.gpt-message .formatted-text ol li {
    list-style-type: decimal;
}

/* Выделение текста */
.gpt-message .formatted-text strong {
    color: #2d3748;
    font-weight: 700;
    background: linear-gradient(120deg, #a5b4fc30 0%, #a5b4fc30 100%);
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
}

.gpt-message .formatted-text em {
    color: #718096;
    font-style: italic;
}

.gpt-message .formatted-text del {
    color: #a0aec0;
    text-decoration: line-through;
}

/* Цитаты */
.gpt-message .formatted-text blockquote {
    border-left: 4px solid #667eea;
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    background: #edf2f7;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #4a5568;
}

/* Код */
.gpt-message .formatted-text code {
    background: #2d3748;
    color: #e2e8f0;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
}

.gpt-message .formatted-text pre {
    background: #2d3748;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1rem 0;
    border: 1px solid #4a5568;
}

.gpt-message .formatted-text pre code {
    background: none;
    padding: 0;
    border-radius: 0;
}

/* Ссылки */
.gpt-message .formatted-text a {
    color: #667eea;
    text-decoration: none;
    border-bottom: 1px solid #667eea;
    transition: all 0.2s ease;
}

.gpt-message .formatted-text a:hover {
    color: #5a67d8;
    border-bottom-color: #5a67d8;
}

/* Горизонтальная линия */
.gpt-message .formatted-text hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, #667eea, transparent);
    margin: 1.5rem 0;
}

/* Таблицы */
.gpt-message .formatted-text table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.gpt-message .formatted-text td {
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    text-align: left;
}

.gpt-message .formatted-text tr:nth-child(even) {
    background: #f7fafc;
}
/* Меняем цвет кнопок на белом фоне */
.auth-buttons.scrolled .btn-outline-primary {
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}

.auth-buttons.scrolled .btn-primary {
  background: var(--primary) !important;
  color: white !important;
}

/* Для мобильного меню тоже */
.mobile-menu.scrolled .btn-outline-primary {
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}

.mobile-menu.scrolled .btn-primary {
  background: var(--primary) !important;
  color: white !important;
}
/* Адаптивность */
@media (max-width: 768px) {
    .gpt-message .formatted-text {
        padding: 1rem;
        font-size: 0.9rem;
    }
    
    .gpt-message .formatted-text h1 {
        font-size: 1.3rem;
    }
    
    .gpt-message .formatted-text h2 {
        font-size: 1.1rem;
    }
    
    .gpt-message .formatted-text h3 {
        font-size: 1rem;
    }
}
/* АНИМАЦИИ */
@keyframes messageAppear {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes typingBounce {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    40% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

/* АДАПТИВНОСТЬ */
@media (max-width: 1200px) {
    body.chat-page .chat-main-container {
        flex-direction: column;
        height: auto;
    }

    body.chat-page .form-row {
        grid-template-columns: 1fr;
    }
    
    body.chat-page .features-grid {
        grid-template-columns: 1fr;
    }
    
    body.chat-page .wizard-actions {
        flex-direction: column;
    }
    
}