body {
    font-family: "Google Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #ffffff;
    margin: 0;
    padding: 0;
    color: #2d3748;
    font-size: 14px;
    line-height: 1.5;
    height: 100vh;
    overflow: hidden;
}

.header {
    width: 100%;
    height: 60px;
    background-color: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.header-content {
    width: 100%;
    max-width: 1400px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.025em;
}

.nav-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
}

.nav-btn {
    background-color: #ffffff;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.nav-btn:hover {
    background-color: #f8fafc;
    border-color: #d1d5db;
    color: #1f2937;
}

.nav-btn.active {
    background-color: #8b5cf6;
    color: white;
    border-color: #8b5cf6;
}

.download-btn {
    background-color: #8b5cf6;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.button-group {
    display: flex;
    gap: 6px;
    align-items: center;
}

.download-btn:hover {
    background-color: #7c3aed;
}

.download-btn svg {
    margin-right: 6px;
}

.main-container {
    display: flex;
    width: 100%;
    height: calc(100vh - 60px);
    margin-top: 60px;
    padding-top: 4px;
    background-color: #ffffff;
    position: relative;
    top: 0;
}

#chat-history-sidebar {
    display: flex;
    flex-direction: column;
    width: 240px;
    min-width: 240px;
    background-color: #f8fafc;
    border-right: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

#chat-history-sidebar.collapsed {
    width: 0;
    min-width: 0;
    opacity: 0;
    pointer-events: none;
}

.sidebar-collapsed-indicator {
    display: none;
    width: 32px;
    height: 100%;
    background-color: #f8fafc;
    border-right: 1px solid #e5e7eb;
    align-items: flex-start;
    justify-content: center;
    flex-shrink: 0;
    padding-top: 12px;
}

#chat-history-sidebar.collapsed ~ .sidebar-collapsed-indicator {
    display: flex;
}

.sidebar-expand-btn {
    width: 24px;
    height: 24px;
    background-color: #8b5cf6;
    border: none;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    color: white;
    transition: background-color 0.2s ease;
}

.sidebar-expand-btn:hover {
    background-color: #7c3aed;
}

.sidebar-header {
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
    background-color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    height: 44px;
}

.sidebar-toggle {
    background-color: #8b5cf6;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    background-color: #7c3aed;
}


.new-chat-btn {
    background-color: #8b5cf6;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px;
    width: 28px;
    height: 28px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.new-chat-btn:hover {
    background-color: #7c3aed;
}

.sessions-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 8px;
    background: transparent;
}

.session-item {
    padding: 10px 12px;
    margin-bottom: 2px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    background: transparent;
}

.session-item:hover {
    background: rgba(102, 126, 234, 0.05);
    border-color: rgba(102, 126, 234, 0.1);
}

.session-item.active {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.3);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.session-title {
    font-size: 13px;
    font-weight: 500;
    color: #2d3748;
    margin-bottom: 2px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.session-meta {
    font-size: 11px;
    color: #8b9aad;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.session-date {
    font-size: 10px;
    color: #8b9aad;
}

.session-count {
    font-size: 10px;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    padding: 1px 6px;
    border-radius: 12px;
    font-weight: 500;
}

.session-actions {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.2s;
}

.session-item:hover .session-actions {
    opacity: 1;
}

.delete-session-btn {
    background: #EF4444;
    color: white;
    border: none;
    border-radius: 4px;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #6B7280;
}

.spinner {
    border: 2px solid #E4E7EC;
    border-top: 2px solid #5436DA;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

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

.session-loading {
    opacity: 0.6;
    pointer-events: none;
}

.chat-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #6B7280;
}

#chat-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    background-color: #ffffff;
    border-right: 1px solid #e5e7eb;
    overflow: hidden;
    min-width: 300px;
}

#monitoring-container {
    display: flex;
    flex-direction: column;
    width: 350px;
    min-width: 250px;
    background-color: #1a202c;
    overflow: hidden;
    border-left: 1px solid #2d3748;
    flex-shrink: 0;
}

.monitoring-header {
    padding: 12px 16px;
    border-bottom: 1px solid #21262D;
    background: #161B22;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.monitoring-title {
    font-size: 14px;
    font-weight: 600;
    color: #F0F6FC;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.monitoring-toggle {
    background: #21262D;
    border: 1px solid #30363D;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 11px;
    color: #7D8590;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.monitoring-toggle:hover {
    background: #30363D;
    border-color: #484F58;
    color: #F0F6FC;
}

.terminal-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    background: #0D1117;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
    position: relative;
}

.scroll-to-top-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background-color: #30363D;
    border: 1px solid #484F58;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #F0F6FC;
    transition: all 0.2s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.scroll-to-top-btn:hover {
    background-color: #484F58;
    border-color: #6e7681;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.scroll-to-top-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.scroll-to-top-btn svg {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
}

.terminal-header {
    padding: 8px 16px;
    background: #161B22;
    border-bottom: 1px solid #21262D;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.terminal-status {
    font-size: 11px;
    color: #7D8590;
}

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

.terminal-btn {
    background: #238636;
    color: #F0F6FC;
    border: none;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 10px;
    cursor: pointer;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.terminal-btn.clear {
    background: #DA3633;
}

.terminal-btn.filter {
    background: #1F6FEB;
}

.terminal-log {
    padding: 12px 16px;
    color: #E6EDF3;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.log-entry {
    margin-bottom: 4px;
    padding: 2px 0;
    border-left: 2px solid transparent;
    padding-left: 8px;
}

.log-entry:hover {
    background: rgba(56, 139, 253, 0.1);
}

.log-timestamp {
    color: #7D8590;
    font-weight: normal;
}

.log-level-info {
    color: #7EE787;
    border-left-color: #7EE787;
}

.log-level-warn {
    color: #F85149;
    border-left-color: #F85149;
}

.log-level-debug {
    color: #79C0FF;
    border-left-color: #79C0FF;
}

.log-level-system {
    color: #A5A5A5;
    border-left-color: #A5A5A5;
}

.log-level-prompt {
    color: #FFA657;
    border-left-color: #FFA657;
}

.log-level-response {
    color: #7EE787;
    border-left-color: #7EE787;
}

.log-level-error {
    color: #F85149;
    border-left-color: #F85149;
}

.log-level-user {
    color: #58A6FF;
    border-left-color: #58A6FF;
}

.log-level-api {
    color: #A5A5A5;
    border-left-color: #A5A5A5;
}

.log-level-click {
    color: #FF7B72;
    border-left-color: #FF7B72;
    font-weight: bold;
}

.log-level-analysis {
    color: #D2A8FF;
    border-left-color: #D2A8FF;
}

.log-level-history {
    color: #79C0FF;
    border-left-color: #79C0FF;
}

.terminal-log-highlight {
    background-color: #264F78 !important;
    border: 1px solid #58A6FF !important;
    box-shadow: 0 0 8px rgba(88, 166, 255, 0.3);
    animation: pulse-highlight 2s ease-in-out;
}

@keyframes pulse-highlight {
    0% { box-shadow: 0 0 8px rgba(88, 166, 255, 0.6); }
    50% { box-shadow: 0 0 16px rgba(88, 166, 255, 0.8); }
    100% { box-shadow: 0 0 8px rgba(88, 166, 255, 0.3); }
}

.prompt-id-link {
    color: #FFA657;
    cursor: pointer;
    text-decoration: underline;
    margin-left: 8px;
    font-size: 12px;
}

.prompt-id-link:hover {
    color: #FFB366;
    background-color: rgba(255, 166, 87, 0.1);
    padding: 2px 4px;
    border-radius: 3px;
}

.prompt-highlight {
    background: rgba(255, 166, 87, 0.2);
    border: 1px solid #FFA657;
    border-radius: 4px;
    padding: 8px;
    margin: 4px 0;
}

.response-marker {
    display: inline-block;
    background: #238636;
    color: #F0F6FC;
    padding: 1px 4px;
    border-radius: 2px;
    font-size: 9px;
    margin-right: 6px;
}

.clickable-response {
    cursor: pointer;
    transition: background-color 0.2s;
}

.clickable-response:hover {
    background-color: rgba(35, 134, 54, 0.1);
}

.terminal-input {
    background: #21262D;
    border: 1px solid #30363D;
    color: #F0F6FC;
    padding: 8px 12px;
    margin: 8px 16px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 12px;
}

.terminal-input:focus {
    outline: none;
    border-color: #1F6FEB;
}

.terminal-input::placeholder {
    color: #7D8590;
}

.resize-handle {
    width: 6px;
    background: #E5E7EB;
    cursor: col-resize;
    transition: all 0.2s;
    position: relative;
    flex-shrink: 0;
    border-left: 1px solid #D1D5DB;
    border-right: 1px solid #D1D5DB;
    display: block;
}

.resize-handle:hover {
    background: #8b5cf6;
    border-color: #7c3aed;
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.3);
}

.resize-handle:active {
    background: #7c3aed !important;
    border-color: #6d28d9 !important;
}

/* Ensure resize handle is visible when terminal is shown */
#monitoring-container[style*="flex"] + .resize-handle,
#monitoring-container[style*="block"] + .resize-handle {
    display: block !important;
}

.collapse-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: #6B7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s;
}

.collapse-btn:hover {
    background: #F3F4F6;
    color: #374151;
}

@media (max-width: 1200px) {
    .main-container {
        flex-direction: column;
        height: auto;
        min-height: calc(100vh - 60px);
        margin-top: 60px;
    }
    
    #chat-history-sidebar {
        order: 1;
        width: 100%;
        max-height: 200px;
    }
    
    #chat-container {
        order: 2;
        min-width: unset;
        min-height: 300px;
    }
    
    #monitoring-container {
        order: 3;
        min-width: unset;
        min-height: 300px;
    }
    
    .resize-handle {
        display: none;
    }
}

@media (max-width: 768px) {
    #chat-history-sidebar {
        max-height: 150px;
    }
    
    .session-item {
        padding: 8px;
        margin-bottom: 2px;
    }
    
    .session-title {
        font-size: 13px;
    }
    
    .session-meta {
        font-size: 11px;
    }
}

.chat-header {
    padding: 8px 16px;
    background: #F9FAFB;
    border-bottom: 1px solid #E4E7EC;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.terminal-btn {
    background-color: #8b5cf6;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.terminal-btn:hover {
    background-color: #7c3aed;
}

.terminal-btn svg {
    width: 14px;
    height: 14px;
}

#chat-box {
    flex: 1;
    padding: 16px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background-color: #ffffff;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

/* Custom scrollbar styles for all containers */
#chat-box::-webkit-scrollbar,
.sessions-list::-webkit-scrollbar,
.terminal-content::-webkit-scrollbar,
.config-content::-webkit-scrollbar {
    width: 6px;
}

#chat-box::-webkit-scrollbar-track,
.sessions-list::-webkit-scrollbar-track,
.terminal-content::-webkit-scrollbar-track,
.config-content::-webkit-scrollbar-track {
    background: #F9FAFB;
    border-radius: 10px;
}

#chat-box::-webkit-scrollbar-thumb,
.sessions-list::-webkit-scrollbar-thumb,
.config-content::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 10px;
}

#chat-box::-webkit-scrollbar-thumb:hover,
.sessions-list::-webkit-scrollbar-thumb:hover,
.config-content::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

/* Terminal scrollbar - darker theme */
.terminal-content::-webkit-scrollbar-track {
    background: #161B22;
    border-radius: 10px;
}

.terminal-content::-webkit-scrollbar-thumb {
    background: #30363D;
    border-radius: 10px;
}

.terminal-content::-webkit-scrollbar-thumb:hover {
    background: #484F58;
}

.message-container {
    display: flex;
    flex-direction: column;
    margin: 8px 0;
    max-width: 70%;
}

.user-message-container {
    align-self: flex-end;
    margin-left: auto;
    margin-right: 0;
}

.bot-message-container {
    align-self: flex-start;
    margin-right: auto;
    margin-left: 0;
}

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

.message-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-weight: 500;
}

.avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-right: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 11px;
}

.user-avatar {
    background-color: #8b5cf6;
    color: white;
}

.bot-avatar {
    background-color: #1f2937;
    color: white;
}

.message {
    font-size: 14px;
    line-height: 1.5;
    padding: 12px 16px;
    border-radius: 12px;
    margin-top: 2px;
}

.user-message-container .message {
    background-color: #8b5cf6;
    color: white;
    border-radius: 12px 12px 2px 12px;
}

.bot-message-container .message {
    background-color: #f1f5f9;
    color: #1f2937;
    border: 1px solid #e2e8f0;
    border-radius: 12px 12px 12px 2px;
}

.user-name {
    color: #1A1A1A;
}

.bot-name {
    color: #5436DA;
}

#input-container {
    display: flex;
    padding: 16px 20px;
    background-color: #ffffff;
    border-top: 1px solid #e5e7eb;
    gap: 10px;
    align-items: center;
    max-width: 700px;
    margin: 0 auto;
    width: 100%;
}

#input-container2 {
    display: flex;
    padding: 8px 20px 16px 20px;
    background-color: #f8fafc;
    border-top: 1px solid #e5e7eb;
    max-width: 700px;
    margin: 0 auto;
    width: 100%;
}

#user-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    outline: none;
    font-size: 14px;
    background-color: #ffffff;
    color: #1f2937;
    font-family: inherit;
    resize: none;
    min-height: 20px;
    max-height: 120px;
    transition: border-color 0.2s ease;
    line-height: 1.4;
    height: 36px;
}

#user-input:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

#prompt-input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    outline: none;
    font-size: 12px;
    background-color: #ffffff;
    color: #6b7280;
    font-family: inherit;
    resize: none;
    min-height: 16px;
    max-height: 80px;
    transition: border-color 0.2s ease;
    line-height: 1.3;
    height: 24px;
}

#prompt-input:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

#send-button {
    padding: 0;
    background-color: #8b5cf6;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    font-family: inherit;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

button {
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 2px 8px rgba(103, 126, 234, 0.2);
}

#send-button:hover {
    background-color: #7c3aed;
}

#send-button:disabled {
    background-color: #e1e5e9;
    color: #a0aec0;
    cursor: not-allowed;
}

#send-button.uploading {
    background-color: #f59e0b;
    color: white;
    cursor: not-allowed;
    width: auto;
    padding: 0 12px;
    min-width: 36px;
}

#send-button.uploading:hover {
    background-color: #f59e0b;
    transform: none;
}

.upload-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(103, 126, 234, 0.3);
}

button:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

button:disabled {
    background-color: #E4E7EC;
    color: #98A2B3;
    cursor: not-allowed;
}

.markdown-content {
    font-size: 15px;
    line-height: 1.6;
    color: #1A1A1A;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3 {
    margin-top: 1em;
    margin-bottom: 0.5em;
    font-weight: 600;
}

.markdown-content ul {
    padding-left: 1.5em;
    margin-top: 0.5em;
    margin-bottom: 1em;
}

.markdown-content ol {
    padding-left: 1.5em;
    margin-top: 0.5em;
    margin-bottom: 1em;
}

.markdown-content blockquote {
    margin: 1em 0;
    padding-left: 1em;
    border-left: 4px solid #E4E7EC;
    color: #6B7280;
    font-style: italic;
}

.markdown-content code {
    background-color: #F3F4F6;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
}

.markdown-content pre {
    background-color: #F2F4F7;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 16px 0;
}

.markdown-content pre code {
    background-color: transparent;
    padding: 0;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background-color: #98A2B3;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

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

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

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

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s, opacity 0.3s;
}

.loading-overlay.active {
    visibility: visible;
    opacity: 1;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #5436DA;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.config-container {
    display: none;
    flex-direction: column;
    width: 95%;
    max-width: 1000px;
    height: calc(100vh - 120px);
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
}

.config-container.active {
    display: flex;
}

.config-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.config-title {
    font-size: 20px;
    font-weight: 600;
    color: #1A1A1A;
}

.add-prompt-btn {
    background-color: #5436DA;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
}

.add-prompt-btn:hover {
    background-color: #4730B8;
}

.config-content {
    flex: 1;
    padding: 16px 20px;
    overflow-y: auto;
}

.prompt-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.prompt-card {
    border: 1px solid #E4E7EC;
    border-radius: 8px;
    padding: 16px;
    background: white;
    transition: all 0.3s;
}

.prompt-card:hover {
    border-color: #5436DA;
    box-shadow: 0 2px 8px rgba(84, 54, 218, 0.1);
}

.prompt-card.active {
    border-color: #5436DA;
    background: rgba(84, 54, 218, 0.02);
}

.prompt-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.prompt-info {
    flex: 1;
}

.prompt-id {
    font-size: 16px;
    font-weight: 600;
    color: #1A1A1A;
    margin-bottom: 4px;
}

.prompt-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #98A2B3;
}

.active-badge {
    background-color: #10B981;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
}

.default-badge {
    background-color: #6B7280;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
}

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

.action-btn {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.activate-btn {
    background-color: #10B981;
    color: white;
}

.activate-btn:hover {
    background-color: #059669;
}

.edit-btn {
    background-color: #F59E0B;
    color: white;
}

.edit-btn:hover {
    background-color: #D97706;
}

.delete-btn {
    background-color: #EF4444;
    color: white;
}

.delete-btn:hover {
    background-color: #DC2626;
}

.prompt-preview {
    background-color: #F9FAFB;
    padding: 12px;
    border-radius: 6px;
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.5;
    color: #6B7280;
    max-height: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 8px;
    padding: 24px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

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

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #1A1A1A;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #6B7280;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: #1A1A1A;
}

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

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #E4E7EC;
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    background: white;
    color: #1A1A1A;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #5436DA;
    box-shadow: 0 0 0 3px rgba(84, 54, 218, 0.1);
}

.form-textarea {
    min-height: 200px;
    resize: vertical;
    font-family: 'Inter', sans-serif;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.cancel-btn {
    background: transparent;
    color: #6B7280;
    border: 1px solid #E4E7EC;
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.cancel-btn:hover {
    background-color: #F9FAFB;
}

.save-btn {
    background-color: #5436DA;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
}

.save-btn:hover {
    background-color: #4730B8;
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #6B7280;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.empty-state-desc {
    font-size: 14px;
    margin-bottom: 24px;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1001;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s;
}

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

.notification.success {
    background-color: #10B981;
    color: white;
}

.notification.error {
    background-color: #EF4444;
    color: white;
}

.config-tabs {
    display: flex;
    border-bottom: 1px solid #E4E7EC;
    margin-bottom: 24px;
}

.config-tab {
    padding: 12px 24px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: #6B7280;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.config-tab.active {
    color: #5436DA;
    border-bottom-color: #5436DA;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.gpt-config-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-field {
    position: relative;
}

.form-field.full-width {
    grid-column: 1 / -1;
}

.field-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.help-icon {
    width: 14px;
    height: 14px;
    background-color: #E4E7EC;
    color: #6B7280;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    position: relative;
}

.help-tooltip {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1A1A1A;
    color: white;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.4;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 1000;
    width: 280px;
    white-space: normal;
    text-align: left;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.help-tooltip::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #1A1A1A;
}

.help-icon:hover .help-tooltip {
    opacity: 1;
    visibility: visible;
}

.config-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #E4E7EC;
}

.reset-btn {
    background: transparent;
    color: #EF4444;
    border: 1px solid #EF4444;
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.reset-btn:hover {
    background-color: #EF4444;
    color: white;
}

.range-input {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: #E4E7EC;
    border-radius: 3px;
    outline: none;
}

.range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #5436DA;
    border-radius: 50%;
    cursor: pointer;
}

.range-input::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #5436DA;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.range-value {
    font-size: 12px;
    color: #6B7280;
    margin-top: 4px;
}

select.form-input {
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

/* Header Dropdowns */
.header-dropdowns {
    display: flex;
    gap: 12px;
    align-items: center;
}

.dropdown-field {
    display: flex;
    align-items: center;
}

.header-dropdown {
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background-color: #ffffff;
    color: #1f2937;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 140px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 14px;
    padding-right: 28px;
}

.header-dropdown:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.1);
}

.header-dropdown:disabled {
    background-color: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
    border-color: #e5e7eb;
}

.header-dropdown:hover:not(:disabled) {
    background-color: #f8fafc;
    border-color: #a1a1aa;
}

/* Chat input disabled state */
#user-input:disabled {
    background-color: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
    border-color: #e5e7eb;
}

#prompt-input:disabled {
    background-color: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
    border-color: #e5e7eb;
}

#send-button:disabled {
    background-color: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
}

#send-button:disabled:hover {
    background-color: #e5e7eb;
    transform: none;
}

/* Welcome message styling */
.welcome-message {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    padding: 40px 20px;
}

.welcome-content {
    text-align: center;
    max-width: 500px;
    background-color: #f8fafc;
    padding: 32px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.welcome-content h3 {
    color: #1f2937;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-content p {
    color: #6b7280;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.welcome-content p:last-child {
    margin-bottom: 0;
}

/* File Upload Styling */
.input-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-upload-btn {
    background-color: #6b7280;
    border: 1px solid #4b5563;
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    height: 36px;
    width: 36px;
}

.file-upload-btn:hover {
    background-color: #4b5563;
    border-color: #374151;
    color: #ffffff;
}

.file-upload-btn:active {
    transform: scale(0.98);
}

/* File Preview Container */
.file-preview-container {
    max-width: 700px;
    margin: 0 auto;
    width: 100%;
    background-color: #f8fafc;
    border-top: 1px solid #e5e7eb;
    padding: 12px 20px;
}

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

.file-preview-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    color: #374151;
    max-width: 200px;
}

.file-icon {
    font-size: 14px;
    opacity: 0.7;
}

.file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    color: #6b7280;
    font-size: 11px;
}

.remove-file-btn {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 0;
    margin-left: 4px;
    font-size: 16px;
    line-height: 1;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-file-btn:hover {
    background-color: #fef2f2;
    border-radius: 3px;
}

/* Message Files Display */
.message-files {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: flex-start;
}

/* Files positioning for user messages (right-aligned) */
.user-message-container .message-files {
    justify-content: flex-end;
}

/* Files positioning for bot messages (left-aligned) */
.bot-message-container .message-files {
    justify-content: flex-start;
}

.attached-file {
    display: flex;
    align-items: center;
    gap: 6px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    color: #475569;
    max-width: 200px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: background-color 0.2s ease;
}

.attached-file:hover {
    background-color: #f1f5f9;
}

/* File styling in user message containers */
.user-message-container .attached-file {
    background-color: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.2);
    color: #6d28d9;
}

.user-message-container .attached-file:hover {
    background-color: rgba(139, 92, 246, 0.15);
}

.attached-file .file-icon {
    font-size: 12px;
}

.attached-file .file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.attached-file .file-size {
    color: #9ca3af;
    font-size: 10px;
}

.file-processed {
    color: #10b981;
    font-size: 10px;
    display: flex;
    align-items: center;
    gap: 2px;
}

.file-processing {
    color: #f59e0b;
    font-size: 10px;
    display: flex;
    align-items: center;
    gap: 2px;
}

.file-failed {
    color: #ef4444;
    font-size: 10px;
    display: flex;
    align-items: center;
    gap: 2px;
}

.file-pending {
    color: #6b7280;
    font-size: 10px;
    display: flex;
    align-items: center;
    gap: 2px;
}

.file-uploading {
    color: #3b82f6;
    font-size: 10px;
    display: flex;
    align-items: center;
    gap: 2px;
}

.file-uploaded {
    color: #059669;
    font-size: 10px;
    display: flex;
    align-items: center;
    gap: 2px;
}

/* File drop zone styling */
.file-drop-zone {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    color: #6b7280;
    background-color: #f9fafb;
    transition: all 0.2s ease;
}

.file-drop-zone.drag-over {
    border-color: #8b5cf6;
    background-color: #f3f4f6;
    color: #8b5cf6;
}

.file-drop-zone p {
    margin: 0;
    font-size: 14px;
}

/* Voice Input Styles */

/* Voice input button */
.voice-input-btn {
    background-color: #6b7280;
    border: 1px solid #4b5563;
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    height: 36px;
    width: 36px;
    margin-left: 8px;
}

.voice-input-btn:hover {
    background-color: #8b5cf6;
    border-color: #7c3aed;
    transform: scale(1.05);
}

.voice-input-btn:active {
    transform: scale(0.98);
}

.voice-input-btn.recording {
    background-color: #ef4444;
    border-color: #dc2626;
    animation: pulse-recording 1.5s ease-in-out infinite;
}

@keyframes pulse-recording {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Voice Recording Modal - Clean Tailwind Design */
.voice-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
}

.voice-modal.active {
    display: flex;
    animation: fadeIn 0.2s ease-out;
}

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

/* Clean Modal Content */
.voice-modal-content-clean {
    background: white;
    border-radius: 24px;
    padding: 48px 32px;
    width: 90%;
    max-width: 480px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animated Sound Wave Container */
.sound-wave-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 120px;
}

.sound-wave-bars {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 120px;
}

.wave-bar {
    width: 6px;
    background: linear-gradient(180deg, #8b5cf6 0%, #6366f1 100%);
    border-radius: 999px;
    animation: wave 1.2s ease-in-out infinite;
    transform-origin: center;
}

.wave-bar:nth-child(1) {
    height: 40px;
    animation-delay: 0s;
}

.wave-bar:nth-child(2) {
    height: 60px;
    animation-delay: 0.1s;
}

.wave-bar:nth-child(3) {
    height: 80px;
    animation-delay: 0.2s;
}

.wave-bar:nth-child(4) {
    height: 60px;
    animation-delay: 0.3s;
}

.wave-bar:nth-child(5) {
    height: 40px;
    animation-delay: 0.4s;
}

@keyframes wave {
    0%, 100% {
        transform: scaleY(0.5);
        opacity: 0.7;
    }
    50% {
        transform: scaleY(1.2);
        opacity: 1;
    }
}

/* Transcription Text - No Box with Scroll */
.transcription-text {
    font-size: 20px;
    line-height: 1.6;
    color: #1f2937;
    text-align: center;
    min-height: 60px;
    max-height: 200px; /* Restrict height */
    max-width: 400px;
    font-weight: 500;
    transition: all 0.2s ease;
    overflow-y: auto; /* Enable scroll */
    overflow-x: hidden;
    padding: 0 8px; /* Padding for scroll space */
    word-wrap: break-word;
    word-break: break-word;
}

.transcription-text:not(.has-text) {
    color: #9ca3af;
    font-weight: 400;
    overflow: hidden; /* No scroll when placeholder */
}

/* Clean scrollbar for transcription */
.transcription-text::-webkit-scrollbar {
    width: 4px;
}

.transcription-text::-webkit-scrollbar-track {
    background: transparent;
}

.transcription-text::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 999px;
}

.transcription-text::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Stop Recording Button - Clean Red Design */
.stop-recording-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: #ef4444;
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 25px -5px rgba(239, 68, 68, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stop-recording-btn:hover {
    background-color: #dc2626;
    transform: scale(1.05);
    box-shadow: 0 20px 30px -5px rgba(239, 68, 68, 0.4);
}

.stop-recording-btn:active {
    transform: scale(0.95);
    box-shadow: 0 5px 15px -5px rgba(239, 68, 68, 0.3);
}

.stop-recording-btn svg {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

/* Responsive Design for Voice Modal */
@media (max-width: 768px) {
    .voice-modal-content-clean {
        width: 95%;
        padding: 32px 24px;
        gap: 24px;
    }

    .sound-wave-container {
        min-height: 100px;
    }

    .sound-wave-bars {
        height: 100px;
        gap: 6px;
    }

    .wave-bar {
        width: 5px;
    }

    .wave-bar:nth-child(1) {
        height: 30px;
    }

    .wave-bar:nth-child(2) {
        height: 50px;
    }

    .wave-bar:nth-child(3) {
        height: 70px;
    }

    .wave-bar:nth-child(4) {
        height: 50px;
    }

    .wave-bar:nth-child(5) {
        height: 30px;
    }

    .transcription-text {
        font-size: 18px;
        min-height: 50px;
        max-height: 150px; /* Smaller max-height on mobile */
    }

    .stop-recording-btn {
        width: 56px;
        height: 56px;
    }

    .stop-recording-btn svg {
        width: 20px;
        height: 20px;
    }
}

/* ==================== STREAMING RESPONSE STYLES ==================== */

/* Streaming cursor animation */
.streaming-cursor {
    display: inline-block;
    animation: blink-cursor 0.8s step-end infinite;
    color: #8b5cf6;
    font-weight: bold;
    margin-left: 2px;
}

@keyframes blink-cursor {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

/* Message styling while streaming */
.streaming-response {
    position: relative;
    min-height: 24px;
}

.streaming-response::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #8b5cf6 0%, #6366f1 50%, #8b5cf6 100%);
    background-size: 200% 100%;
    animation: streaming-gradient 1.5s ease-in-out infinite;
    border-radius: 0 0 8px 8px;
}

@keyframes streaming-gradient {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: -100% 0;
    }
}

/* Stream error message styling */
.stream-error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: 8px 12px;
    margin-top: 8px;
    color: #dc2626;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Stream interrupted warning */
.stream-error.warning {
    background-color: #fffbeb;
    border-color: #fde68a;
    color: #d97706;
}

/* Smooth text appearance during streaming */
.streaming-response .markdown-content {
    animation: fade-in-text 0.1s ease-out;
}

@keyframes fade-in-text {
    from {
        opacity: 0.8;
    }
    to {
        opacity: 1;
    }
}