:root {
    --primary-color: #6c63ff;
    --secondary-color: #f5f5f7;
    --text-color: #333;
    --light-text: #777;
    --user-msg-color: #e1f5fe;
    --bot-msg-color: #f0f4ff;
    --system-msg-color: #f5f5f5;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --settings-width: 250px;
    --settings-bg: white;
    --main-padding: 20px;
}

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

body {
    font-family: 'Roboto', Arial, sans-serif;
    background: linear-gradient(145deg, #f5f7fa, #e5e9f2);
    color: var(--text-color);
    min-height: 100vh;
    padding: var(--main-padding);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.container {
    width: 100%;
    max-width: 800px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 90vh;
}

.header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: var(--secondary-color);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

h1 {
    font-size: 1.5rem;
    font-weight: 500;
    margin-left: 15px;
    color: var(--primary-color);
}

#status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transition: var(--transition);
}

.connected {
    background: #4caf50;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.7);
}

.disconnected {
    background: #f44336;
    box-shadow: 0 0 10px rgba(244, 67, 54, 0.7);
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
    animation: fadeIn 0.3s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    line-height: 1.4;
    margin-bottom: 2px;
}

.message-user {
    align-self: flex-end;
    background-color: var(--user-msg-color);
    border-bottom-right-radius: 4px;
}

.message-assistant {
    align-self: flex-start;
    background-color: var(--bot-msg-color);
    border-bottom-left-radius: 4px;
}

.message-system {
    align-self: center;
    background-color: transparent;
    width: auto;
    text-align: center;
    font-size: 0.85rem;
    color: #999;
    padding: 2px 5px;
    margin: 1px 0;
    box-shadow: none;
}

.input-area {
    display: flex;
    padding: 15px;
    background: var(--secondary-color);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.record-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 24px;
    background: var(--primary-color);
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.record-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 99, 255, 0.4);
}

.record-button:active {
    transform: translateY(1px);
}

.record-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

.record-icon {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: white;
    position: relative;
}

.record-icon.recording {
    animation: pulse 1.5s infinite;
}

#audio-player {
    width: 100%;
    margin-top: 10px;
    outline: none;
    border-radius: 24px;
    height: 40px;
}

/* Animations */
@keyframes fadeIn {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); }
    100% { transform: scale(1); }
}

/* Стили панели настроек */
.settings-panel {
    width: var(--settings-width);
    background: var(--settings-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 20px;
    z-index: 100;
    margin-bottom: 20px;
}

.settings-panel h3 {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: 15px;
    text-align: center;
}

.setting-item {
    margin-bottom: 15px;
}

.setting-item label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-color);
}

.speed-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--text-color);
    background: white;
    transition: var(--transition);
    outline: none;
    cursor: pointer;
}

.speed-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(108, 99, 255, 0.2);
}

/* Стили для выбора стиля */
.style-selection {
    margin-top: 20px;
}

.style-selection h3 {
    margin-top: 15px;
    margin-bottom: 10px;
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--primary-color);
}

.style-selection .mode-list {
    list-style-type: none;
    padding-left: 10px;
}

.style-selection .mode-list li {
    padding: 8px 15px !important;
    display: flex;
    align-items: center;
    margin: 2px 0;
    border-radius: 8px;
    transition: var(--transition);
}

.style-selection .mode-list li:hover {
    background-color: #f8f9fa;
}

.style-selection .mode-list input[type="radio"] {
    margin-right: 10px !important;
    cursor: pointer;
    transform: scale(1.2);
}

.style-selection .mode-list label {
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--text-color);
}

/* Стили для выбора режима */
.mode-selection {
    margin-top: 20px;
}

.mode-selection h3 {
    margin-top: 15px;
    margin-bottom: 10px;
}

.mode-list {
    list-style-type: none;
    padding-left: 10px;
}

.root-list {
    margin-top: 10px;
}

.category-label {
    display: block;
    padding: 6px 10px;
    margin: 2px 0;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    font-size: 0.9rem;
}

.root-list > li > .category-label {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.category-label:before {
    content: '▶';
    font-size: 0.7rem;
    margin-right: 5px;
    display: inline-block;
    transition: transform 0.2s ease;
}

.category-label.expanded:before {
    transform: rotate(90deg);
}

.category-label:hover {
    background-color: rgba(108, 99, 255, 0.1);
}

.sub-list, .options-list {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.sub-list.collapsed, .options-list.collapsed {
    max-height: 0;
}

.options-list li {
    padding: 5px 10px;
    display: flex;
    align-items: center;
}

.options-list input[type="radio"] {
    margin-right: 8px;
    cursor: pointer;
}

.options-list label {
    cursor: pointer;
    font-size: 0.9rem;
}

/* Стили для модального окна авторизации */
.modal {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    width: 90%;
    max-width: 800px;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

.modal-content h2 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

#auth-status {
    margin: 20px 0;
    line-height: 1.5;
}

#auth-status a {
    display: inline-block;
    padding: 10px 20px;
    margin-top: 15px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: var(--transition);
}

#auth-status a:hover {
    background-color: #5750e6;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(108, 99, 255, 0.3);
}

/* Стили для блока информации о пользователе */
.user-info-container {
    margin: 20px 0;
    background-color: white;
    border-radius: 8px;
    padding: 12px;
    box-shadow: var(--shadow);
}

.user-info-container h3 {
    margin-bottom: 10px;
    font-size: 1rem;
    color: var(--primary-color);
}

.user-data {
    max-height: 150px;
    overflow-y: auto;
    font-size: 0.9rem;
    background-color: #f8f9fa;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    word-break: break-all;
}

.user-data pre {
    margin: 0;
    white-space: pre-wrap;
    font-family: monospace;
    font-size: 0.85rem;
    color: #333;
    text-align: left;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 6px;
    overflow-x: auto;
    box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.1);
}

#user-modal-data.user-data {
    max-height: 400px; /* Увеличиваем высоту в ~3 раза */
}

/* Стили для кнопок управления аккаунтом */
.user-actions {
    display: flex;
    margin-top: 12px;
    gap: 8px;
}

.action-button {
    padding: 6px 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.action-button:hover {
    background-color: #5750e6;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(108, 99, 255, 0.3);
}

#logout-btn {
    background-color: #e53935;
}

#logout-btn:hover {
    background-color: #c62828;
}

#refresh-user-btn {
    background-color: #4caf50;
}

#refresh-user-btn:hover {
    background-color: #388e3c;
}

/* Адаптивные стили для разных размеров экрана */
@media screen and (min-width: 1100px) {
    body {
        flex-direction: row;
        justify-content: center;
        align-items: flex-start;
    }

    .settings-panel {
        margin-right: 20px;
        margin-bottom: 0;
    }
}

@media screen and (max-width: 600px) {
    :root {
        --main-padding: 10px;
    }

    .settings-panel {
        width: 100%;
        padding: 15px;
    }

    .container {
        height: 75vh;
    }
}
