/* Общие настройки для страницы */
body {
    font-family: 'Roboto', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-color: #121212;
    color: #e0e0e0;
}

/* Header styles */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 20px;
    background-color: #1f1f1f;
    color: #e0e0e0;
    font-size: 18px;
    border-bottom: 1px solid #333;
}

.header-title {
    font-weight: bold;
}

#model-select {
    background-color: #333; 
    color: #e0e0e0;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
}

.settings-icon {
    cursor: pointer;
    color: #e0e0e0;
}

.chat-container {
    margin-top: 90px; /* Регулируйте значение по мере необходимости */
    width: 80%;
    max-width: 1200px;
    height: 75vh;
    display: flex;
    flex-direction: column;
    background-color: #1f1f1f;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.7);
    overflow: hidden;
}

.chat-box {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #1f1f1f;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE и Edge */
}

.chat-box::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* Общий стиль для всех сообщений */
.chat-message {
    display: flex;
    margin: 8px 0;
    align-items: center;
    justify-content: center;
    white-space: pre-wrap;
    animation: fadeIn 0.5s ease-in-out;
}

/* Стиль для сообщений пользователя */
.user-message .message {
    background-color: #3a84e9; /* Чуть более мягкий голубой */
    color: #ffffff;
    padding: 10px 16px;
    border-radius: 12px;
    margin-left: auto;
    max-width: 70%;
    word-wrap: break-word;
    font-size: 15px;
    font-weight: 400;
}

/* Стиль для сообщений GPT */
.gpt-message .message {
    background-color: #2e2e2e; /* Чуть светлее для контраста с фоном */
    color: #ffffff;
    padding: 10px 16px;
    border-radius: 12px;
    margin-right: auto;
    max-width: 70%;
    word-wrap: break-word;
    font-size: 15px;
    font-weight: 400;
}

/* Анимация для плавного появления сообщений */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.input-container {
    display: flex;
    align-items: center;
    padding: 10px;
    background-color: #1f1f1f;
    border-top: 1px solid #333;
}

textarea {
    flex: 1;
    padding: 10px;
    border: 1px solid #333;
    border-radius: 7px;
    outline: none;
    resize: none;
    height: 50px;
    max-height: 150px;
    overflow-y: auto;
    margin-right: 10px;
    background-color: #2b2b2b;
    color: #ffffff;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE и Edge */
}

textarea::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

button {
    background-color: #4d4d4d;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 10px 20px;
    cursor: pointer;
    outline: none;
}

button:hover {
    background-color: #5e5e5e;
}

button:focus,
button:active,
button:focus-visible {
    outline: none;
    border: none;
}

.credits {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 14px;
    color: #e0e0e0;
}

.modal-content {
    background-color: #2b2b2b;
    color: #ffffff;
    border-radius: 10px;
    border: none;
}

.modal-header .close {
    color: #ffffff;
}

.modal-footer .btn-primary {
    background-color: #4d4d4d;
    border: none;
}

.modal-footer .btn-primary:hover {
    background-color: #5e5e5e;
}

.loader {
    border: 4px solid #f3f3f3;
    border-radius: 50%;
    border-top: 4px solid #555555;
    width: 20px;
    height: 20px;
    animation: spin 2s linear infinite;
    margin: 0 auto;
}

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

pre {
    position: relative;
    overflow: hidden;
    padding: 16px;
    background-color: #2a2a2a !important;
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
    line-height: 1.5;
    margin: 16px 0;
    font-family: 'Source Code Pro', monospace;
}

.hidden-scrollbar {
    overflow: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.hidden-scrollbar::-webkit-scrollbar {
    display: none;
}

.copy-button {
    position: absolute;
    top: 4px;
    right: 4px;
    background: transparent;
    cursor: pointer;
    border: none;
    color: #ffffff;
    padding: 5px;
    border-radius: 5px;
}

.copy-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Loading Spinner Styles */
.loading-spinner {
    border: 4px solid #f3f3f3; /* Light grey */
    border-top: 4px solid #3498db; /* Blue */
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    margin: 10px auto;
}

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