
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%); /* Оранжевая градиентная заливка для мото темы */
    height: 100vh;
}

.container {
    height: 100vh;
}

/* Стили аутентификации */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    padding: 20px;
}

.auth-form {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 400px;
}

.auth-form h1 {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 10px;
}

.auth-form h2 {
    color: #34495e;
    text-align: center;
    margin-bottom: 30px;
    font-weight: 300;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #2c3e50;
    font-weight: 500;
}

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

.form-group input:focus {
    outline: none;
    border-color: #3498db;
}

.error-message {
    background: #e74c3c;
    color: white;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
}

/* Стили кнопок */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #e67e22; /* Оранжевый вместо синего */
    color: white;
}

.btn-primary:hover {
    background: #d35400;
}
.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

/* Стили чата */
.chat-container {
    display: flex;
    height: 100vh;
    background: white;
}

.sidebar {
    width: 300px;
    background: #2c3e50;
    color: white;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #34495e;
}

.sidebar-header h3 {
    margin-bottom: 15px;
}

.sidebar-header .btn {
    width: 100%;
}

.conversations-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.conversation-item {
    padding: 12px;
    margin-bottom: 5px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.conversation-item:hover {
    background: #34495e;
}

.conversation-item.active {
    background: #3498db;
}

.conversation-title {
    font-weight: 500;
    margin-bottom: 5px;
}

.conversation-date {
    font-size: 12px;
    opacity: 0.7;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #34495e;
}

.sidebar-footer .btn {
    width: 100%;
}

.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 20px;
    border-bottom: 1px solid #ecf0f1;
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.welcome-message {
    text-align: center;
    padding: 40px 20px;
    color: #7f8c8d;
}

.welcome-message h4 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.example-questions {
    margin-top: 30px;
    text-align: left;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.example-questions ul {
    margin-top: 10px;
    padding-left: 20px;
}

.example-questions li {
    margin-bottom: 8px;
    color: #5d6d7e;
}

.message {
    margin-bottom: 20px;
    max-width: 80%;
    animation: fadeIn 0.3s ease-in;
}

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

.message.user {
    margin-left: auto;
}

.message-content {
    padding: 15px;
    border-radius: 15px;
    position: relative;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.message.user .message-content {
    background: #e67e22; /* Оранжевый вместо синего */
    color: white;
    border-bottom-right-radius: 5px;
}

.message.assistant .message-content {
    background: white;
    border: 1px solid #e1e8ed;
    border-bottom-left-radius: 5px;
}

/* Стили для Markdown контента */
.message.assistant .message-content h1,
.message.assistant .message-content h2,
.message.assistant .message-content h3,
.message.assistant .message-content h4,
.message.assistant .message-content h5,
.message.assistant .message-content h6 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #2c3e50;
}

.message.assistant .message-content h1 {
    font-size: 1.5em;
    border-bottom: 2px solid #e67e22; /* Оранжевый вместо синего */
    padding-bottom: 5px;
}

.message.assistant .message-content h2 {
    font-size: 1.3em;
    border-bottom: 1px solid #bdc3c7;
    padding-bottom: 3px;
}

.message.assistant .message-content p {
    margin-bottom: 10px;
    line-height: 1.5;
}

.message.assistant .message-content ul,
.message.assistant .message-content ol {
    margin: 10px 0;
    padding-left: 25px;
}

.message.assistant .message-content li {
    margin-bottom: 5px;
    line-height: 1.4;
}

.message.assistant .message-content code {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    border: 1px solid #e1e8ed;
}

.message.assistant .message-content pre {
    background: #2c3e50;
    color: white;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 15px 0;
    border: 1px solid #34495e;
}

.message.assistant .message-content pre code {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
}

.message.assistant .message-content blockquote {
    border-left: 4px solid #e67e22; /* Оранжевый вместо синего */
    padding-left: 15px;
    margin: 15px 0;
    color: #7f8c8d;
    font-style: italic;
}
.message.assistant .message-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.message.assistant .message-content th,
.message.assistant .message-content td {
    border: 1px solid #bdc3c7;
    padding: 8px 12px;
    text-align: left;
}

.message.assistant .message-content th {
    background: #ecf0f1;
    font-weight: 600;
}

.message.assistant .message-content tr:nth-child(even) {
    background: #f8f9fa;
}

.message-time {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 5px;
}

/* Обновленная область ввода */
.input-area {
    padding: 20px;
    border-top: 1px solid #ecf0f1;
    background: white;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.input-container {
    max-width: 1200px;
    margin: 0 auto;
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background: white;
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    padding: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.input-wrapper:focus-within {
    border-color: #3498db;
    box-shadow: 0 2px 15px rgba(52, 152, 219, 0.2);
}

#message-input {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    font-size: 16px;
    font-family: inherit;
    line-height: 1.5;
    padding: 8px;
    max-height: 120px;
    min-height: 24px;
    background: transparent;
}

#message-input::placeholder {
    color: #aab8c2;
}
.send-button {
    background: #e67e22; /* Оранжевый вместо синего */
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    color: white;
    gap: 8px;
    font-weight: 500;
}

.send-button:hover {
    background: #d35400;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(230, 126, 34, 0.3);
}

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

.send-button:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.send-text {
    font-size: 14px;
}

.send-icon {
    display: none;
    width: 18px;
    height: 18px;
}

.input-hint {
    font-size: 12px;
    color: #7f8c8d;
    text-align: center;
    margin-top: 8px;
}

/* Индикатор загрузки */
.typing-indicator {
    display: none;
    padding: 15px;
    color: #7f8c8d;
    font-style: italic;
}

.typing-indicator.active {
    display: block;
}

.typing-dots {
    display: inline-block;
}

.typing-dots span {
    animation: typing 1.4s infinite;
    display: inline-block;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% { opacity: 0.3; }
    30% { opacity: 1; }
}

/* Адаптивность */
@media (max-width: 768px) {
    .chat-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: 200px;
    }

    .message {
        max-width: 95%;
    }

    .input-wrapper {
        padding: 10px;
    }

    .send-button {
        padding: 8px 12px;
    }

    .send-text {
        display: none;
    }

    .send-icon {
        display: block;
    }
}

@media (max-width: 480px) {
    .send-button {
        padding: 10px;
        width: 40px;
        height: 40px;
    }
}

/* Скроллбар */
.messages-container::-webkit-scrollbar {
    width: 6px;
}

.messages-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

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

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

/* Добавим в конец файла */

.conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 5px;
}

.conversation-actions {
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.3s;
}

.conversation-item:hover .conversation-actions {
    opacity: 1;
}

.conversation-item.active .conversation-actions {
    opacity: 1;
}

.btn-rename, .btn-delete {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 12px;
    transition: background-color 0.3s;
}

.btn-rename:hover {
    background-color: rgba(52, 152, 219, 0.2);
}

.btn-delete:hover {
    background-color: rgba(231, 76, 60, 0.2);
}

.no-conversations {
    text-align: center;
    color: #bdc3c7;
    padding: 20px;
    font-style: italic;
}