/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Inter', sans-serif;
    background: #ffffff;
    color: #1a1a1a;
    height: 100vh;
    overflow: hidden;
    font-weight: 400;
    line-height: 1.5;
}

/* App Container */
.app-container {
    display: flex;
    height: 100vh;
    background: #ffffff;
}

/* Sidebar */
.sidebar {
    width: 320px;
    background: #f8f9fa;
    border-right: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
    height: 100vh;
    overflow: hidden;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    flex-shrink: 0;
}

.sidebar-header h2 {
    color: #000000;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.sidebar-toggle:hover {
    background: #f1f3f4;
    color: #000000;
}

/* Sidebar Content - Scrollable Area */
.sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* Custom scrollbar for sidebar */
.sidebar-content::-webkit-scrollbar {
    width: 6px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 3px;
    transition: background 0.2s ease;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

/* Chat Controls */
.chat-controls {
    padding: 20px;
    display: flex;
    gap: 12px;
    border-bottom: 1px solid #e9ecef;
    flex-shrink: 0;
}

/* Servers Section */
.servers-section {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

.servers-section h3 {
    color: #1a1a1a;
    margin-bottom: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.add-server-form {
    margin-bottom: 20px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 12px;
    background: #ffffff;
    border: 1.5px solid #dee2e6;
    border-radius: 12px;
    color: #1a1a1a;
    font-size: 14px;
    transition: all 0.2s ease;
    font-weight: 400;
    font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
}

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

.form-input::placeholder {
    color: #6c757d;
    font-weight: 400;
    font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
}

/* Servers List */
.servers-list {
    margin-bottom: 20px;
}

/* Prompts Section */
.prompts-section {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

.prompts-section h4 {
    color: #1a1a1a;
    margin-bottom: 16px;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.prompts-list {
    margin-bottom: 20px;
}

.prompt-item {
    background: #ffffff;
    border: 1.5px solid #e9ecef;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.prompt-item:hover {
    border-color: #000000;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

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

.prompt-name {
    font-weight: 600;
    color: #000000;
    font-size: 14px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.server-badge {
    background: #f8f9fa;
    color: #6c757d;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.prompt-description {
    color: #6c757d;
    font-size: 13px;
    margin-bottom: 8px;
    line-height: 1.4;
}

.prompt-args {
    color: #6c757d;
    font-size: 12px;
    margin-top: 8px;
}

.prompt-args i {
    margin-right: 4px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 8px;
    min-width: auto;
    flex-shrink: 0;
}

.no-prompts {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    padding: 20px;
    font-size: 14px;
}

/* Servers List */
.server-item {
    background: #ffffff;
    border: 1.5px solid #e9ecef;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.server-item:hover {
    border-color: #000000;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

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

.server-name {
    font-weight: 600;
    color: #000000;
    font-size: 15px;
}

.server-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #6c757d;
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #28a745;
}

.status-dot.connected {
    background: #28a745;
}

.status-dot.disconnected {
    background: #dc3545;
}

.server-tools {
    font-size: 13px;
    color: #6c757d;
    font-weight: 400;
}

.disconnect-btn {
    background: #dc3545;
    border: none;
    color: white;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.disconnect-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

/* Model Configuration Section */
.model-section {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    background: #ffffff;
}

.model-section h3 {
    color: #1a1a1a;
    margin-bottom: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.model-config {
    margin-bottom: 16px;
}

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

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

.form-select {
    width: 100%;
    padding: 12px 16px;
    background: #ffffff;
    border: 1.5px solid #dee2e6;
    border-radius: 12px;
    color: #1a1a1a;
    font-size: 14px;
    transition: all 0.2s ease;
    font-weight: 400;
    cursor: pointer;
}

.form-select:focus {
    outline: none;
    border-color: #000000;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.form-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #dee2e6;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.form-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #000000;
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.1);
}

.form-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #000000;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.current-model {
    background: #f8f9fa;
    border: 1.5px solid #e9ecef;
    border-radius: 12px;
    padding: 12px 16px;
    margin-top: 16px;
}

.model-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.model-provider {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.model-name {
    font-size: 14px;
    color: #000000;
    font-weight: 600;
}

/* Quick Connect */
.quick-connect {
    padding: 20px;
}

.quick-connect h4 {
    color: #1a1a1a;
    margin-bottom: 12px;
    font-size: 1rem;
    font-weight: 600;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

/* Chat Header */
.chat-header {
    padding: 24px 30px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.chat-title h1 {
    color: #000000;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #28a745;
}

/* Chat Container */
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px 30px;
    display: flex;
    flex-direction: column;
    scroll-behavior: smooth;
}

.chat-messages {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Welcome Message */
.welcome-message {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    text-align: center;
}

.welcome-content {
    max-width: 500px;
}

.welcome-icon {
    font-size: 4rem;
    color: #000000;
    margin-bottom: 24px;
}

.welcome-content h2 {
    color: #000000;
    font-size: 2rem;
    margin-bottom: 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.welcome-content p {
    font-size: 1.1rem;
    color: #6c757d;
    margin-bottom: 30px;
    font-weight: 400;
    line-height: 1.6;
}

.welcome-actions {
    margin: 24px 0 30px 0;
    text-align: center;
}

.welcome-btn {
    padding: 14px 28px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    border-radius: 16px !important;
    transition: all 0.3s ease !important;
}

.welcome-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2) !important;
}

.welcome-features {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: #6c757d;
    font-weight: 500;
}

.feature i {
    font-size: 1.5rem;
    color: #000000;
}

/* Chat Messages */
.message {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease;
}

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

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

.message.user .message-avatar {
    background: #000000;
    color: #ffffff;
}

.message.assistant .message-avatar {
    background: #f8f9fa;
    color: #000000;
    border: 1.5px solid #e9ecef;
}

.message-content {
    flex: 1;
    max-width: 70%;
}

.message.user .message-content {
    text-align: right;
}

/* Message Provider Information */
.message-provider {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 11px;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.message-provider i {
    font-size: 10px;
    color: #000000;
}

.provider-name {
    color: #000000;
    font-weight: 600;
}

.model-name {
    color: #6c757d;
    font-weight: 400;
    font-style: italic;
}

.provider-name::after {
    content: "•";
    margin: 0 6px;
    color: #dee2e6;
    font-weight: normal;
}

.message-bubble {
    padding: 16px 20px;
    border-radius: 20px;
    word-wrap: break-word;
    line-height: 1.5;
    font-weight: 400;
}

.message.user .message-bubble {
    background: #000000;
    color: #ffffff;
    border-bottom-right-radius: 8px;
}

.message.assistant .message-bubble {
    background: #f8f9fa;
    color: #1a1a1a;
    border-bottom-left-radius: 8px;
    border: 1.5px solid #e9ecef;
}

.message-time {
    font-size: 12px;
    color: #6c757d;
    margin-top: 6px;
    font-weight: 400;
}

.message.user .message-time {
    text-align: right;
}

/* Tool Call Indicators */
.tool-call {
    background: #000000;
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 12px;
    margin: 6px 0;
    display: inline-block;
    font-weight: 500;
}

/* Code Blocks */
.message-bubble code {
    background: #f1f3f4 !important;
    color: #1a1a1a !important;
    padding: 3px 8px !important;
    border-radius: 6px !important;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace !important;
    font-size: 13px !important;
    border: 1px solid #e9ecef !important;
}

.message-bubble pre {
    background: #f8f9fa !important;
    color: #1a1a1a !important;
    padding: 16px !important;
    border-radius: 12px !important;
    overflow-x: auto !important;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace !important;
    margin: 12px 0 !important;
    border: 1.5px solid #e9ecef !important;
}

.message-bubble pre code {
    background: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    border: none !important;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    color: #6c757d;
    font-style: italic;
    font-weight: 400;
}

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

.typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #000000;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

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

/* Scroll to Bottom Button */
.scroll-to-bottom {
    position: absolute;
    bottom: 120px;
    right: 30px;
    width: 44px;
    height: 44px;
    background: #000000;
    border: none;
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    z-index: 10;
}

.scroll-to-bottom:hover {
    background: #333333;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* Chat Input */
.chat-input-container {
    padding: 24px 30px;
    border-top: 1px solid #e9ecef;
    background: #ffffff;
    position: relative;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

.chat-input-wrapper {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    background: #ffffff;
    border: 1.5px solid #e9ecef;
    border-radius: 16px;
    padding: 16px 20px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.chat-input-wrapper:focus-within {
    border-color: #000000;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.chat-input {
    flex: 1;
    background: none;
    border: none;
    color: #1a1a1a;
    font-size: 16px;
    resize: none;
    outline: none;
    min-height: 24px;
    max-height: 120px;
    line-height: 1.5;
    font-weight: 400;
}

.chat-input::placeholder {
    color: #6c757d;
    font-weight: 400;
}

.send-button {
    background: #000000;
    border: none;
    color: #ffffff;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.send-button:hover:not(:disabled) {
    background: #333333;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.send-button:disabled {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.send-button.stop-mode {
    background: #dc3545 !important;
    color: #ffffff !important;
}

.send-button.stop-mode:hover {
    background: #c82333 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3) !important;
}

.input-footer {
    margin-top: 10px;
    text-align: center;
}

.input-hint {
    font-size: 12px;
    color: #6c757d;
    font-weight: 400;
}

/* Buttons */
.btn {
    padding: 12px 18px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    letter-spacing: -0.01em;
}

.btn-primary {
    background: #000000;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background: #333333;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.2);
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.btn-success {
    background: #28a745;
    color: white;
    width: 100%;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.2);
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-outline {
    background: transparent;
    color: #6c757d;
    border: 1.5px solid #dee2e6;
    width: 100%;
    justify-content: center;
    margin-bottom: 10px;
}

.btn-outline:hover {
    background: #f8f9fa;
    color: #000000;
    border-color: #000000;
    transform: translateY(-1px);
}

.btn-icon {
    background: transparent;
    color: #6c757d;
    border: 1.5px solid #dee2e6;
    width: 44px;
    height: 44px;
    padding: 0;
    justify-content: center;
    border-radius: 12px;
}

.btn-icon:hover {
    background: #f8f9fa;
    color: #000000;
    border-color: #000000;
    transform: translateY(-1px);
}

/* Notifications */
.notification-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notification {
    background: #ffffff;
    border: 1.5px solid #e9ecef;
    border-radius: 12px;
    padding: 16px 20px;
    color: #1a1a1a;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease;
    max-width: 380px;
    font-weight: 500;
}

.notification.success {
    border-color: #28a745;
    background: #d4edda;
    color: #155724;
}

.notification.error {
    border-color: #dc3545;
    background: #f8d7da;
    color: #721c24;
}

.notification.info {
    border-color: #007bff;
    background: #d1ecf1;
    color: #0c5460;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    text-align: center;
    color: #1a1a1a;
    background: #ffffff;
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1.5px solid #e9ecef;
}

.loading-spinner i {
    font-size: 2.5rem;
    color: #000000;
    margin-bottom: 16px;
}

.loading-spinner p {
    font-weight: 500;
    color: #6c757d;
}

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

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

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 100;
        transform: translateX(-100%);
        overflow: hidden;
    }

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

    .sidebar-content {
        height: calc(100vh - 80px); /* Account for header height */
        overflow-y: auto;
        overflow-x: hidden;
    }

    .main-content {
        margin-left: 0;
    }

    .chat-header,
    .chat-container,
    .chat-input-container {
        padding-left: 20px;
        padding-right: 20px;
    }

    .welcome-features {
        flex-direction: column;
        gap: 20px;
    }

    .message-content {
        max-width: 85%;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 4px;
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

/* Chat List Styles */
.chat-list {
    margin-bottom: 20px;
}

.chat-name {
    font-weight: 600;
    color: #000000;
    font-size: 14px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-date {
    font-size: 11px;
    color: #6c757d;
    font-weight: 400;
    font-style: italic;
}

.sidebar-section {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

.sidebar-section h3 {
    color: #1a1a1a;
    margin-bottom: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-section h3 i {
    color: #6c757d;
    font-size: 1rem;
}

/* Chat History Section */
.chat-history-section {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

.chat-history-section h3 {
    color: #1a1a1a;
    margin-bottom: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-history-section h3 i {
    color: #6c757d;
    font-size: 1rem;
}

.no-chats {
    text-align: center;
    color: #6c757d;
    font-size: 14px;
    padding: 20px 10px;
    border: 1.5px dashed #dee2e6;
    border-radius: 12px;
    background: #f8f9fa;
}

.no-chats p {
    margin: 0 0 8px 0;
}

.no-chats p:last-child {
    margin-bottom: 0;
    font-weight: 500;
}

/* Active chat item */
.chat-item.active {
    background: #000000;
    border-color: #000000;
    color: #ffffff;
}

.chat-item.active .chat-name {
    color: #ffffff;
}

.chat-item.active .chat-date {
    color: #e9ecef;
}

.chat-item.active:hover {
    background: #333333;
    border-color: #333333;
    transform: translateY(-1px);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 4px;
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.modal-dialog {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
    border: 1.5px solid #e9ecef;
    max-width: 400px;
    width: 90%;
    animation: slideUp 0.3s ease;
}

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

.modal-header h3 {
    color: #000000;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f8f9fa;
    color: #000000;
}

.modal-body {
    padding: 24px;
}

.modal-body label {
    display: block;
    margin-bottom: 8px;
    color: #000000;
    font-size: 14px;
    font-weight: 500;
}

.input-help {
    font-size: 12px;
    color: #6c757d;
    margin-top: 8px;
    margin-bottom: 0;
}

.text-danger {
    color: #dc3545 !important;
}

.text-warning {
    color: #856404 !important;
}

.modal-footer {
    padding: 16px 24px 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-footer .btn {
    min-width: 100px;
}

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

/* Chat Item with Delete Button */
.chat-item {
    background: #ffffff;
    border: 1.5px solid #e9ecef;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-item-content {
    flex: 1;
    min-width: 0;
}

.chat-item-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
    margin-left: 8px;
}

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

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

.chat-delete-btn:hover {
    background: #c82333;
    transform: scale(1.05);
}

.welcome-content p {
    font-size: 1.1rem;
    color: #6c757d;
    margin-bottom: 30px;
    font-weight: 400;
    line-height: 1.6;
}

.welcome-message.chat-ready {
    height: auto;
    margin: 40px 0;
}

.welcome-message.chat-ready .welcome-content {
    max-width: 500px;
}

.welcome-message.chat-ready .welcome-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
    color: #000000;
}

.welcome-message.chat-ready h2 {
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: #28a745;
}

.welcome-message.chat-ready p {
    font-size: 1rem;
    margin-bottom: 0;
    color: #6c757d;
    font-style: italic;
}

.welcome-actions {
    margin: 24px 0 30px 0;
    text-align: center;
}

/* User Profile Section */
.user-profile-section {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

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

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

.user-details {
    flex: 1;
}

.user-email {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 8px;
    word-break: break-word;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.btn-outline:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Dark mode adjustments for user profile */
body.dark-mode .user-profile-section {
    background: #2a2a2a;
    border-color: #404040;
}

body.dark-mode .user-email {
    color: #e0e0e0;
}

body.dark-mode .btn-outline {
    border-color: #404040;
    color: #b0b0b0;
}

body.dark-mode .btn-outline:hover {
    background: #3a3a3a;
    border-color: #667eea;
    color: #667eea;
}

/* User Profile Bottom Section */
.user-profile-bottom {
    position: relative;
    padding: 16px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

.user-avatar-container {
    position: relative;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.user-avatar-bottom {
    width: 32px;
    height: 32px;
    background: #000000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 3px solid #f8f9fa;
}

.user-avatar-bottom:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    background: #333333;
}

.user-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 10px;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    padding: 16px;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 12px;
    border: 8px solid transparent;
    border-top-color: #ffffff;
}

.user-dropdown-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-email-display {
    font-size: 14px;
    color: #1a1a1a;
    font-weight: 500;
    text-align: center;
    padding: 8px 0;
    border-radius: 8px;
    word-break: break-word;
}

.dropdown-logout-btn {
    background: none;
    color: #000000;
    border: none;
    padding: 8px 0;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    text-decoration: none;
}

.dropdown-logout-btn:hover {
    color: #333333;
}

.dropdown-logout-btn i {
    font-size: 12px;
}

/* Dark mode adjustments for bottom user profile */
body.dark-mode .user-profile-bottom {
    border-top-color: #404040;
    background: #1a1a1a;
}

body.dark-mode .user-avatar-bottom {
    border-color: #1a1a1a;
    background: #000000;
}

body.dark-mode .user-dropdown {
    background: #2a2a2a;
    border-color: #404040;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

body.dark-mode .user-dropdown::after {
    border-top-color: #2a2a2a;
}

body.dark-mode .user-email-display {
    background: #3a3a3a;
    border-color: #404040;
    color: #e0e0e0;
}

body.dark-mode .dropdown-logout-btn {
    background: #dc3545;
}

body.dark-mode .dropdown-logout-btn:hover {
    background: #c82333;
}

/* Markdown custom styles */
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  font-weight: bold;
  text-decoration: none;
  margin-top: 1em;
  margin-bottom: 1em;
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 2em;
}

.markdown-body ul li,
.markdown-body ol li {
  font-weight: normal !important;
  text-decoration: none !important;
}

.markdown-body a {
  color: #111;
  text-decoration: none;
}

.markdown-body table {
  border-collapse: collapse;
  width: 100%;
}

.markdown-body th, .markdown-body td {
  border: 1px solid #888;
  padding: 8px;
  text-align: left;
}

.markdown-body th {
  background: #f5f5f5;
}

.markdown-body ul li strong,
.markdown-body ol li strong {
  font-weight: normal !important;
} 