/* ÃÂ¡ÃÂ¾ÃÂ²Ã‘â‚¬ÃÂµÃÂ¼ÃÂµÃÂ½ÃÂ½Ã‘â€¹ÃÂµ CSS ÃÂ¿ÃÂµÃ‘â‚¬ÃÂµÃÂ¼ÃÂµÃÂ½ÃÂ½Ã‘â€¹ÃÂµ */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --success-color: #4CAF50;
    --warning-color: #ff9800;
    --error-color: #f44336;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --text-muted: rgba(255, 255, 255, 0.6);
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #3a3a3a;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.github-login-btn {
    background: linear-gradient(135deg, #111, #222);
    color: #f5f5f5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.github-login-btn:hover {
    background: linear-gradient(135deg, #222, #111);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.github-login-btn .github-icon svg {
    width: 18px;
    height: 18px;
}

/* VK ID кнопка */
.vk-login-btn {
    background: linear-gradient(135deg, #0077FF, #0066DD);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 119, 255, 0.35);
}

.vk-login-btn:hover {
    background: linear-gradient(135deg, #0066DD, #0055CC);
    box-shadow: 0 4px 14px rgba(0, 119, 255, 0.45);
}

.vk-login-btn .vk-icon svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}

/* ÃÂ¡ÃÂ±Ã‘â‚¬ÃÂ¾Ã‘Â Ã‘ÂÃ‘â€šÃÂ¸ÃÂ»ÃÂµÃÂ¹ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

/* ÃÅ¾Ã‘ÃÂ½ÃÂ¾ÃÂ²ÃÂ½Ã‘â€¹ÃÂµ Ã‘Ã‘â€šÃÂ¸ÃÂ»ÃÂ¸ */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

/* ÃÅ“ÃÂ¾ÃÂ´ÃÂ°ÃÂ»Ã‘Å’ÃÂ½ÃÂ¾ÃÂµ ÃÂ¾ÃÂºÃÂ½ÃÂ¾ ÃÂ°ÃÂ²Ã‘â€šÃÂ¾Ã‘â‚¬ÃÂ¸ÃÂ·ÃÂ°Ã‘â€ ÃÂ¸ÃÂ¸ */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(20px);
}

.auth-content {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-radius: 24px;
    padding: 48px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    animation: slideInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-header {
    margin-bottom: 32px;
    position: relative;
}

.close-auth-btn {
    position: absolute;
    top: 0;
    right: 0;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: var(--transition);
}

.close-auth-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
}

.logo-icon {
    font-size: 32px;
}

.logo-text {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-header h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 16px;
}

.auth-benefits {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    padding: 24px;
    margin-bottom: 32px;
    text-align: left;
}

.auth-benefits h3 {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--accent-color);
}

.auth-benefits ul {
    list-style: none;
}

.auth-benefits li {
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-size: 14px;
}

.auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

.auth-btn {
    padding: 16px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.auth-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.auth-btn:hover::before {
    left: 100%;
}

.auth-btn.primary {
    background: linear-gradient(135deg, var(--success-color), #45a049);
    color: white;
}

.auth-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(76, 175, 80, 0.3);
}

.auth-btn.secondary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.auth-btn.secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(102, 126, 234, 0.3);
}

.auth-btn.skip {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.auth-btn.skip:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.auth-btn.info {
    background: linear-gradient(135deg, var(--warning-color), #f57c00);
    color: white;
}

.auth-btn.info:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(255, 152, 0, 0.3);
}

/* Google Button - Premium Style */
.auth-btn.google {
    background: #ffffff;
    color: #3c4043;
    border: none;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.auth-btn.google:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(66, 133, 244, 0.3);
    background: #f8f9fa;
}

.google-btn-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 24px;
    width: 100%;
}

.google-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #fff;
    border-radius: 4px;
}

.google-btn-text {
    font-weight: 500;
    font-size: 15px;
    color: #3c4043;
}

/* Puter Button */
.auth-btn.puter {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.auth-btn.puter:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

.btn-icon {
    font-size: 18px;
}

/* User Section - Google Sign-In */
.user-section {
    width: 100%;
    margin-bottom: 8px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    width: 100%;
}

.user-avatar-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
}

.puter-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border: 2px solid var(--primary-color);
}

.user-info-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.user-info-details .user-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sign-out-btn {
    padding: 6px 12px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    width: fit-content;
}

.sign-out-btn:hover {
    background: rgba(244, 67, 54, 0.2);
    border-color: var(--error-color);
    color: var(--error-color);
}

/* Google Sign-In Button Override */
.g_id_signin {
    width: 100% !important;
}

.g_id_signin > div {
    width: 100% !important;
}

.g_id_signin iframe {
    width: 100% !important;
}

/* Settings Styles */
.settings-label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.settings-select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.settings-select:hover {
    border-color: var(--primary-color);
}

.settings-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.settings-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.auth-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.05);
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-muted);
}

.status-indicator.success {
    background: var(--success-color);
    animation: pulse 2s infinite;
}

.status-indicator.error {
    background: var(--error-color);
    animation: pulse 2s infinite;
}

.status-indicator.loading {
    background: var(--warning-color);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ÃÅ¾Ã‘ÂÃÂ½ÃÂ¾ÃÂ²ÃÂ½ÃÂ¾ÃÂµ ÃÂ¿Ã‘â‚¬ÃÂ¸ÃÂ»ÃÂ¾ÃÂ¶ÃÂµÃÂ½ÃÂ¸ÃÂµ */
.app {
    display: flex;
    min-height: 100vh;
    height: 100vh;
    background: var(--bg-primary);
    align-items: stretch;
    margin: 0;
    padding: 0;
    position: relative;
}

/* ÐšÐ½Ð¾Ð¿ÐºÐ° Ð¾Ñ‚ÐºÑ€Ñ‹Ñ‚Ð¸Ñ/Ð·Ð°ÐºÑ€Ñ‹Ñ‚Ð¸Ñ ÑÐ°Ð¹Ð´Ð±Ð°Ñ€Ð° */
.sidebar-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 24px;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
}

.sidebar-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.sidebar-toggle .toggle-icon {
    transition: var(--transition);
}

/* ÃÂ¡ÃÂ°ÃÂ¹ÃÂ´ÃÂ±ÃÂ°Ã‘â‚¬ */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 320px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(20px);
    height: 100vh;
    overflow-y: auto;
    box-sizing: border-box;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.logo-img {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.25));
}

.logo-text-block {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.logo-icon {
    font-size: 24px;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-tagline {
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Ð¡ÑÑ‹Ð»ÐºÐ° Ð½Ð° Telegram ÐºÐ°Ð½Ð°Ð» */
.telegram-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #0088cc, #006699);
    border-radius: var(--border-radius);
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    margin: 16px 0;
    transition: var(--transition);
    justify-content: center;
}

.telegram-link:hover {
    background: linear-gradient(135deg, #006699, #0088cc);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 136, 204, 0.4);
}

.telegram-icon {
    font-size: 18px;
}

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

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    margin-top: 16px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.user-status {
    font-size: 12px;
    color: var(--text-muted);
}

.user-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: var(--transition);
}

.action-btn img,
.action-btn svg {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.action-btn.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-weight: 500;
    width: auto;
    padding: 8px 16px;
    gap: 8px;
}

.action-btn.primary:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.sidebar-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.models-section, .actions-section, .settings-section, .chat-history-section {
    margin-bottom: 32px;
}

.models-section h3, .actions-section h3, .settings-section h3, .chat-history-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--accent-color);
}

/* Ð˜ÑÑ‚Ð¾Ñ€Ð¸Ñ Ñ‡Ð°Ñ‚Ð¾Ð² */
.chat-history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.chat-history-item {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    position: relative;
}

.chat-history-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
}

.chat-history-item.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.chat-history-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-history-item.active .chat-history-title {
    color: white;
}

.chat-history-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-muted);
}

.chat-history-item.active .chat-history-meta {
    color: rgba(255, 255, 255, 0.8);
}

.chat-history-date {
    font-size: 11px;
}

.chat-history-count {
    font-size: 11px;
}

.chat-history-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: rgba(244, 67, 54, 0.2);
    border: none;
    border-radius: 50%;
    color: var(--error-color);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: var(--transition);
}

.chat-history-item:hover .chat-history-delete {
    display: flex;
}

.chat-history-delete:hover {
    background: var(--error-color);
    color: white;
}

.chat-history-empty {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 14px;
}

/* Ð’Ñ‹Ð¿Ð°Ð´Ð°ÑŽÑ‰Ð¸Ð¹ ÑÐµÐ»ÐµÐºÑ‚Ð¾Ñ€ Ð¼Ð¾Ð´ÐµÐ»ÐµÐ¹ */
.model-selector-container {
    position: relative;
    margin-bottom: 16px;
}

.model-selector-dropdown {
    position: relative;
    width: 100%;
}

.model-selector-btn {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
}

.model-selector-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
}

.model-selector-current {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.model-name {
    flex: 1;
}

.model-arrow {
    font-size: 12px;
    margin-left: 8px;
    transition: var(--transition);
}

.model-selector-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.model-selector-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid var(--border-color);
}

.model-selector-item:last-child {
    border-bottom: none;
}

.model-selector-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.model-selector-item.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
    border-left: 3px solid var(--primary-color);
}

.model-selector-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.model-selector-desc {
    font-size: 12px;
    color: var(--text-muted);
}

/* Ð¡ÐµÐ»ÐµÐºÑ‚Ð¾Ñ€ Ð³Ð¾Ð»Ð¾ÑÐ¾Ð² */
.voice-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.voice-selector-item {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.voice-selector-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
}

.voice-selector-item.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.voice-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.voice-selector-item.active .voice-name {
    color: white;
}

.voice-desc {
    font-size: 12px;
    color: var(--text-muted);
}

.voice-selector-item.active .voice-desc {
    color: rgba(255, 255, 255, 0.8);
}


.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-buttons .action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    width: 100%;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
}

/* ÃÅ¾Ã‘ÂÃÂ½ÃÂ¾ÃÂ²ÃÂ½ÃÂ°Ã‘Â ÃÂ¾ÃÂ±ÃÂ»ÃÂ°Ã‘ÂÃ‘â€šÃ‘Å’ Ã‘â€¡ÃÂ°Ã‘â€šÃÂ° */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    min-height: 100vh;
    margin-left: 0;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.open ~ .main-content {
    margin-left: 320px;
}

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

.chat-messages {
    height: 100%;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Пустой чат: центрируем область ввода */
.app.chat-empty .main-content {
    justify-content: center;
}

.app.chat-empty .chat-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.app.chat-empty .chat-messages {
    display: none;
}

.app.chat-empty .input-container {
    max-width: 720px;
    margin: 0 auto 80px;
}

/* ÃÂ¡ÃÂ¾ÃÂ¾ÃÂ±Ã‘â€°ÃÂµÃÂ½ÃÂ¸Ã‘Â */
.message {
    display: flex;
    gap: 16px;
    max-width: 85%;
    animation: messageSlideIn 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message.assistant {
    align-self: flex-start;
}

.message-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    overflow: hidden;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.message.user .message-avatar {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.message.assistant .message-avatar {
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
}

.message-content {
    flex: 1;
    background: linear-gradient(135deg, rgba(45, 45, 45, 0.95), rgba(58, 58, 58, 0.95));
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    position: relative;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.message.user .message-content {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9), rgba(118, 75, 162, 0.9));
    border: 1px solid rgba(240, 147, 251, 0.3);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.message-sender {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.message.user .message-sender {
    color: rgba(255, 255, 255, 0.95);
}

.message-text {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-primary);
    font-weight: 400;
}

.message-text pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 8px 0;
}

.message-text code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.message-table-wrapper {
    margin: 12px 0;
    border-radius: 12px;
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.message-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.15);
}

.message-table th,
.message-table td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    text-align: left;
}

.message-table th {
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.message-table tr:last-child td {
    border-bottom: none;
}

.message-table th:last-child,
.message-table td:last-child {
    border-right: none;
}

/* Ð‘Ð»Ð¾ÐºÐ¸ ÐºÐ¾Ð´Ð° Ñ ÐºÐ½Ð¾Ð¿ÐºÐ°Ð¼Ð¸ */
.code-block-wrapper {
    background: #1e1e1e;
    border-radius: 12px;
    margin: 16px 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.code-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.code-language {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.code-actions {
    display: flex;
    gap: 8px;
}

.code-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.code-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.code-action-btn:active {
    transform: translateY(0);
}

.code-action-btn span {
    font-size: 14px;
}

.code-block-wrapper pre {
    margin: 0;
    padding: 16px;
    background: #1e1e1e;
    overflow-x: auto;
}

.code-block-wrapper code {
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #d4d4d4;
    background: none;
    padding: 0;
}

/* Ð˜Ð½Ð»Ð°Ð¹Ð½ ÐºÐ¾Ð´ */
.inline-code {
    background: rgba(102, 126, 234, 0.2);
    color: var(--accent-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 13px;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

/* Ð£Ð²ÐµÐ´Ð¾Ð¼Ð»ÐµÐ½Ð¸Ñ */
.notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 16px 24px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition);
    max-width: 400px;
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
}

.notification.notification-success {
    border-left: 4px solid var(--success-color);
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1), var(--bg-secondary));
}

.notification.notification-error {
    border-left: 4px solid var(--error-color);
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.1), var(--bg-secondary));
}

.notification.notification-info {
    border-left: 4px solid var(--primary-color);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), var(--bg-secondary));
}

.message-meta {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 11px;
    color: var(--text-muted);
}

.message-model {
    display: flex;
    align-items: center;
    gap: 4px;
}

.message-time {
    display: flex;
    align-items: center;
    gap: 4px;
}

.message-text {
    cursor: grab;
    user-select: text;
}

.message-text:active {
    cursor: grabbing;
}

.message-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    opacity: 0;
    transition: var(--transition);
}

.message:hover .message-actions {
    opacity: 1;
}

.message-actions .action-btn {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
}

/* ÃÂ¡ÃÂµÃÂ»ÃÂµÃÂºÃ‘â€šÃÂ¾Ã‘â€žÃÂ¸ ÃÂ² input bar */
.input-model-selector,
.input-voice-selector {
    position: relative;
    z-index: 11002;
}

.input-selector-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #2f2f2f;
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

/* ==================== Search Sources ==================== */
.search-sources {
    margin-top: 16px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.05));
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
    animation: slideIn 0.3s ease-out;
}

.search-sources::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
}

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

.sources-header {
    font-weight: 600;
    font-size: 14px;
    color: var(--primary-color);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sources-header::before {
    content: '✓';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
}

.sources-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.source-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.source-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s;
}

.source-item:hover::before {
    opacity: 0.15;
}

.source-item:hover {
    color: var(--text-primary);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.source-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    position: relative;
    z-index: 1;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.source-title {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    position: relative;
    z-index: 1;
}

.source-domain {
    font-size: 10px;
    opacity: 0.7;
    margin-left: 4px;
}

/* Индикатор "прочитано AI" */
.source-read-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: var(--primary-color);
    margin-left: 8px;
    padding: 2px 6px;
    background: rgba(102, 126, 234, 0.2);
    border-radius: 8px;
}

.source-read-indicator::before {
    content: '👁️';
    font-size: 10px;
}

/* ==================== Related Questions ==================== */
.related-questions {
    margin-top: 16px;
    padding: 12px;
    background: rgba(52, 168, 83, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(52, 168, 83, 0.2);
}

.related-header {
    font-weight: 600;
    font-size: 13px;
    color: #34a853;
    margin-bottom: 10px;
}

.related-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.related-question-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    font-size: 13px;
    color: var(--text-secondary);
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
}

.related-question-btn:hover {
    background: rgba(52, 168, 83, 0.2);
    border-color: #34a853;
    color: var(--text-primary);
    transform: translateX(4px);
}

.question-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.question-text {
    flex: 1;
    line-height: 1.4;
}

/* ==================== Suggested Questions ==================== */
.suggested-questions {
    margin: 20px 0;
    padding: 16px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    border-radius: 16px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    animation: fadeIn 0.5s ease-in-out;
}

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

.suggested-questions-header {
    font-weight: 600;
    font-size: 14px;
    color: var(--primary-color);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.suggested-questions-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.suggested-question-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    font-size: 14px;
    color: var(--text-secondary);
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
}

.suggested-question-btn:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.15));
    border-color: var(--primary-color);
    color: var(--text-primary);
    transform: translateX(6px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.suggested-question-btn .question-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.suggested-question-btn .question-text {
    flex: 1;
    line-height: 1.5;
    font-weight: 500;
}

/* ==================== Active Button States ==================== */
.input-actions .action-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transform: scale(1.05);
}

#search-btn.active {
    background: linear-gradient(135deg, #4285f4, #34a853);
}

#think-btn.active {
    background: linear-gradient(135deg, #ff6b6b, #ffa726);
}

/* ÃÅ¾ÃÂ±ÃÂ»ÃÂ°Ã‘ÂÃ‘â€šÃ‘Å’ ÃÂ²ÃÂ²ÃÂ¾ÃÂ´ÃÂ° */
.input-container {
    padding: 24px 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: radial-gradient(circle at top left, rgba(102, 126, 234, 0.08), transparent 55%), var(--bg-secondary);
    position: relative;
    z-index: 9000;
}

.attached-files {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
}

.attached-files-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
}

.clear-files-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition);
}

.clear-files-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.attached-files-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.attached-file {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 12px;
}

.remove-file-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 2px;
    border-radius: 4px;
    transition: var(--transition);
}

.remove-file-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.input-area {
    background: rgba(25, 25, 28, 0.98);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: visible;
    position: relative;
    z-index: 10001;
    transition: var(--transition);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.65);
    max-width: 1040px;
    margin: 0 auto;
}

/* Ð¡Ñ‚Ð¸Ð»Ð¸ Ð´Ð»Ñ Drag & Drop */
.input-area.drag-over {
    background: rgba(102, 126, 234, 0.2);
    border-color: var(--primary-color);
    border-width: 2px;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.4);
}

.input-area.drag-over::before {
    content: 'ðŸ“Ž ÐžÑ‚Ð¿ÑƒÑÑ‚Ð¸Ñ‚Ðµ Ñ„Ð°Ð¹Ð»Ñ‹ ÑÑŽÐ´Ð°';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
    pointer-events: none;
    z-index: 10002;
    background: rgba(0, 0, 0, 0.8);
    padding: 12px 24px;
    border-radius: 8px;
    white-space: nowrap;
}

.input-wrapper {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px 18px;
    min-height: 90px;
}

#message-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    outline: none;
    font-family: inherit;
    min-height: 70px;
    max-height: 260px;
}

#message-input::placeholder {
    color: var(--text-muted);
}

/* Мобильные устройства */
@media (max-width: 480px) {
    .input-wrapper {
        padding: 12px;
    }
    
    /* Вся нижняя панель (модель, голос, кнопки) в одну строку */
    .input-right-controls {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: nowrap;           /* без переноса */
        overflow-x: auto;            /* горизонтальный скролл при необходимости */
        padding-bottom: 4px;
    }

    .input-model-selector,
    .input-voice-selector {
        flex: 0 0 auto;              /* не растягиваем, но не даём сжиматься до 0 */
    }

    .input-selector-btn {
        padding: 6px 10px;
        min-width: 110px;            /* чуть компактнее, чтобы больше влезало */
        font-size: 12px;
    }

    .input-actions {
        flex: 0 0 auto;
        gap: 6px;
    }

    .send-btn {
        width: 36px;
        height: 36px;
    }

    /* Выпадающее меню выбора модели/голоса на мобильных — отдельный снизу слой */
    .input-selector-menu, .model-selector-menu {
        position: fixed !important;
        left: 12px !important;
        right: 12px !important;
        bottom: 80px !important; /* немного над панелью ввода */
        top: auto !important;
        max-height: 60vh !important;
        z-index: 12000 !important;
    }
}

/* ÃÂ¡ÐµÐ»ÐµÐºÑ‚Ð¾Ñ€Ñ‹ Ð² input bar */
.input-model-selector,
.input-voice-selector {
    position: relative;
    z-index: 11002;
}

.input-selector-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #2f2f2f;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    min-width: 140px;
    position: relative;
    z-index: 11002;
}

.input-voice-selector .input-selector-btn {
    min-width: 130px;
}

.input-selector-btn:hover {
    background: #3a3a3a;
    border-color: var(--primary-color);
}

.selector-icon {
    font-size: 14px;
    flex-shrink: 0;
}

.selector-text {
    font-size: 13px;
    flex: 1;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.selector-arrow {
    font-size: 10px;
    transition: var(--transition);
    flex-shrink: 0;
}

.input-selector-btn.open .selector-arrow {
    transform: rotate(180deg);
}

/* ÐœÐµÐ½ÑŽ ÑÐµÐ»ÐµÐºÑ‚Ð¾Ñ€Ð¾Ð² Ð² input bar - Ð¾Ñ‚ÐºÑ€Ñ‹Ð²Ð°ÑŽÑ‚ÑÑ Ð’Ð’Ð•Ð Ð¥ */
.input-selector-menu, .model-selector-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    max-height: 320px;
    overflow-y: auto;
    z-index: 10000;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.input-selector-menu .model-selector-item,
.input-selector-menu .voice-selector-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: var(--bg-secondary);
}

.input-selector-menu .model-selector-item:first-child,
.input-selector-menu .voice-selector-item:first-child {
    border-top-left-radius: 11px;
    border-top-right-radius: 11px;
}

.input-selector-menu .model-selector-item:last-child,
.input-selector-menu .voice-selector-item:last-child {
    border-bottom: none;
    border-bottom-left-radius: 11px;
    border-bottom-right-radius: 11px;
}

.input-selector-menu .model-selector-item:hover,
.input-selector-menu .voice-selector-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.input-selector-menu .model-selector-item.active,
.input-selector-menu .voice-selector-item.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3), rgba(118, 75, 162, 0.3));
    border-left: 3px solid var(--primary-color);
}

.input-selector-menu .model-selector-name,
.input-selector-menu .voice-name {
    font-weight: 600;
    font-size: 13px;
    color: #fff;
    margin-bottom: 2px;
}

.input-selector-menu .model-selector-desc,
.input-selector-menu .voice-desc {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
}

.input-right-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.input-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

#think-btn,
#deep-think-btn {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: #a0a0a0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: var(--transition);
}

#think-btn:hover,
#deep-think-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    transform: scale(1.05);
}

#think-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

#deep-think-btn.active {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    border-color: #9b59b6;
    color: white;
    box-shadow: 0 4px 12px rgba(155, 89, 182, 0.4);
}

.send-btn {
    width: 38px;
    height: 38px;
    border: 1.5px solid rgba(0, 0, 0, 0.85);
    border-radius: 50%;
    background: #ffffff;
    color: #000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.send-btn:hover {
    background: #000;
    color: #fff;
    border-color: #000;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.send-btn:active {
    transform: scale(0.98);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.send-btn .send-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.send-btn .send-icon svg {
    width: 20px;
    height: 20px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.send-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
    background: #f5f5f5;
    border-color: rgba(0, 0, 0, 0.2);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ÃÅ“ÃÂ¾ÃÂ´ÃÂ°ÃÂ»Ã‘Å’ÃÂ½ÃÂ¾ÃÂµ ÃÂ¾ÃÂºÃÂ½ÃÂ¾ ÃÂ³ÃÂµÃÂ½ÃÂµÃ‘â‚¬ÃÂ°Ã‘â€ ÃÂ¸ÃÂ¸ ÃÂ¸ÃÂ·ÃÂ¾ÃÂ±Ã‘â‚¬ÃÂ°ÃÂ¶ÃÂµÃÂ½ÃÂ¸ÃÂ¹ */
.image-generation-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(20px);
}

.image-generation-modal.active {
    display: flex;
}

.image-generation-content {
    background: var(--bg-secondary);
    border-radius: 24px;
    padding: 32px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.image-generation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.image-generation-header h3 {
    font-size: 20px;
    font-weight: 600;
}

.close-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: var(--transition);
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.image-prompt-section, .image-model-section {
    margin-bottom: 24px;
}

.image-prompt-section label, .image-model-section label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--accent-color);
}

#image-prompt, #image-model {
    width: 100%;
    padding: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
}

#image-prompt {
    resize: vertical;
    min-height: 80px;
}

#image-prompt::placeholder {
    color: var(--text-muted);
}

.generate-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: var(--border-radius);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(102, 126, 234, 0.3);
}

.image-result {
    margin-top: 24px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.image-preview {
    margin-bottom: 16px;
}

.image-preview img {
    max-width: 100%;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.image-actions-result {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.image-actions-result .action-btn {
    flex: 1;
    min-width: 120px;
}

/* Референсное изображение */
.image-reference-section {
    margin-top: 16px;
}

.image-reference-section label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--accent-color);
}

.reference-upload-area {
    position: relative;
}

.upload-btn {
    width: 100%;
    padding: 12px;
    background: var(--bg-tertiary);
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.upload-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

#reference-preview {
    position: relative;
    display: inline-block;
}

#reference-preview img {
    max-width: 200px;
    border-radius: 8px;
    border: 2px solid var(--primary-color);
}

.remove-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: var(--error-color);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-btn:hover {
    transform: scale(1.1);
}

.generated-image-message {
    padding: 12px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 12px;
}

.generated-image-message img {
    max-width: 100%;
    border-radius: 8px;
}

/* ÃÂÃÂ´ÃÂ°ÃÂ¿Ã‘â€šÃÂ¸ÃÂ²ÃÂ½ÃÂ¾Ã‘ÂÃ‘â€šÃ‘Å’ */
@media (max-width: 768px) {
    .sidebar {
        width: 280px;
    }
    
    .message {
        max-width: 90%;
    }
    
    .auth-content {
        padding: 32px 24px;
    }
    
    .image-generation-content {
        padding: 24px;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 100%;
        position: fixed;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        width: 100%;
    }
    
    .message {
        max-width: 95%;
    }
    
    .input-actions {
        flex-wrap: wrap;
    }
}

/* ÃÂ¡ÃÂºÃ‘â‚¬ÃÂ¾ÃÂ»ÃÂ»ÃÂ±ÃÂ°Ã‘â‚¬ */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ÃÂ¡Ã‘â€šÃÂ¸ÃÂ»ÃÂ¸ ÃÂ´ÃÂ»Ã‘Â ÃÂºÃÂ½ÃÂ¾ÃÂ¿ÃÂºÃÂ¸ ÃÂ²Ã‘â€¦ÃÂ¾ÃÂ´ÃÂ° ÃÂ² ÃÂ²ÃÂµÃ‘â‚¬Ã‘â€¦ÃÂ½ÃÂµÃÂ¹ Ã‘â€¡ÃÂ°Ã‘ÂÃ‘â€šÃÂ¸ */
 .login-section {
    margin: 8px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-start;
 }

.login-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.login-btn:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.login-btn .btn-icon {
    font-size: 14px;
}

/* ÃÂ¡ÃÂºÃ‘â‚¬Ã‘â€¹ÃÂ²ÃÂ°ÃÂµÃÂ¼ ÃÂºÃÂ½ÃÂ¾ÃÂ¿ÃÂºÃ‘Æ’ ÃÂ²Ã‘â€¦ÃÂ¾ÃÂ´ÃÂ° ÃÂºÃÂ¾ÃÂ³ÃÂ´ÃÂ° ÃÂ¿ÃÂ¾ÃÂ»Ã‘Å’ÃÂ·ÃÂ¾ÃÂ²ÃÂ°Ã‘â€šÃÂµÃÂ»Ã‘Å’ ÃÂ°ÃÂ²Ã‘â€šÃÂ¾Ã‘â‚¬ÃÂ¸ÃÂ·ÃÂ¾ÃÂ²ÃÂ°ÃÂ½ */
.user-info ~ .login-section {
    display: none;
}
/* Ð˜Ð½Ð´Ð¸ÐºÐ°Ñ‚Ð¾Ñ€ Ñ€Ð°ÑÑÑƒÐ¶Ð´ÐµÐ½Ð¸Ñ (thinking indicator) */
.message.thinking {
    opacity: 0.95;
    animation: thinkingPulse 2s ease-in-out infinite;
}

@keyframes thinkingPulse {
    0%, 100% {
        opacity: 0.95;
    }
    50% {
        opacity: 1;
    }
}

.thinking-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.thinking-text {
    font-weight: 600;
    font-size: 14px;
    color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.thinking-dots {
    display: flex;
    gap: 4px;
}

.thinking-dots .dot {
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: dotBounce 1.4s infinite ease-in-out both;
}

.thinking-dots .dot:nth-child(1) {
    animation-delay: -0.32s;
}

.thinking-dots .dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes dotBounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Ð¡Ñ‚Ñ€Ð¸Ð¼Ð¸Ð½Ð³ Ð¸Ð½Ð´Ð¸ÐºÐ°Ñ‚Ð¾Ñ€ */
.streaming-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    font-style: italic;
}

.streaming-indicator .thinking-dots {
    font-weight: 500;
}

.streaming-indicator .dots {
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

/* Блок рассуждений - тёмное поле */
.reasoning-block {
    background: rgba(0, 0, 0, 0.5);
    border-left: 3px solid rgba(102, 126, 234, 0.4);
    border-radius: 8px;
    padding: 16px 20px;
    margin: 12px 0;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    line-height: 1.7;
}

.reasoning-block strong {
    color: rgba(102, 126, 234, 0.7);
}

.reasoning-block ul {
    margin: 8px 0;
    padding-left: 20px;
}

.reasoning-block li {
    margin: 4px 0;
    color: rgba(255, 255, 255, 0.45);
}

/* Разделитель после рассуждений */
.reasoning-divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 16px 0;
}

/* Основной ответ после рассуждений */
.main-response {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    line-height: 1.6;
}

.message.streaming {
    opacity: 0.9;
    border-left: 3px solid var(--primary-color);
}

.streaming-text {
    position: relative;
}

.error-message {
    display: none !important;
}
.reasoning-block {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    padding: 16px;
    margin: 12px 0;
    font-family: 'Inter', monospace;
}

.reasoning-block .reasoning-tag {
    color: #667eea;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    display: block;
}

.reasoning-block .analysis-section {
    background: rgba(102, 126, 234, 0.1);
    border-left: 3px solid #667eea;
    padding: 12px;
    margin: 8px 0;
    border-radius: 6px;
}

.reasoning-block .plan-section {
    background: rgba(76, 175, 80, 0.1);
    border-left: 3px solid #4CAF50;
    padding: 12px;
    margin: 8px 0;
    border-radius: 6px;
}

.reasoning-block .risks-section {
    background: rgba(255, 152, 0, 0.1);
    border-left: 3px solid #ff9800;
    padding: 12px;
    margin: 8px 0;
    border-radius: 6px;
}

.action-section {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 16px;
    border-radius: 12px;
    margin: 16px 0;
    font-weight: 500;
}

.action-section::before {
    content: "ðŸŽ¯ Ð”Ð•Ð™Ð¡Ð¢Ð’Ð˜Ð•";
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
    opacity: 0.9;
}

/* Ð¡Ñ‚Ð¸Ð»Ð¸ Ð´Ð»Ñ Ð±Ð»Ð¾ÐºÐ° Ñ€Ð°ÑÑÑƒÐ¶Ð´ÐµÐ½Ð¸Ñ (reasoning) */
.message-reasoning {
	background: rgba(0, 0, 0, 0.95);
	border-radius: 10px;
	padding: 10px 14px;
	margin-bottom: 8px;
	border: 1px solid rgba(255, 255, 255, 0.02);
}

.reasoning-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.reasoning-title {
	display: flex;
	align-items: center;
	gap: 8px;
    font-weight: 400;
    font-size: 13px;
    color: #505050;
}

.reasoning-time {
    font-size: 11px;
    color: #404040;
    font-style: italic;
}

.reasoning-content {
	margin-top: 8px;
	font-size: 11.5px;
	line-height: 1.5;
	color: #606060;
	font-style: italic;
	opacity: 0.7;
}

.reasoning-content ul {
    margin: 8px 0;
    padding-left: 20px;
}

.reasoning-content li {
    margin: 4px 0;
    color: #606060;
}

.reasoning-content li::marker {
    color: #505050;
}

.message-answer {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ÃÂ¡Ã‘â€šÃÂ¸ÃÂ»ÃÂ¸ ÃÂ´ÃÂ»Ã‘Â ÃÂ´ÃÂµÃÂ¼ÃÂ¾-Ã‘â‚¬ÃÂµÃÂ¶ÃÂ¸ÃÂ¼ÃÂ° */
/* ÐŸÐµÑ€ÐµÐºÐ»ÑŽÑ‡Ð°Ñ‚ÐµÐ»ÑŒ Ð°Ð²Ñ‚Ð¾Ð¾Ð·Ð²ÑƒÑ‡Ð¸Ð²Ð°Ð½Ð¸Ñ */
.auto-tts-toggle {
    margin-top: 12px;
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.toggle-switch input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    transition: var(--transition);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(20px);
}

.toggle-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.toggle-switch:hover .toggle-label {
    color: var(--text-primary);
}

.demo-timer {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 12px;
    padding: 12px;
    margin: 12px 0;
    text-align: center;
    color: white;
}

.demo-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
}

.demo-icon {
    font-size: 16px;
}

.demo-countdown {
    font-size: 24px;
    font-weight: 700;
    font-family: 'Inter', monospace;
    margin: 8px 0;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.demo-login-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: white;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 auto;
}

.demo-login-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.login-section {
    margin: 12px 0;
}

.login-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 8px;
    color: white;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: center;
}

.login-btn:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* ÃÂÃÂ½ÃÂ¸ÃÂ¼ÃÂ°Ã‘â€ ÃÂ¸ÃÂ¸ ÃÂ·ÃÂ°ÃÂ³Ã‘â‚¬Ã‘Æ’ÃÂ·ÃÂºÃÂ¸ */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Реклама Busya Translate */
.promo-section {
    margin-top: 24px;
}

.promo-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 16px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.promo-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.2);
    border-color: var(--primary-color);
}

.promo-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle at top right, rgba(240, 147, 251, 0.2), transparent 70%);
    pointer-events: none;
}

.promo-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.promo-icon {
    font-size: 24px;
    background: rgba(255, 255, 255, 0.1);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.promo-title {
    font-weight: 700;
    font-size: 16px;
    background: linear-gradient(135deg, #fff, #e0e0e0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.promo-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 16px;
}

.promo-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
    text-decoration: none;
}

.promo-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.promo-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==================== Voice Call Modal ==================== */

.voice-call-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.voice-call-overlay.active {
    display: flex;
    opacity: 1;
}

.voice-call-modal {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Фоновые анимированные круги */
.voice-call-background {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.pulse-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid rgba(102, 126, 234, 0.3);
    animation: pulse-expand 3s ease-out infinite;
}

.pulse-ring-1 {
    width: 200px;
    height: 200px;
    animation-delay: 0s;
}

.pulse-ring-2 {
    width: 300px;
    height: 300px;
    animation-delay: 1s;
}

.pulse-ring-3 {
    width: 400px;
    height: 400px;
    animation-delay: 2s;
}

@keyframes pulse-expand {
    0% {
        transform: scale(0.8);
        opacity: 0.8;
        border-color: rgba(102, 126, 234, 0.6);
    }
    100% {
        transform: scale(2);
        opacity: 0;
        border-color: rgba(102, 126, 234, 0);
    }
}

/* Основной контент */
.voice-call-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 40px;
}

/* Аватар */
.voice-call-avatar {
    position: relative;
    width: 160px;
    height: 160px;
}

.avatar-glow {
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.4) 0%, transparent 70%);
    animation: glow-pulse 2s ease-in-out infinite alternate;
}

@keyframes glow-pulse {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    100% {
        transform: scale(1.1);
        opacity: 1;
    }
}

.avatar-inner {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 8px;
    box-shadow: 
        0 0 60px rgba(102, 126, 234, 0.5),
        0 0 100px rgba(118, 75, 162, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.avatar-inner img {
    width: 80%;
    height: 80%;
    object-fit: contain;
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.3));
}

/* Визуализатор звука */
.voice-visualizer {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 40px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.voice-visualizer.active {
    opacity: 1;
}

.visualizer-bar {
    width: 6px;
    background: linear-gradient(to top, #667eea, #764ba2);
    border-radius: 3px;
    animation: visualizer-wave 0.5s ease-in-out infinite alternate;
}

.visualizer-bar:nth-child(1) { height: 15px; animation-delay: 0s; }
.visualizer-bar:nth-child(2) { height: 25px; animation-delay: 0.1s; }
.visualizer-bar:nth-child(3) { height: 35px; animation-delay: 0.2s; }
.visualizer-bar:nth-child(4) { height: 40px; animation-delay: 0.3s; }
.visualizer-bar:nth-child(5) { height: 35px; animation-delay: 0.2s; }
.visualizer-bar:nth-child(6) { height: 25px; animation-delay: 0.1s; }
.visualizer-bar:nth-child(7) { height: 15px; animation-delay: 0s; }

@keyframes visualizer-wave {
    0% {
        transform: scaleY(0.5);
    }
    100% {
        transform: scaleY(1);
    }
}

/* Статус звонка */
.voice-call-status {
    text-align: center;
    margin-top: 20px;
}

.voice-call-title {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 8px;
    text-shadow: 0 0 30px rgba(102, 126, 234, 0.5);
}

.voice-call-state {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    animation: fade-in-out 2s ease-in-out infinite;
}

.voice-call-state.listening {
    color: #4ade80;
    animation: none;
}

.voice-call-state.speaking {
    color: #667eea;
    animation: none;
}

.voice-call-state.thinking {
    color: #fbbf24;
}

@keyframes fade-in-out {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Транскрипция */
.voice-call-transcript {
    max-width: 500px;
    min-height: 60px;
    text-align: center;
    padding: 16px 24px 28px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.voice-call-transcript.collapsible {
    max-height: 100px;
}

.voice-call-transcript.expanded {
    max-height: 220px;
    overflow-y: auto;
}

.transcript-text {
    margin: 0;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    font-style: italic;
    max-height: none;
    overflow: visible;
    transition: max-height 0.3s ease;
}

.transcript-text.collapsed {
    max-height: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.transcript-text:empty::before {
    content: 'Начните говорить...';
    color: rgba(255, 255, 255, 0.4);
}

.transcript-toggle {
    position: absolute;
    left: 50%;
    bottom: 6px;
    transform: translateX(-50%);
    border: none;
    background: rgba(102, 126, 234, 0.2);
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    cursor: pointer;
    padding: 4px 12px;
    border-radius: 999px;
    transition: all 0.2s ease;
    display: none;
    font-weight: 500;
}

.transcript-toggle:hover {
    background: rgba(102, 126, 234, 0.4);
    color: #ffffff;
}

/* Выбор голоса */
.voice-call-voice-select {
    margin-top: 10px;
}

/* Выбор системы распознавания речи */
.voice-call-stt-select {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.stt-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.voice-select {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
}

.voice-select:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(102, 126, 234, 0.5);
}

.voice-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

.voice-select option {
    background: #1a1a2e;
    color: #fff;
}

.voice-select optgroup {
    background: #0a0a0a;
    color: #667eea;
    font-weight: 600;
}

/* Кнопки управления */
.voice-call-controls {
    display: flex;
    gap: 24px;
    margin-top: 30px;
}

.voice-control-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 24px;
}

.voice-control-btn .btn-icon {
    transition: transform 0.3s ease;
}

.voice-control-btn:hover .btn-icon {
    transform: scale(1.1);
}

.mute-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.mute-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.mute-btn.muted {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
}

.search-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.search-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
}

.search-btn.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-color: rgba(59, 130, 246, 0.8);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}

.end-call-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.4);
    transform: rotate(135deg);
}

.end-call-btn:hover {
    transform: rotate(135deg) scale(1.1);
    box-shadow: 0 0 40px rgba(239, 68, 68, 0.6);
}

.end-call-btn .btn-icon {
    transform: rotate(-135deg);
}

.speaker-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.speaker-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.speaker-btn.muted {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
}

/* Состояния аватара */
.voice-call-avatar.listening .avatar-glow {
    background: radial-gradient(circle, rgba(74, 222, 128, 0.4) 0%, transparent 70%);
}

.voice-call-avatar.listening .avatar-inner {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    box-shadow: 
        0 0 60px rgba(74, 222, 128, 0.5),
        0 0 100px rgba(34, 197, 94, 0.3);
}

.voice-call-avatar.speaking .avatar-glow {
    background: radial-gradient(circle, rgba(102, 126, 234, 0.6) 0%, transparent 70%);
    animation: glow-pulse 0.5s ease-in-out infinite alternate;
}

.voice-call-avatar.speaking .avatar-inner {
    box-shadow: 
        0 0 80px rgba(102, 126, 234, 0.6),
        0 0 120px rgba(118, 75, 162, 0.4);
}

.voice-call-avatar.thinking .avatar-glow {
    background: radial-gradient(circle, rgba(251, 191, 36, 0.4) 0%, transparent 70%);
}

.voice-call-avatar.thinking .avatar-inner {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 
        0 0 60px rgba(251, 191, 36, 0.5),
        0 0 100px rgba(245, 158, 11, 0.3);
    animation: thinking-rotate 2s linear infinite;
}

@keyframes thinking-rotate {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(30deg); }
}

/* Кнопка голосового звонка */
.voice-call-btn {
    background: linear-gradient(135deg, #111827 0%, #020617 100%) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.voice-call-btn:hover {
    box-shadow: 0 0 15px rgba(15, 23, 42, 0.8);
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .voice-call-avatar {
        width: 120px;
        height: 120px;
    }
    
    .voice-call-title {
        font-size: 24px;
    }
    
    .voice-call-transcript {
        max-width: 90%;
        padding: 12px 16px;
    }
    
    .voice-control-btn {
        width: 56px;
        height: 56px;
        font-size: 20px;
    }
    
    .pulse-ring-1 { width: 150px; height: 150px; }
    .pulse-ring-2 { width: 220px; height: 220px; }
    .pulse-ring-3 { width: 300px; height: 300px; }
}

/* Стили для источников Perplexity */
.message-text a {
    color: #64b5f6;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 4px;
    border-radius: 4px;
}

.message-text a:hover {
    color: #90caf9;
    background: rgba(100, 181, 246, 0.1);
    text-decoration: underline;
}

.message-text a:active {
    transform: scale(0.98);
}

/* Специальные стили для источников с эмодзи 🔗 */
.message-text a[href^="http"]:before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 4px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%2364b5f6"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/></svg>') center/contain no-repeat;
}

/* Стили для блока источников */
.message-text p:has(a[href^="http"]) {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Стили для списков в сообщениях */
.message-list {
    margin: 12px 0;
    padding-left: 24px;
    line-height: 1.8;
}

.message-list li {
    margin: 8px 0;
    color: var(--text-primary);
}

.message-list li::marker {
    color: var(--accent-color);
    font-weight: 600;
}

/* Нумерованные списки */
ol.message-list {
    list-style-type: decimal;
}

/* Маркированные списки */
ul.message-list {
    list-style-type: disc;
}

/* Вложенные списки */
.message-list .message-list {
    margin: 4px 0;
    padding-left: 20px;
}

/* Стили для заголовков в сообщениях */
.message-heading {
    margin: 16px 0 12px 0;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
}

h1.message-heading {
    font-size: 24px;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 8px;
}

h2.message-heading {
    font-size: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 6px;
}

h3.message-heading {
    font-size: 18px;
    color: var(--accent-color);
}

h4.message-heading {
    font-size: 16px;
}

h5.message-heading {
    font-size: 15px;
}

h6.message-heading {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Панель управления воспроизведением TTS */
.tts-playback-controls {
    margin-top: 15px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.25), rgba(118, 75, 162, 0.2));
    border: 1px solid rgba(102, 126, 234, 0.4);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    animation: slideIn 0.3s ease;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.2);
    backdrop-filter: blur(10px);
}

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

.tts-playback-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tts-icon {
    font-size: 24px;
    animation: speakerPulse 1s ease-in-out infinite;
}

@keyframes speakerPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

.tts-status {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.tts-playback-buttons {
    display: flex;
    gap: 8px;
}

/* Прогресс-бар TTS в голосовом звонке */
.tts-playback-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 120px;
}

.tts-progress-slider {
    flex: 1;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    cursor: pointer;
    outline: none;
    transition: background 0.2s ease;
}

.tts-progress-slider:hover {
    background: rgba(255, 255, 255, 0.25);
}

.tts-progress-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.6);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tts-progress-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.8);
}

.tts-progress-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.6);
}

.tts-progress-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
}

.tts-time {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    min-width: 40px;
    text-align: right;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-weight: 500;
}

.tts-control-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    backdrop-filter: blur(5px);
}

.tts-control-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.tts-control-btn:active {
    transform: scale(0.95);
}

.tts-control-btn.paused {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.4), rgba(56, 142, 60, 0.3));
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.4);
}

#tts-stop-btn:hover {
    background: rgba(244, 67, 54, 0.3);
}

/* ==========================================
   TTS Плеер в верхней части экрана
   ========================================== */

.tts-player-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-bottom: 1px solid rgba(102, 126, 234, 0.3);
    padding: 12px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.tts-player-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.tts-player-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 140px;
}

.tts-player-icon {
    font-size: 24px;
    animation: pulse 1.5s ease-in-out infinite;
}

.tts-player-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    white-space: nowrap;
}

.tts-player-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.tts-player-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(102, 126, 234, 0.2);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
}

.tts-player-btn:hover {
    background: rgba(102, 126, 234, 0.4);
    transform: scale(1.1);
}

.tts-player-btn:active {
    transform: scale(0.95);
}

.tts-player-btn.paused {
    background: rgba(76, 175, 80, 0.3);
}

.tts-player-stop {
    background: rgba(244, 67, 54, 0.2);
}

.tts-player-stop:hover {
    background: rgba(244, 67, 54, 0.4);
}

.tts-player-progress-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 400px;
}

.tts-player-progress {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    cursor: pointer;
}

.tts-player-progress::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.5);
    transition: transform 0.2s ease;
}

.tts-player-progress::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.tts-player-progress::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.5);
}

.tts-player-progress::-webkit-slider-runnable-track {
    background: linear-gradient(to right, #667eea var(--progress, 0%), rgba(255, 255, 255, 0.1) var(--progress, 0%));
    border-radius: 3px;
}

.tts-player-time {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    min-width: 40px;
    text-align: right;
    font-family: monospace;
}

/* Мобильная адаптация TTS плеера */
@media (max-width: 768px) {
    .tts-player-bar {
        padding: 10px 15px;
    }
    
    .tts-player-content {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .tts-player-info {
        min-width: auto;
    }
    
    .tts-player-text {
        font-size: 13px;
    }
    
    .tts-player-controls {
        width: 100%;
        justify-content: center;
    }
    
    .tts-player-progress-container {
        max-width: none;
    }
    
    .tts-player-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .tts-player-info {
        width: 100%;
        justify-content: center;
    }
    
    .tts-player-icon {
        font-size: 20px;
    }
}
