body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #1a1a1a;
    color: #f0f0f0;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

#chat-container {
    width: 90%;
    max-width: 800px;
    height: 90vh;
    background-color: #2a2a2a;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(255, 77, 77, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#chat-header {
    background-color: transparent;
    color: #ff4d4d;
    padding: 6px 16px; /* Уменьшаем padding для уменьшения высоты */
    text-align: center;
    font-size: 1.2em; /* Уменьшаем шрифт заголовка */
    font-weight: 500;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
    border-bottom: 1px solid #333;
}

#chat-messages {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    padding: 4px 18px;
    border-radius: 9px;
    max-width: 75%;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
    font-size: 0.9em; /* Уменьшаем шрифт на ~20% */
}

.user-message {
    background-color: #ff4d4d;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.bot-message {
    background-color: #333;
    color: #f0f0f0;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.bot-message pre {
    background-color: #2a2a2a;
    border: 1px solid #444;
    padding: 4px;
    border-radius: 5px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: "SF Mono", "Consolas", "Courier New", monospace;
    font-size: 0.9em;
    color: #f0f0f0;
}

/* Стили для выпадающих инструкций */
.instructions-container {
    padding: 0 15px 3px 15px;
    border-bottom: 1px solid #333;
}

.collapsible-card {
    background-color: #333;
    border-radius: 8px;
    margin-bottom: 5px;
    border: 1px solid #444;
}

.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px; /* Уменьшаем padding для уменьшения высоты */
    cursor: pointer;
}

.collapsible-header h5 {
    margin: 0;
    color: #ff774d;
    font-size: 0.9rem; /* Уменьшаем шрифт на 20% от 1.1rem */
}

.collapsible-toggle {
    background: none;
    border: none;
    color: #f0f0f0;
    font-size: 1.2rem;
    transition: transform 0.3s ease;
    padding: 0;
}

.collapsible-toggle.open {
    transform: rotate(180deg);
}

.collapsible-content {
    padding: 0 15px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, padding 0.4s ease-out;
}

.collapsible-content .card-body {
    padding: 15px 0;
    border-top: 1px solid #444;
}
.collapsible-content h6 {
    color: #ff774d;
    margin-top: 10px;
    margin-bottom: 5px;
}
.collapsible-content ul {
    padding-left: 20px;
    margin: 0;
    line-height: 1.6;
}
.collapsible-content code {
    background-color: #2a2a2a;
    padding: 2px 5px;
    border-radius: 4px;
    font-family: "SF Mono", Consolas, "Courier New", monospace;
}

#controls-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: #333;
    border-top: 1px solid #444;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

#data-source-select {
    padding: 8px 12px;
    border: 1px solid #ff8080;
    border-radius: 20px;
    font-size: 0.9em;
    background-color: #242424;
    color: #f0f0f0;
    font-family: inherit;
}

#chat-input-container {
    display: flex;
    padding: 5px;
    border-top: 1px solid #444;
    background-color: #333;
}

#session-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 15px;
    background-color: #333; /* Меняем фон на более темный */
    border-bottom: 1px solid #444; /* Добавляем нижнюю границу */
    font-size: 0.8em;
    margin-bottom: 10px; /* Добавляем отступ снизу */
}

#session-id-display {
    font-family: monospace;
    color: #aaa;
}

#new-session-button {
    padding: 4px 12px;
    border: 1px solid #ff4d4d;
    background-color: transparent;
    color: #ff4d4d;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

#new-session-button:hover {
    background-color: #ff4d4d;
    color: white;
}

#message-input {
    flex-grow: 1;
    padding: 4px;
    border: 1px solid #ff8080;
    border-radius: 20px;
    resize: none;
    font-size: 0.8em; /* Уменьшаем шрифт на 20% */
    margin-right: 10px;
    font-family: inherit;
    line-height: 1.4;
    background-color: #242424;
    color: #f0f0f0;
}

#message-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 77, 77, 0.3);
}

#send-button, #upload-button {
    padding: 12px 20px;
    border: none;
    background-color: #ff4d4d;
    color: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(255,0,0,0.2);
}

#send-button:hover, #upload-button:hover {
    background-color: #ff3333;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255,0,0,0.3);
}

.loading-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.loading-indicator .dot {
    width: 8px;
    height: 8px;
    background-color: #ff774d;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-indicator .dot:nth-child(1) { animation-delay: -0.32s; }
.loading-indicator .dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}
