/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Rich text formatting styles */
.message-text {
    line-height: 1.6;
    word-wrap: break-word;
}

/* Code blocks */
.code-block {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 16px;
    margin: 12px 0;
    overflow-x: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
}

body.theme-dark .code-block {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
}

/* Inline code */
.inline-code {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    color: #d63384;
}

body.theme-dark .inline-code {
    background: rgba(255, 255, 255, 0.1);
    color: #ff6b9d;
}

/* Headers */
.message-header {
    font-weight: 600;
    margin: 16px 0 8px 0;
    color: #1a1a1a;
    border-bottom: 2px solid rgba(102, 126, 234, 0.3);
    padding-bottom: 4px;
}

.message-header h1 {
    font-size: 1.5em;
    margin: 0;
}

.message-header h2 {
    font-size: 1.3em;
    margin: 0;
}

.message-header h3 {
    font-size: 1.1em;
    margin: 0;
}

body.theme-dark .message-header {
    color: #e0e0e0;
    border-bottom-color: rgba(102, 126, 234, 0.5);
}

/* Lists */
.message-list {
    margin: 8px 0;
    padding-left: 20px;
}

.message-list li {
    margin: 4px 0;
    line-height: 1.5;
}

/* Blockquotes */
.message-quote {
    border-left: 4px solid rgba(102, 126, 234, 0.5);
    padding: 12px 16px;
    margin: 12px 0;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 0 8px 8px 0;
    font-style: italic;
}

body.theme-dark .message-quote {
    background: rgba(102, 126, 234, 0.1);
    border-left-color: rgba(102, 126, 234, 0.7);
}

/* Horizontal rules */
.message-divider {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.3), transparent);
    margin: 16px 0;
}

/* System steps */
.system-step {
    padding: 8px 12px;
    margin: 4px 0;
    border-radius: 6px;
    font-weight: 500;
    border-left: 3px solid;
}

.system-step.executing {
    background: rgba(255, 193, 7, 0.1);
    border-left-color: #ffc107;
    color: #856404;
}

.system-step.success {
    background: rgba(40, 167, 69, 0.1);
    border-left-color: #28a745;
    color: #155724;
}

.system-step.error {
    background: rgba(220, 53, 69, 0.1);
    border-left-color: #dc3545;
    color: #721c24;
}

.system-step.warning {
    background: rgba(255, 193, 7, 0.1);
    border-left-color: #ffc107;
    color: #856404;
}

.system-step.target {
    background: rgba(102, 126, 234, 0.1);
    border-left-color: #667eea;
    color: #4a5568;
}

.system-step.chat {
    background: rgba(102, 126, 234, 0.1);
    border-left-color: #667eea;
    color: #4a5568;
}

body.theme-dark .system-step.executing {
    background: rgba(255, 193, 7, 0.2);
    color: #ffd54f;
}

body.theme-dark .system-step.success {
    background: rgba(40, 167, 69, 0.2);
    color: #4caf50;
}

body.theme-dark .system-step.error {
    background: rgba(220, 53, 69, 0.2);
    color: #f44336;
}

body.theme-dark .system-step.warning {
    background: rgba(255, 193, 7, 0.2);
    color: #ffd54f;
}

body.theme-dark .system-step.target {
    background: rgba(102, 126, 234, 0.2);
    color: #90caf9;
}

body.theme-dark .system-step.chat {
    background: rgba(102, 126, 234, 0.2);
    color: #90caf9;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    overflow: hidden;
    transition: all 0.3s ease;
    background: #fafafa;
    color: #1a1a1a;
}


body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #1a1a1a;
}

/* Chat container */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.1);
}

/* Header */
.chat-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    color: #1a1a1a;
    padding: 20px 30px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.guardian-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    border: 2px solid rgba(102, 126, 234, 0.3);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}



.logo h1 {
    font-family: 'Inter', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a1a1a;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.welcome-text {
    font-weight: 500;
    font-size: 1rem;
    color: #666;
}

.profile-btn, .diary-btn, .logout-btn, .guardian-btn, .model-status-btn, .roadmap-btn {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #1a1a1a;
    padding: 10px 20px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.profile-btn:hover, .diary-btn:hover, .logout-btn:hover, .guardian-btn:hover, .model-status-btn:hover, .roadmap-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.logout-btn {
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 1);
    transform: translateY(-2px);
}

/* Мобильное меню */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.mobile-menu-btn:hover {
    background: rgba(102, 126, 234, 0.1);
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.mobile-menu.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-content {
    background: var(--bg-secondary);
    border-radius: 15px;
    padding: 30px;
    max-width: 300px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.mobile-menu-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.2rem;
}

.mobile-menu-close {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.mobile-menu-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.mobile-menu-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.mobile-menu-item:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-2px);
}





/* Main chat area */
.chat-main {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

/* Sidebar */
.chat-sidebar {
    width: 350px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    padding: 30px;
    overflow-y: auto;
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.1);
}

/* Light theme sidebar */
body.theme-light .chat-sidebar {
    background: rgba(255, 255, 255, 0.9);
    border-right: 1px solid rgba(255, 20, 147, 0.1);
}

/* Dark theme sidebar */
body.theme-dark .chat-sidebar {
    background: rgba(26, 26, 46, 0.9);
    border-right: 1px solid rgba(255, 20, 147, 0.2);
}

.sidebar-section {
    margin-bottom: 30px;
}

.sidebar-section h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Light theme section headers */
body.theme-light .sidebar-section h3 {
    color: #ff1493;
}

/* Dark theme section headers */
body.theme-dark .sidebar-section h3 {
    color: #ff69b4;
}

.action-btn {
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.2);
    color: #667eea;
    padding: 12px 20px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: block;
    margin-bottom: 10px;
    text-align: left;
    backdrop-filter: blur(10px);
}

.action-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.profile-summary {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

/* Light theme profile summary */
body.theme-light .profile-summary {
    background: #fff0f5;
}

body.theme-light .profile-summary p {
    color: #666;
}

/* Dark theme profile summary */
body.theme-dark .profile-summary {
    background: rgba(255, 255, 255, 0.1);
}

body.theme-dark .profile-summary p {
    color: #e0e0e0;
}

.profile-summary p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 10px;
}

.tips p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

/* Chat messages */
.chat-messages {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(5px);
}

/* Light theme chat messages */
body.theme-light .chat-messages {
    background: rgba(255, 255, 255, 0.8);
}

/* Dark theme chat messages */
body.theme-dark .chat-messages {
    background: rgba(26, 26, 46, 0.8);
}

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

/* Message styles */
.message {
    display: flex;
    gap: 15px;
    animation: slideIn 0.3s ease-out;
    max-width: 95%;
}

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

.user-message, .meranda-message, .stepan-message {
    align-self: flex-end;
}

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

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    border: 2px solid rgba(102, 126, 234, 0.2);
}

.user-message .message-avatar, .meranda-message .message-avatar, .stepan-message .message-avatar {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.4);
}

.ai-message .message-avatar {
    background: rgba(118, 75, 162, 0.2);
    border-color: rgba(118, 75, 162, 0.4);
}

.message-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 18px;
    padding: 15px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    flex: 1;
}

.user-message .message-content, .meranda-message .message-content, .stepan-message .message-content {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.2);
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.sender {
    font-weight: 600;
    color: #1a1a1a;
    font-size: 0.9rem;
}

.time {
    font-size: 0.8rem;
    color: #999;
}

.message-text {
    color: #1a1a1a;
    line-height: 1.6;
    font-size: 0.95rem;
    font-weight: 500;
}

/* Message input */
.message-input-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding: 25px 30px;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.1);
}

/* Light theme input container */
body.theme-light .message-input-container {
    background: rgba(255, 255, 255, 0.9);
}

/* Dark theme input container */
body.theme-dark .message-input-container {
    background: rgba(26, 26, 46, 0.9);
}

.message-form {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    max-width: 1400px;
    margin: 0 auto;
}

.input-wrapper {
    flex: 1;
    position: relative;
}

#messageInput {
    width: 100%;
    min-height: 50px;
    max-height: 300px;
    padding: 15px 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    font-size: 0.95rem;
    line-height: 1.5;
    resize: none;
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
    color: #1a1a1a;
}

/* Light theme input */
body.theme-light #messageInput {
    background: white;
    color: #333;
}

/* Dark theme input */
body.theme-dark #messageInput {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    border-color: rgba(255, 255, 255, 0.2);
}

#messageInput:focus {
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: rgba(255, 255, 255, 1);
}

.send-btn {
    background: rgba(102, 126, 234, 0.9);
    border: 1px solid rgba(102, 126, 234, 0.3);
    color: white;
    padding: 15px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    min-width: 120px;
    justify-content: center;
}

.send-btn:hover {
    background: rgba(102, 126, 234, 1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.send-icon {
    font-size: 1.1rem;
}

.input-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
}

.action-btn-small {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #666;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.action-btn-small:hover {
    background: rgba(255, 255, 255, 1);
    color: #1a1a1a;
    transform: translateY(-1px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    margin: 5% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
    transition: all 0.3s ease;
}

/* Light theme modal */
body.theme-light .modal-content {
    background: white;
}

/* Dark theme modal */
body.theme-dark .modal-content {
    background: #1a1a2e;
    color: #e0e0e0;
}

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

.modal-header {
    background: linear-gradient(135deg, #ff1493 0%, #c71585 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.close {
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close:hover {
    transform: scale(1.2);
}

.modal-body {
    padding: 30px;
}

/* Diary Modal Styles */
.diary-modal {
    max-width: 800px;
    width: 90%;
}

.diary-info {
    border: 2px solid #ffb6c1;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

/* Light theme diary info */
body.theme-light .diary-info {
    background: linear-gradient(135deg, #fff5f8, #ffe6f0);
}

body.theme-light .diary-info p {
    color: #d63384;
}

/* Dark theme diary info */
body.theme-dark .diary-info {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
}

body.theme-dark .diary-info p {
    color: #ff69b4;
}

.diary-info p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.diary-entries {
    max-height: 500px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}



/* Profile Modal Styles */
.profile-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-section {
    background: linear-gradient(135deg, #fff5f8, #ffe6f0);
    border: 2px solid #ffb6c1;
    border-radius: 12px;
    padding: 16px;
}

.profile-section h4 {
    color: #d63384;
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.profile-section p {
    margin: 0;
    color: #333;
    line-height: 1.5;
}

.profile-textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 2px solid #ffb6c1;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    background: white;
}

.profile-textarea:focus {
    outline: none;
    border-color: #ff1493;
    box-shadow: 0 0 0 3px rgba(255, 20, 147, 0.1);
}

.update-btn, .view-btn, .back-btn {
    background: linear-gradient(135deg, #ff1493 0%, #c71585 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.update-btn:hover, .view-btn:hover, .back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 20, 147, 0.3);
}

.back-btn {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
}

.back-btn:hover {
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.3);
}

/* Loading overlay */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.loading-content {
    text-align: center;
    color: #ff1493;
}

.loading-heart {
    font-size: 3rem;
    animation: pulse 1s ease-in-out infinite;
    margin-bottom: 15px;
}

.loading-content p {
    font-size: 1.2rem;
    font-weight: 500;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 8px 0;
    animation: fadeIn 0.3s ease-in;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff69b4;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }
.typing-dot:nth-child(3) { animation-delay: 0s; }

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

/* Streaming message styles */
.message.ai-message.streaming .message-text {
    border-right: 2px solid #ff69b4;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { border-right-color: #ff69b4; }
    51%, 100% { border-right-color: transparent; }
}

/* Status messages */
.status-message {
    font-size: 12px;
    color: #888;
    text-align: center;
    padding: 4px 8px;
    margin: 4px 0;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    animation: fadeIn 0.3s ease-in;
}

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

/* System Analysis Panel - НОВАЯ АРХИТЕКТУРА */
.system-panel {
    width: 380px;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
    border-left: 3px solid #00d4ff;
    border-radius: 15px;
    margin-right: 20px;
    box-shadow: -8px 0 25px rgba(0, 212, 255, 0.15);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 212, 255, 0.2);
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.panel-header {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1) 0%, rgba(15, 15, 35, 0.8) 100%);
    padding: 20px 25px;
    border-bottom: 2px solid rgba(0, 212, 255, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.panel-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50%;
    height: 2px;
    background: linear-gradient(90deg, #00d4ff, transparent);
}

.panel-header h3 {
    color: #00d4ff;
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.8);
    letter-spacing: 1px;
}

.panel-controls {
    display: flex;
    gap: 8px;
}

.refresh-btn,
.expand-btn {
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    color: #0f0f23;
    border: none;
    padding: 10px 14px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.refresh-btn::before,
.expand-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;
}

.refresh-btn:hover::before,
.expand-btn:hover::before {
    left: 100%;
}

.refresh-btn:hover,
.expand-btn:hover {
    background: linear-gradient(135deg, #0099cc 0%, #006699 100%);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.5);
}

.refresh-btn:active,
.expand-btn:active {
    transform: translateY(-1px) scale(1.02);
}

.panel-content {
    padding: 20px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.analysis-section {
    margin-bottom: 25px;
}

.analysis-section h4 {
    color: white;
    margin: 0 0 15px 0;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-content {
    background: rgba(15, 15, 35, 0.9);
    border: 2px solid rgba(0, 212, 255, 0.2);
    border-radius: 16px;
    padding: 20px;
    margin-top: 15px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(0, 212, 255, 0.2);
    min-height: 150px;
    max-height: 700px;
    overflow-y: auto;
    overflow-x: hidden;
    word-wrap: break-word;
    white-space: pre-wrap;
    box-shadow: inset 0 2px 10px rgba(0, 212, 255, 0.1);
}

.status-content::-webkit-scrollbar {
    width: 6px;
}

.status-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.status-content::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 3px;
}

.status-content::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.7);
}

.status-section {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    border-left: 4px solid #ff1493;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.status-section h5 {
    color: #ff1493;
    font-weight: 700;
    margin-bottom: 12px;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.status-section p {
    color: #e0e0e0;
    line-height: 1.6;
    font-size: 0.95rem;
    margin: 0 0 10px 0;
    word-wrap: break-word;
    white-space: pre-wrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Специальные стили для разных секций */
.status-section.system-status {
    border-left-color: #00ff88;
}

.status-section.system-status h5 {
    color: #00ff88;
}

.status-section.insights {
    border-left-color: #ffaa00;
}

.status-section.insights h5 {
    color: #ffaa00;
}

.status-section.recommendations {
    border-left-color: #ff6b9d;
}

.status-section.recommendations h5 {
    color: #ff6b9d;
}

.status-section.notes {
    border-left-color: #8b5cf6;
}

.status-section.notes h5 {
    color: #8b5cf6;
}

/* Стили для списков */
.status-section ul {
    margin: 8px 0;
    padding-left: 20px;
}

.status-section li {
    color: #e0e0e0;
    line-height: 1.5;
    margin: 6px 0;
    font-size: 0.9rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.status-section li::marker {
    color: #ff1493;
    font-weight: bold;
}

/* Кнопка полного анализа */
.full-analysis-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    margin-top: 15px;
    text-align: center;
    width: 100%;
}

.full-analysis-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.full-analysis-controls {
    margin-top: 15px;
    text-align: center;
}

/* Контент статуса */
.status-content {
    line-height: 1.6;
    word-wrap: break-word;
    white-space: pre-wrap;
    font-size: 0.9rem;
    color: #e0e0e0;
}

/* Секции анализа в модальном окне */
.analysis-section {
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    border-left: 5px solid;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.analysis-section.system-status {
    border-left-color: #00d4ff;
}

.analysis-section.insights {
    border-left-color: #ff6b9d;
}

.analysis-section.recommendations {
    border-left-color: #4ecdc4;
}

.analysis-section.notes {
    border-left-color: #ffe66d;
}

.analysis-section.raw-data {
    border-left-color: #ff6b6b;
}

.analysis-section h3 {
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.analysis-section .analysis-content {
    color: #e0e0e0;
    line-height: 1.6;
    word-wrap: break-word;
    white-space: pre-wrap;
    font-size: 0.95rem;
}

.analysis-section .analysis-content pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.85rem;
    color: #00d4ff;
}

.full-analysis-sections {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.expand-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 50%;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.expand-btn:hover {
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Полноразмерное модальное окно */
.system-analysis-modal.full-size {
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
}

.system-analysis-modal.full-size .system-analysis-modal-content {
    width: 90vw;
    height: 90vh;
    max-width: 1200px;
    max-height: 800px;
    border-radius: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.full-analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.full-analysis-header h2 {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.close-full-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.full-analysis-content {
    padding: 30px;
    height: calc(100% - 80px);
    overflow-y: auto;
    overflow-x: hidden;
}

.full-analysis-content .status-section {
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    border-left: 5px solid;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.full-analysis-content .status-section h5 {
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.full-analysis-content .status-section p {
    font-size: 1rem;
    line-height: 1.7;
}

.full-analysis-content .status-section li {
    font-size: 1rem;
    line-height: 1.6;
    margin: 8px 0;
}

/* Скроллбар для полного анализа */
.full-analysis-content::-webkit-scrollbar {
    width: 8px;
}

.full-analysis-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.full-analysis-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.full-analysis-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}



.loading-spinner {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
    padding: 20px;
}

/* Update chat layout */
.chat-main {
    display: flex;
    height: calc(100vh - 80px);
    gap: 20px;
    padding: 20px;
}

.chat-messages {
    flex: 1;
    display: flex;
        flex-direction: column;
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Responsive design */
@media (max-width: 1200px) {
    .system-panel {
        width: 250px;
    }
}

@media (max-width: 768px) {
    .chat-main {
        flex-direction: column;
    }
    
    
    
    /* Скрываем обычные кнопки на мобильных */
    .user-info {
        display: none !important;
    }
    
    /* Показываем бургер-меню */
    .mobile-menu {
        display: block;
        z-index: 1000;
    }
    
    /* Скрываем Terminal на мобильных */
    .terminal-panel {
        display: none !important;
    }
    

    
    /* Улучшенные стили для мобильного меню */
    .mobile-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        background: var(--bg-color);
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
        transition: left 0.3s ease;
        z-index: 1500;
    }
    
    .mobile-menu.active {
        left: 0;
    }
    
    .mobile-menu-content {
        height: 100%;
        display: flex;
        flex-direction: column;
    }
    
    .mobile-menu-header {
        padding: 20px;
        background: linear-gradient(135deg, #ff1493, #c71585);
        color: white;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .mobile-menu-items {
        flex: 1;
        padding: 20px 0;
        overflow-y: auto;
    }
    
    .mobile-menu-item {
        display: block;
        width: 100%;
        padding: 15px 20px;
        background: none;
        border: none;
        color: var(--text-color);
        text-decoration: none;
        text-align: left;
        font-size: 16px;
        cursor: pointer;
        transition: background 0.3s ease;
        border-bottom: 1px solid rgba(255, 20, 147, 0.1);
    }
    
    .mobile-menu-item:hover {
        background: rgba(255, 20, 147, 0.1);
    }
    
    .mobile-menu-item.system-analysis {
        background: linear-gradient(135deg, #ff1493, #c71585);
        color: white;
    }
    
    .mobile-menu-item.system-analysis:hover {
        background: linear-gradient(135deg, #c71585, #ff1493);
    }
}

/* Scrollbar styling */
.messages-container::-webkit-scrollbar {
    width: 8px;
}

.messages-container::-webkit-scrollbar-track {
    background: rgba(255, 20, 147, 0.1);
    border-radius: 10px;
}

.messages-container::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #ff1493 0%, #c71585 100%);
    border-radius: 10px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #c71585 0%, #ff1493 100%);
} 

/* Error message styling */
.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
    border-left: 4px solid #c62828;
}

/* Model status modal styles */
.model-status-modal .modal-content {
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.current-model {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.current-model h3 {
    margin: 0 0 10px 0;
    font-size: 1.2rem;
}

.current-model p {
    margin: 5px 0;
    opacity: 0.9;
}

.model-list h3 {
    margin-bottom: 15px;
    color: #333;
}

.model-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.model-item {
    background: #f5f5f5;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
}

.model-item.current {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border-color: #4CAF50;
}

.model-item.error {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    color: white;
    border-color: #f44336;
}

.model-item.available {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
    border-color: #2196F3;
}

.model-item.clickable {
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.model-item.clickable:hover {
    background: linear-gradient(135deg, #1976D2, #1565C0);
    border-color: #1976D2;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.model-item.clickable:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.model-item.clickable:disabled {
    opacity: 0.6;
    pointer-events: none;
    cursor: not-allowed;
}

.model-item.clickable.loading {
    opacity: 0.6;
    pointer-events: none;
}

.model-hint {
    font-size: 0.8em;
    opacity: 0.8;
    margin-top: 4px;
    font-style: italic;
}

.model-item.clickable .model-hint {
    color: #4CAF50;
    font-weight: 500;
}

.model-name {
    font-weight: bold;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.model-quota {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-bottom: 5px;
}

.model-status {
    font-size: 0.8rem;
    font-weight: bold;
}

.model-info {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #2196F3;
}

.model-info p {
    margin: 5px 0;
    font-size: 0.9rem;
}

/* File upload and drop zone styles */
.file-drop-zone {
    border: 2px dashed #ccc;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    margin: 10px 0;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    display: none;
}

.file-drop-zone.drag-over {
    border-color: #ff1493;
    background: rgba(255, 20, 147, 0.1);
    transform: scale(1.02);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.drop-icon {
    font-size: 2rem;
    color: #666;
}

.drop-zone-content p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.drop-hint {
    font-size: 0.8rem !important;
    color: #999 !important;
    font-style: italic;
}

/* File message styles */
.file-message {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.file-icon {
    font-size: 2rem;
    color: #ff1493;
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.file-size {
    font-size: 0.8rem;
    color: #666;
}

.file-actions {
    display: flex;
    gap: 10px;
}

.file-btn {
    padding: 5px 10px;
    border: none;
    border-radius: 5px;
    background: #ff1493;
    color: white;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.file-btn:hover {
    background: #c71585;
    transform: scale(1.05);
}

/* Image preview */
.image-preview {
    max-width: 300px;
    max-height: 200px;
    border-radius: 8px;
    margin: 10px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Upload progress */
.upload-progress {
    width: 100%;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    margin: 10px 0;
    overflow: hidden;
}

.upload-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #ff1493, #c71585);
    width: 0%;
    transition: width 0.3s ease;
}

/* Download link styles */
.download-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: linear-gradient(135deg, #ff1493, #c71585);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    margin: 5px 0;
}

.download-link:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 20, 147, 0.3);
}

.download-icon {
    font-size: 1.1rem;
}

/* Message editing styles */
.message-actions {
    display: none;
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 5px;
    padding: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.message:hover .message-actions {
    display: flex;
    gap: 5px;
}

.message-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 0.8rem;
    color: #666;
    transition: all 0.2s ease;
}

.message-action-btn:hover {
    background: #ff1493;
    color: white;
}

.message-content {
    position: relative;
}

.message.edited::after {
    content: " (edited)";
    font-size: 0.7rem;
    color: #999;
    font-style: italic;
}

/* Edit mode styles */
.message.edit-mode .message-text {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid #ff1493;
    border-radius: 8px;
    padding: 10px;
}

.edit-input {
    width: 100%;
    min-height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #ff1493;
    border-radius: 8px;
    padding: 10px;
    font-family: inherit;
    font-size: inherit;
    resize: vertical;
}

.edit-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.edit-btn {
    padding: 5px 15px;
    background: #ff1493;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.edit-btn:hover {
    background: #c71585;
    transform: scale(1.05);
}

.cancel-btn {
    padding: 5px 15px;
    background: #666;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.cancel-btn:hover {
    background: #444;
    transform: scale(1.05);
}

/* Loading banner styles */
.loading-banner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.loading-banner.hidden {
    display: none;
}

.loading-banner .loading-content {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 2px solid #ff1493;
}

.loading-banner .loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #ff1493;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-banner p {
    margin: 0;
    color: #333;
    font-size: 1.1rem;
    font-weight: 500;
}

/* Optimize message container */
.messages-container {
    height: calc(100vh - 200px);
    overflow-y: auto;
    padding: 20px;
    scroll-behavior: smooth;
    position: relative;
}

.messages-container.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Status message styles */
.status-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 10000;
    animation: slideInRight 0.3s ease-out;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.status-message.success {
    background: #28a745;
}

.status-message.error {
    background: #dc3545;
}

.status-message.info {
    background: #17a2b8;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Attached files styles */
.attached-files-container {
    margin: 10px 0;
    padding: 10px;
    background: rgba(147, 51, 234, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(147, 51, 234, 0.2);
}

.attached-files-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.attached-file-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: white;
    border-radius: 6px;
    border: 1px solid rgba(147, 51, 234, 0.3);
    max-width: 200px;
}

.preview-image {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}

.file-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(147, 51, 234, 0.1);
    border-radius: 4px;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 0.75rem;
    color: #6b7280;
}

.remove-btn {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
}

.remove-btn:hover {
    background: #dc2626;
}

/* Attached files in messages */
.attached-files {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.attached-file {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    background: rgba(147, 51, 234, 0.05);
    border-radius: 6px;
    border: 1px solid rgba(147, 51, 234, 0.2);
    max-width: 250px;
}

.attached-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s;
}

.attached-image:hover {
    transform: scale(1.05);
} 

/* Technical Steps Collapsible */
.technical-steps-container {
    margin: 10px 0;
}

.technical-steps {
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.tech-steps-toggle {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 12px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #495057;
    transition: all 0.3s ease;
    border: none;
    width: 100%;
    text-align: left;
}

.tech-steps-toggle:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    color: #212529;
}

.tech-steps-toggle:focus {
    outline: 2px solid #007bff;
    outline-offset: -2px;
}

.toggle-text {
    font-size: 0.9rem;
}

.toggle-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    margin-left: auto;
}

.technical-steps[open] .toggle-icon {
    transform: rotate(180deg);
}

.tech-steps-content {
    padding: 15px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.4;
    color: #495057;
}

.step-header {
    font-weight: bold;
    color: #007bff;
    margin: 8px 0 4px 0;
    padding: 4px 0;
    border-bottom: 1px solid #dee2e6;
}

.executing-step {
    color: #856404;
    background: #fff3cd;
    padding: 4px 8px;
    border-radius: 4px;
    margin: 4px 0;
    border-left: 3px solid #ffc107;
}

.result-step {
    color: #155724;
    background: #d4edda;
    padding: 4px 8px;
    border-radius: 4px;
    margin: 4px 0;
    border-left: 3px solid #28a745;
}

.final-response {
    margin-top: 15px;
    padding: 15px;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-radius: 8px;
    border-left: 4px solid #2196f3;
}

.final-response-header {
    font-weight: bold;
    color: #1976d2;
    margin-bottom: 8px;
    font-size: 1rem;
}

/* Dark theme support */
body.theme-dark .tech-steps-toggle {
    background: linear-gradient(135deg, #343a40 0%, #495057 100%);
    color: #e9ecef;
}

body.theme-dark .tech-steps-toggle:hover {
    background: linear-gradient(135deg, #495057 0%, #6c757d 100%);
    color: #ffffff;
}

body.theme-dark .tech-steps-content {
    background: #2d3748;
    color: #e2e8f0;
    border-top-color: #4a5568;
}

body.theme-dark .step-header {
    color: #63b3ed;
    border-bottom-color: #4a5568;
}

body.theme-dark .executing-step {
    color: #f6e05e;
    background: #744210;
    border-left-color: #d69e2e;
}

body.theme-dark .result-step {
    color: #9ae6b4;
    background: #22543d;
    border-left-color: #38a169;
}

body.theme-dark .final-response {
    background: linear-gradient(135deg, #1a365d 0%, #2c5282 100%);
    border-left-color: #3182ce;
}

body.theme-dark .final-response-header {
    color: #63b3ed;
} 

/* Archive Modal Styles */
.archive-summary {
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.archive-summary p {
    color: #1a1a1a;
    line-height: 1.6;
    margin: 0;
    font-size: 0.95rem;
}

.archive-summary strong {
    color: #667eea;
    font-weight: 600;
}

.archive-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

.archive-empty p {
    font-size: 1.1rem;
    margin: 0;
}

.archive-details {
    margin-bottom: 16px;
}

.archive-details p {
    margin-bottom: 6px;
}

.archive-entries {
    max-height: 600px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px 0;
}

.archive-entry {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.archive-entry:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    border-color: rgba(102, 126, 234, 0.3);
}

.archive-entry h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.archive-entry h3::before {
    content: "📅";
    font-size: 1rem;
}

.archive-entry p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.archive-entry p strong {
    color: #1a1a1a;
    font-weight: 600;
}

.archive-entry button {
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    color: #667eea;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-top: 12px;
}

.archive-entry button:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Dark theme archive */
body.theme-dark .archive-summary {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.4);
}

body.theme-dark .archive-summary p {
    color: #e0e0e0;
}

body.theme-dark .archive-summary strong {
    color: #a8b4ff;
}

body.theme-dark .archive-empty {
    color: #b0b0b0;
}

body.theme-dark .archive-entry {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

body.theme-dark .archive-entry h3 {
    color: #e0e0e0;
}

body.theme-dark .archive-entry p {
    color: #b0b0b0;
}

body.theme-dark .archive-entry p strong {
    color: #e0e0e0;
}

body.theme-dark .archive-entry button {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.4);
    color: #a8b4ff;
}

body.theme-dark .archive-entry button:hover {
    background: rgba(102, 126, 234, 0.3);
}

/* Terminal Panel Styles */
.terminal-panel {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 400px;
    height: 300px;
    background: #1e1e1e;
    border: 2px solid #333;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    transform: translateY(calc(100% - 40px));
    transition: transform 0.3s ease;
    font-family: 'Courier New', monospace;
}

.terminal-panel.expanded {
    transform: translateY(0);
}

.terminal-header {
    background: #2d2d2d;
    padding: 8px 12px;
    border-bottom: 1px solid #444;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.terminal-header h3 {
    margin: 0;
    font-size: 14px;
    color: #00ff00;
    font-weight: bold;
}

.terminal-controls {
    display: flex;
    gap: 4px;
}

.terminal-btn {
    background: #444;
    border: 1px solid #666;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.terminal-btn:hover {
    background: #555;
    border-color: #777;
}

.terminal-content {
    height: calc(100% - 40px);
    overflow: hidden;
}

.terminal-window {
    height: 100%;
    background: #000;
    padding: 8px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #444 #000;
}

.terminal-window::-webkit-scrollbar {
    width: 8px;
}

.terminal-window::-webkit-scrollbar-track {
    background: #000;
}

.terminal-window::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

.terminal-window::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.terminal-output {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
    color: #00ff00;
}

.terminal-line {
    margin: 2px 0;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.terminal-line.error {
    color: #ff4444;
}

.terminal-line.warning {
    color: #ffaa00;
}

.terminal-line.info {
    color: #44aaff;
}

.terminal-line.success {
    color: #44ff44;
}

.terminal-line.system {
    color: #ff44ff;
}

/* Responsive terminal */
@media (max-width: 768px) {
    .terminal-panel {
        width: 100%;
        height: 200px;
    }
}

/* Profile Page Styles */
.profile-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    min-height: calc(100vh - 80px);
    overflow-y: auto;
}

.avatar-section {
    text-align: center;
    margin-bottom: 30px;
    padding: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 25px;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.avatar-container {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
}

.avatar {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #667eea;
    font-size: 3.5rem;
    margin: 0 auto;
    border: 5px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.avatar-upload-btn {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}

.avatar-upload-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

.avatar-section h2 {
    font-family: 'Dancing Script', cursive;
    font-size: 3rem;
    color: white;
    margin: 0;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.profile-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.form-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border: 1px solid rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.form-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.form-section:nth-child(1) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.form-section:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.form-section h3 {
    font-size: 1.5rem;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 3px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 15px;
    font-weight: 600;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 1.1rem;
    opacity: 0.9;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.form-group input[readonly] {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    cursor: not-allowed;
}

.form-group small {
    display: block;
    font-size: 0.9rem;
    margin-top: 8px;
    font-style: italic;
    opacity: 0.8;
}

.form-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.save-btn,
.delete-btn {
    padding: 18px 35px;
    border: none;
    border-radius: 15px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    min-width: 180px;
    justify-content: center;
}

.save-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
}

.save-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(76, 175, 80, 0.4);
}

.delete-btn {
    background: linear-gradient(135deg, #ff4757 0%, #ff3742 100%);
    color: white;
}

.delete-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 71, 87, 0.4);
}

/* Dark theme adjustments for profile */
body.theme-dark .profile-content {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
}

body.theme-dark .form-section:nth-child(1) {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
}

body.theme-dark .form-section:nth-child(2) {
    background: linear-gradient(135deg, #553c9a 0%, #b794f4 100%);
}

body.theme-dark .form-actions {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .profile-content {
        padding: 15px;
        grid-template-columns: 1fr;
    }
    
    .profile-form {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .avatar-section {
        padding: 25px;
    }
    
    .avatar-section h2 {
        font-size: 2.5rem;
    }
    
    .form-section {
        padding: 25px;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 15px;
        padding: 25px;
    }
    
    .save-btn,
    .delete-btn {
        width: 100%;
        min-width: auto;
    }
}

/* Guardian Page Styles */
.guardian-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    min-height: calc(100vh - 80px);
    overflow-y: auto;
}

.guardian-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.guardian-form-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border: 1px solid rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.guardian-form-section:nth-child(1) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.guardian-form-section:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.guardian-form-section:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.guardian-form-section:nth-child(4) {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
}

.guardian-avatar-section {
    grid-column: 1 / -1;
    padding: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 25px;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    color: white;
}

.guardian-avatar-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.guardian-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    border: 4px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    overflow: hidden;
}

.guardian-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 35px rgba(0,0,0,0.3);
}

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

.guardian-upload-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

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

.guardian-avatar-section h2 {
    font-size: 2rem;
    font-weight: 600;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.guardian-form-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

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

.input-group label {
    display: block;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.input-group input,
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-group small {
    display: block;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 5px;
}

.reset-btn {
    background: #ffa500;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.reset-btn:hover {
    background: #ff8c00;
    transform: translateY(-2px);
}

/* Dark theme adjustments for guardian */
body.theme-dark .guardian-form {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

body.theme-dark .input-group input,
body.theme-dark .input-group select,
body.theme-dark .input-group textarea {
    background: var(--bg-primary);
    border-color: var(--border-color);
    color: var(--text-primary);
} 

/* Reasoning and Chain of Thoughts Styles */
.reasoning-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
    border-radius: 15px;
    margin: 15px 0;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.reasoning-header {
    background: linear-gradient(135deg, #6f42c1 0%, #5a32a3 100%);
    color: white;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.reasoning-header:hover {
    background: linear-gradient(135deg, #5a32a3 0%, #4a2d8a 100%);
}

.reasoning-icon {
    font-size: 1.2em;
}

.reasoning-title {
    font-size: 1.1em;
    flex: 1;
}

.reasoning-toggle {
    font-size: 0.8em;
    transition: transform 0.3s ease;
}

.reasoning-content {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.reasoning-content.collapsed {
    max-height: 0;
}

.reasoning-steps {
    padding: 20px;
    background: white;
}

.reasoning-step {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #6f42c1;
}

.reasoning-step:last-child {
    margin-bottom: 0;
}

.step-number {
    background: #6f42c1;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9em;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
    line-height: 1.6;
}

.reasoning-text {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 10px 0;
    line-height: 1.6;
}

.final-response {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 20px;
}

.final-response-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-weight: 600;
    font-size: 1.1em;
}

.response-icon {
    font-size: 1.2em;
}

.response-title {
    font-size: 1.1em;
}

.response-content {
    line-height: 1.6;
}

.response-content h1, .response-content h2, .response-content h3 {
    color: white;
    margin: 15px 0 10px 0;
}

.response-content p {
    margin: 10px 0;
}

.response-content code {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', monospace;
}

.response-content pre {
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 15px 0;
}

/* Dark theme adjustments */
body.theme-dark .reasoning-container {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    border-color: #4a5568;
}

body.theme-dark .reasoning-header {
    background: linear-gradient(135deg, #9f7aea 0%, #805ad5 100%);
}

body.theme-dark .reasoning-header:hover {
    background: linear-gradient(135deg, #805ad5 0%, #6b46c1 100%);
}

body.theme-dark .reasoning-steps {
    background: #2d3748;
}

body.theme-dark .reasoning-step {
    background: #4a5568;
    border-left-color: #9f7aea;
}

body.theme-dark .reasoning-text {
    background: #4a5568;
}

body.theme-dark .step-number {
    background: #9f7aea;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .reasoning-step {
        flex-direction: column;
        gap: 10px;
    }
    
    .step-number {
        align-self: flex-start;
    }
    
    .reasoning-header, .final-response-header {
        padding: 10px 15px;
        font-size: 0.9em;
    }
    
    .reasoning-steps, .final-response {
        padding: 15px;
    }
}

/* Analysis section styles */
.analysis-section {
    margin-bottom: 20px;
}

.analysis-section h4 {
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 1.1em;
    font-weight: 600;
}

.status-content {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid var(--border-color);
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-content {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-left: 4px solid var(--accent-color);
}

.status-text {
    line-height: 1.6;
    color: var(--text-primary);
}

.error-message {
    color: #e74c3c;
    font-style: italic;
    text-align: center;
}

/* Guardian mobile styles */
@media (max-width: 768px) {
    .guardian-content {
        padding: 15px;
    }
    
    .guardian-form {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .guardian-avatar-section {
        padding: 30px 20px;
    }
    
    .guardian-avatar-section h2 {
        font-size: 1.5rem;
    }
    
    .guardian-form-section {
        padding: 20px;
    }
    
    .guardian-form-actions {
        flex-direction: column;
        gap: 15px;
    }
    
    .guardian-avatar {
        width: 100px;
        height: 100px;
        font-size: 2.5rem;
    }
}

/* Стили для кнопок управления техническими шагами */
.action-btn-small[onclick*="hideAllTechnicalSteps"],
.action-btn-small[onclick*="showAllTechnicalSteps"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 500;
}

.action-btn-small[onclick*="hideAllTechnicalSteps"]:hover,
.action-btn-small[onclick*="showAllTechnicalSteps"]:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Анимация для кнопок */
.action-btn-small[onclick*="hideAllTechnicalSteps"]:active,
.action-btn-small[onclick*="showAllTechnicalSteps"]:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* Private Chat Section */
.private-chat-section {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.private-chat-section h4 {
    color: white;
    margin: 0 0 15px 0;
    font-size: 14px;
    font-weight: 600;
}

.new-chat-btn {
    width: 100%;
    padding: 12px 15px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.new-chat-btn:hover {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.return-main-btn {
    width: 100%;
    padding: 12px 15px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.return-main-btn:hover {
    background: linear-gradient(135deg, #ee5a52 0%, #d63031 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.chat-list {
    max-height: 200px;
    overflow-y: auto;
}

.chat-item {
    padding: 8px 12px;
    margin: 5px 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

.chat-item.active {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.chat-item-title {
    color: white;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 2px;
}

.chat-item-date {
    color: rgba(255, 255, 255, 0.7);
    font-size: 10px;
}

/* Базовые стили для модального окна */
.system-analysis-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.system-analysis-modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    position: relative;
    animation: slideIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

