:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f9f9f9;
    --text-primary: #0d0d0d;
    --text-secondary: #676767;
    --text-muted: #8e8ea0;
    --border-light: #e5e5e5;
    --user-bg: #2f2f2f;
    --user-text: #ffffff;
    --button-bg: #f4f4f4;
    --button-hover: #e8e8e8;
    --input-border: #d1d5db;
    --input-focus: #10a37f;
}

.app-container {
    max-width: 850px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    position: relative;
}

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

.messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.messages-area::-webkit-scrollbar {
    width: 4px;
}

.messages-area::-webkit-scrollbar-track {
    background: transparent;
}

.messages-area::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 2px;
}

.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 20px 40px;
    min-height: 400px;
}

.welcome-title {
    font-size: 32px;
    font-weight: 400;
    margin-bottom: 32px;
    color: var(--text-primary);
    line-height: 1.2;
}

.suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    max-width: 600px;
}

.suggestion-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgb(234, 237, 239);
    border: none;
    border-radius: 20px;
    cursor: pointer;
    color: #475569;
    font-size: 14px;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-weight: 600;
}

.suggestion-btn:hover {
    background: var(--button-hover);
    border-color: var(--input-border);
}

.suggestion-btn i {
    font-size: 12px;
    color: var(--text-secondary);
}

.message {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    max-width: 100%;
}

.message.user {
    flex-direction: row-reverse;
    margin-left: 64px;
}

.message.assistant {
    margin-right: 64px;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
    margin-top: 4px;
}

.message.assistant .message-avatar {
    background: #5DADE2;
    color: white;
}

.message.user .message-avatar {
background: #0366d6;
border: 2px solid #f8fafc;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
color: white;
display: flex;
align-items: center;
justify-content: center;
font-weight: 600;
font-size: 14px;
}

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

.message.assistant .message-bubble {
    background: transparent;
    color: rgb(32, 33, 36);;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    max-width: 80px;
}

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

.typing-dot {
    width: 4px;
    height: 4px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

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

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

.input-area {
    padding: 24px;
    background: var(--bg-primary);
}

.input-container {
    max-width: 650px;
    margin: 0 auto;
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background: var(--bg-primary);
    border: 1px solid rgb(209, 217, 224);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border-radius: 30px;
    padding: 12px 16px;
    transition: all 0.2s ease;
}

.input-wrapper:focus-within {
    border-color: #0366d6;
}

.message-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 16px;
    color: var(--text-primary);
    outline: none;
    resize: none;
    min-height: 24px;
    max-height: 200px;
    font-family: inherit;
    line-height: 1.5;
}

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

.send-button {
    width: 38px;
    height: 38px;
    background-color: #0366d6;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    font-size: 22px;
    font-weight: 800;
}

.send-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.footer-text {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.message-bubble h1, .message-bubble h2, .message-bubble h3 {
    margin-bottom: 12px;
    font-weight: 600;
    line-height: 1.3;
}

.message-bubble h1 {
    font-size: 20px;
}

.message-bubble h2 {
    font-size: 18px;
}

.message-bubble h3 {
    font-size: 16px;
}

.message-bubble p {
    margin-bottom: 12px;
}

.message-bubble p:last-child {
    margin-bottom: 0;
}

.message-bubble ul, .message-bubble ol {
    margin: 6px 0;
    padding-left: 20px;
}

.message-bubble code {
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
}

.message-bubble pre {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 12px 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
}

.message-bubble strong {
    font-weight: 600;
}

.message-bubble em {
    font-style: italic;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

.add-button {
    width: 36px;
height: 36px;
font-size: 18px;
border: none;
border-radius: 50%;
background: none;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 200ms ease;
color: #657786;
position: relative;
}

        .message-actions {
            display: flex;
            align-items: center;
            gap: 4px;
            margin-top: 8px;
            opacity: 0;
            transition: opacity 0.2s ease;
        }

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

        .message-action-btn {
            background: none;
            border: none;
            padding: 6px 8px;
            border-radius: 6px;
            cursor: pointer;
            color: #5f6368;
            font-size: 16px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
            position: relative;
        }

        .message-action-btn:hover {
            background-color: #f1f3f4;
            color: #202124;
        }

        .message-action-btn:active {
            transform: scale(0.95);
        }

        .message-action-btn.active {
            color: #1a73e8;
            background-color: #e8f0fe;
        }

        .message-action-btn.active.thumbs-down {
            color: #ea4335;
            background-color: #fce8e6;
        }

        .message-action-btn i {
            font-size: 16px;
        }

        .message-action-btn::after {
            content: attr(data-tooltip);
            position: absolute;
            bottom: 100%;
            left: 50%;
            transform: translateX(-50%) translateY(-4px);
            background-color: #202124;
            color: white;
            padding: 6px 10px;
            border-radius: 6px;
            font-size: 12px;
            white-space: nowrap;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.2s ease, transform 0.2s ease;
            z-index: 1000;
        }

        .message-action-btn:hover::after {
            opacity: 1;
            transform: translateX(-50%) translateY(-8px);
        }

        .more-options-menu {
            position: absolute;
            bottom: 100%;
            right: 0;
            background: white;
            border: 1px solid rgb(230, 230, 230);
            border-radius: 8px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            min-width: 180px;
            opacity: 0;
            visibility: hidden;
            transform: translateY(4px);
            transition: all 0.2s ease;
            z-index: 1000;
            margin-bottom: 8px;
        }

        .more-options-menu.show {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
        }

        .more-options-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 10px 16px;
            cursor: pointer;
            transition: background-color 0.2s ease;
            color: #202124;
            font-size: 14px;
        }

        .more-options-item:first-child {
            border-radius: 8px 8px 0 0;
        }

        .more-options-item:last-child {
            border-radius: 0 0 8px 8px;
        }

        .more-options-item:hover {
            background-color: #f1f3f4;
        }

        .more-options-item i {
            font-size: 14px;
            color: #5f6368;
            width: 16px;
        }

        .feedback-toast {
            position: fixed;
            bottom: 24px;
            left: 50%;
            transform: translateX(-50%);
            background-color: #202124;
            color: white;
            padding: 12px 20px;
            border-radius: 8px;
            font-size: 14px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s ease;
            z-index: 10000;
        }

        .feedback-toast.show {
            opacity: 1;
            visibility: visible;
        }

        .action-btn {
            position: fixed;
            width: 38px;
            height: 38px;
            border-radius: 8px;
            border: none;
            color: white;
            font-size: 20px;
            cursor: pointer;
            z-index: 999;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .attachment-btn {
            right: 20px;
            bottom: 220px;
            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
        }

        .attachment-btn:hover {
            box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
        }

        .apps-btn {
            right: 20px;
            bottom: 150px;
            background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
        }

        .apps-btn:hover {
            box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
        }

        .workbench-toggle-btn {
            right: 20px;
            bottom: 80px;
            background: #0366d6;
            position: fixed;
            width: 38px;
            height: 38px;
            border-radius: 8px;
            border: none;
            color: white;
            font-size: 20px;
            cursor: pointer;
            z-index: 999;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .workbench-panel {
            position: fixed;
            top: 45px;
            right: 0;
            width: 500px;
            height: calc(100vh - 45px);
            background: white;
            border-left: 1px solid rgb(230, 230, 230);
            transform: translateX(100%);
            transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            z-index: 998;
            display: flex;
            flex-direction: column;
        }

        .workbench-panel.open {
            transform: translateX(0);
        }

        .workbench-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 16px 20px;
            border-bottom: 1px solid rgb(230, 230, 230);
            background-color: #f0f9ff;
        }

        .workbench-title {
            font-size: 18px;
            font-weight: 600;
            color: #202124;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .workbench-title i {
            color: #0366d6;
        }

        .workbench-close {
            background: none;
            border: none;
            font-size: 20px;
            color: #5f6368;
            cursor: pointer;
            padding: 4px 8px;
            border-radius: 4px;
            transition: all 0.2s ease;
        }

        .workbench-close:hover {
            color: #ef4444;
        }

        .workbench-tabs {
            display: flex;
            border-bottom: 1px solid rgb(230, 230, 230);
        }

        .workbench-tab {
            flex: 1;
            padding: 12px 16px;
            background: none;
            border: none;
            color: #5f6368;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            border-bottom: 2px solid transparent;
        }

        .workbench-tab:hover {
            background-color: rgba(102, 126, 234, 0.05);
            color: #202124;
        }

        .workbench-tab.active {
            color: #0366d6;
            background-color: white;
            border-bottom-color: #0366d6;
        }

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

        .tab-content {
            display: none;
        }

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

        .code-editor-container {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .code-editor-header {
            display: flex;
            gap: 8px;
            align-items: center;
        }

        .language-select {
            flex: 1;
            padding: 8px 12px;
            border: 1px solid rgb(230, 230, 230);
            border-radius: 6px;
            font-size: 14px;
            background: white;
            cursor: pointer;
        }

        .run-code-btn {
            padding: 8px 16px;
            background: #0366d6;
            color: white;
            border: none;
            border-radius: 6px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .run-code-btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
        }

        .code-editor {
            width: 100%;
            min-height: 300px;
            padding: 16px;
            border: 1px solid rgb(230, 230, 230);
            border-radius: 8px;
            font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
            font-size: 13px;
            line-height: 1.5;
            resize: vertical;
            background: #1e1e1e;
            color: #d4d4d4;
        }

        .code-output {
            min-height: 100px;
            padding: 16px;
            background: #f8f9fa;
            border: 1px solid rgb(230, 230, 230);
            border-radius: 8px;
            font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
            font-size: 13px;
            color: #24292e;
            white-space: pre-wrap;
        }

        .code-output:empty::before {
            content: 'Output will appear here...';
            color: #9ca3af;
        }

        .plot-creator-container {
            display: flex;
            flex-direction: column;
            gap: 16px;
        }

        .form-group-workbench {
            display: flex;
            flex-direction: column;
            gap: 6px;
        }

        .form-group-workbench label {
            font-size: 13px;
            font-weight: 600;
            color: #374151;
        }

        .form-group-workbench input,
        .form-group-workbench select,
        .form-group-workbench textarea {
            padding: 8px 12px;
            border: 1px solid rgb(230, 230, 230);
            border-radius: 6px;
            font-size: 14px;
        }

        .form-group-workbench textarea {
            min-height: 80px;
            font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
            font-size: 13px;
        }

        .generate-plot-btn {
            padding: 10px 20px;
            background: #0366d6;
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s ease;
        }

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

        .plot-preview {
            min-height: 300px;
            border: 1px solid rgb(230, 230, 230);
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: #f9fafb;
            overflow: hidden;
        }

        .plot-preview canvas {
            max-width: 100%;
            max-height: 100%;
        }

        .plot-preview:empty::before {
            content: 'Plot preview will appear here';
            color: #9ca3af;
            font-size: 14px;
        }

        /* Image Generator Styles */
        .image-generator-container {
            display: flex;
            flex-direction: column;
            gap: 16px;
        }

        .image-settings {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 12px;
        }

        .generate-image-btn {
            padding: 12px 24px;
            background: #0366d6;
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }

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

        .generate-image-btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            transform: none;
        }

        .image-status {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 16px;
            background: #f0f9ff;
            border: 1px solid #bae6fd;
            border-radius: 8px;
            color: #0369a1;
            font-size: 14px;
            font-weight: 500;
        }

        .status-spinner {
            width: 20px;
            height: 20px;
            border: 3px solid #e0f2fe;
            border-top-color: #0369a1;
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        .image-preview-container {
            min-height: 400px;
            border: 2px dashed rgb(230, 230, 230);
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: #f9fafb;
            overflow: hidden;
            position: relative;
        }

        .image-preview-container.has-image {
            border-style: solid;
            border-color: #d1d5db;
            background: #ffffff;
        }

        .image-placeholder {
            text-align: center;
            color: #9ca3af;
            padding: 40px;
        }

        .image-placeholder i {
            font-size: 48px;
            margin-bottom: 16px;
            opacity: 0.5;
        }

        .image-placeholder p {
            margin: 8px 0;
            font-size: 15px;
            font-weight: 500;
            color: #6b7280;
        }

        .image-placeholder small {
            font-size: 13px;
            color: #9ca3af;
        }

        .image-preview-container img {
            max-width: 100%;
            max-height: 500px;
            width: auto;
            height: auto;
            display: block;
            border-radius: 8px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }

        .image-actions {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 8px;
            padding-top: 8px;
        }

        .image-action-btn {
            padding: 10px 16px;
            background: #0366d6;
            color: white;
            border: none;
            border-radius: 6px;
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
        }

        .image-action-btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
        }

        .image-action-btn.secondary {
            background: linear-gradient(135deg, #f3f4f6 0%, rgb(230, 230, 230) 100%);
            color: #374151;
        }

        .image-action-btn.secondary:hover {
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }

        .image-info {
            background: #f8fafc;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            padding: 16px;
            margin-top: 8px;
        }

        .info-section {
            margin-bottom: 12px;
        }

        .info-section:last-child {
            margin-bottom: 0;
        }

        .info-section strong {
            display: block;
            font-size: 12px;
            color: #64748b;
            margin-bottom: 4px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .info-section p {
            margin: 0;
            font-size: 13px;
            color: #475569;
            line-height: 1.5;
        }

        /* Data Table Styles */
        .data-table-container {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .upload-area {
            border: 2px dashed #d1d5db;
            border-radius: 8px;
            padding: 32px;
            text-align: center;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .upload-area:hover {
            border-color: #0366d6;
            background-color: rgba(102, 126, 234, 0.05);
        }

        .upload-area i {
            font-size: 32px;
            color: #9ca3af;
            margin-bottom: 12px;
        }

        .upload-area p {
            margin: 8px 0 0 0;
            color: #6b7280;
            font-size: 14px;
        }

        .upload-area input[type="file"] {
            display: none;
        }

        .data-preview {
            max-height: 400px;
            overflow: auto;
            border: 1px solid rgb(230, 230, 230);
            border-radius: 8px;
        }

        .data-preview table {
            width: 100%;
            border-collapse: collapse;
            font-size: 13px;
        }

        .data-preview th,
        .data-preview td {
            padding: 8px 12px;
            text-align: left;
            border-bottom: 1px solid rgb(230, 230, 230);
        }

        .data-preview th {
            background: #f9fafb;
            font-weight: 600;
            position: sticky;
            top: 0;
            z-index: 1;
        }

        .data-preview tr:hover {
            background-color: #f9fafb;
        }

        /* Notes Styles */
        .notes-container {
            display: flex;
            flex-direction: column;
            gap: 12px;
            height: 100%;
        }

        .notes-editor {
            flex: 1;
            width: 100%;
            min-height: 400px;
            padding: 16px;
            border: 1px solid rgb(230, 230, 230);
            border-radius: 8px;
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            font-size: 14px;
            line-height: 1.6;
            resize: vertical;
        }

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

        .notes-btn {
            padding: 8px 16px;
            background: white;
            border: 1px solid rgb(230, 230, 230);
            border-radius: 6px;
            font-size: 14px;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .notes-btn:hover {
            background: #f9fafb;
        }

        .notes-btn.primary {
            background: #0366d6;
            color: white;
            border: none;
        }

        .notes-btn.primary:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
        }

        .main-container.workbench-open .content-area {
            margin-right: 500px;
            transition: margin-right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        @media (max-width: 1200px) {
            .workbench-panel {
                width: 400px;
            }

            .main-container.workbench-open .content-area {
                margin-right: 400px;
            }

            .image-settings {
                grid-template-columns: 1fr;
            }

            .image-actions {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        @media (max-width: 768px) {
            .workbench-panel {
                width: 100%;
            }

            .main-container.workbench-open .content-area {
                display: none;
            }

            .image-settings {
                grid-template-columns: 1fr;
            }

            .image-actions {
                grid-template-columns: repeat(2, 1fr);
            }
        }


        /* ===== PREMIUM TATWD LANDING PAGE STYLES ===== */

/* CSS Variables for consistent theming */
:root {
    /* Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --accent-primary: #0366d6;
    --accent-secondary: #1e40af;
    --user-bg: #0366d6;
    --user-text: #ffffff;
    --assistant-bg: #ffffff;
    --assistant-text: #0f172a;
    --hover-bg: #f8fafc;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Border radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}


/* ===== MAIN LAYOUT ===== */

.app-container {
    max-width: 768px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    background: var(--bg-primary);
}

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

.messages-area {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-xl) var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
    scroll-behavior: smooth;
}

.messages-area::-webkit-scrollbar {
    width: 6px;
}

.messages-area::-webkit-scrollbar-track {
    background: transparent;
}

.messages-area::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-full);
    border: 2px solid transparent;
    background-clip: padding-box;
}

.messages-area::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
    background-clip: padding-box;
}

/* ===== WELCOME SCREEN ===== */

.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-2xl) var(--space-lg);
    min-height: 60vh;
    animation: fadeInUp 0.6s ease-out;
}

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

.welcome-title {
    font-size: clamp(2rem, 5vw, 2.5rem);
    font-weight: 600;
    margin-bottom: var(--space-xl);
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.shell-we-begin-h2 {
    font-size: clamp(1.75rem, 4vw, 2rem);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-xl);
    background: #0366d6;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.suggestions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-md);
    width: 100%;
    max-width: 600px;
}

.suggestion-btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-normal);
    text-align: left;
    line-height: 1.5;
    position: relative;
    overflow: hidden;
}

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

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

.suggestion-btn:hover {
    background: var(--bg-primary);
    border-color: var(--accent-primary);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.suggestion-btn i {
    font-size: 16px;
    color: var(--accent-primary);
    flex-shrink: 0;
}

/* ===== MESSAGE COMPONENTS ===== */

.message {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
    max-width: 100%;
    animation: messageSlideIn 0.4s ease-out;
}

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

.message.user {
    flex-direction: row-reverse;
    margin-left: var(--space-2xl);
}

.message.assistant {
    margin-right: var(--space-2xl);
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
    font-weight: 600;
    margin-top: 2px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.message.assistant .message-avatar {
    background: #0366d6;
    color: white;
    border: 2px solid var(--bg-primary);
}

.message.user .message-avatar {
    background: var(--user-bg);
    fill: #5DADE2 !important;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(120, 115, 245, 0.3));
    border: 2px solid var(--bg-primary);
}

.message-content {
    flex: 1;
    min-width: 0;
    position: relative;
}

.message-bubble {
    background: var(--assistant-bg);
    color: rgb(32, 33, 36);;
    padding: var(--space-lg);
    border-radius: var(--radius-xl);
    font-size: 15px;
    line-height: 1.7;
    word-wrap: break-word;
    position: relative;
    transition: all var(--transition-normal);
}

.message.user .message-bubble {
    background: rgba(233, 233, 233);
    color: rgb(32, 33, 36);
}

/* ===== TYPOGRAPHY IN MESSAGES ===== */

.message-bubble h1,
.message-bubble h2,
.message-bubble h3,
.message-bubble h4,
.message-bubble h5,
.message-bubble h6 {
    margin: var(--space-lg) 0 var(--space-md) 0;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: -0.025em;
}

.message-bubble h1:first-child,
.message-bubble h2:first-child,
.message-bubble h3:first-child,
.message-bubble h4:first-child,
.message-bubble h5:first-child,
.message-bubble h6:first-child {
    margin-top: 0;
}

.message-bubble h1 {
    font-size: 1.5rem;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: var(--space-sm);
}

.message-bubble h2 {
    font-size: 1.25rem;
    color: var(--text-primary);
}

.message-bubble h3 {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

.message-bubble h4 {
    font-size: 1rem;
    color: var(--text-secondary);
}

.message-bubble h5,
.message-bubble h6 {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.message-bubble p {
    margin: var(--space-md) 0;
    color: var(--text-primary);
    font-weight: 400;
}

.message-bubble p:first-child {
    margin-top: 0;
}

.message-bubble p:last-child {
    margin-bottom: 0;
}

.message-bubble strong {
    font-weight: 600;
    color: var(--text-primary);
}

.message-bubble em {
    font-style: italic;
    color: var(--text-secondary);
}

/* Links */
.message-bubble a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-fast);
    border-bottom: 1px solid transparent;
}

.message-bubble a:hover {
    color: var(--accent-secondary);
    border-bottom-color: currentColor;
}

.message.user .message-bubble a {
    color: rgba(255, 255, 255, 0.9);
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

.message.user .message-bubble a:hover {
    color: white;
    border-bottom-color: white;
}

/* Lists */
.message-bubble ul,
.message-bubble ol {
    margin: var(--space-md) 0;
    padding-left: var(--space-xl);
}

.message-bubble ul {
    list-style-type: none;
    position: relative;
}

.message-bubble ul li::before {
    content: '•';
    color: var(--accent-primary);
    font-weight: bold;
    position: absolute;
    margin-left: -20px;
}

.message-bubble ol {
    list-style-type: decimal;
}

.message-bubble li {
    margin: var(--space-sm) 0;
    line-height: 1.7;
    color: var(--text-primary);
}

.message-bubble ul ul,
.message-bubble ol ul,
.message-bubble ul ol,
.message-bubble ol ol {
    margin: var(--space-xs) 0;
}

/* Code */
.message-bubble code {
    background: var(--bg-tertiary);
    color: var(--accent-secondary);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
}

.message.user .message-bubble code {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.95);
    border-color: rgba(255, 255, 255, 0.3);
}

.message-bubble pre {
    background: #1e293b;
    color: #f1f5f9;
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    margin: var(--space-lg) 0;
    border: 1px solid #334155;
    box-shadow: var(--shadow-md);
    position: relative;
}

.message-bubble pre code {
    background: transparent;
    padding: 0;
    color: inherit;
    font-size: 0.875rem;
    line-height: 1.6;
    border: none;
}

.message-bubble .code-block-wrapper {
    position: relative;
    margin: var(--space-lg) 0;
}

.message-bubble .code-language {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    background: #334155;
    color: #cbd5e1;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Blockquotes */
.message-bubble blockquote {
    margin: var(--space-lg) 0;
    padding: var(--space-lg);
    border-left: 4px solid var(--accent-primary);
    background: var(--bg-secondary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    color: var(--text-secondary);
    font-style: italic;
    position: relative;
}

.message-bubble blockquote::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: var(--space-md);
    font-size: 2rem;
    color: var(--accent-primary);
    font-family: serif;
}

.message-bubble blockquote p {
    margin: 0;
    font-weight: 500;
}

/* Tables */
.message-bubble table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--space-lg) 0;
    font-size: 0.875rem;
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.message-bubble th,
.message-bubble td {
    border: 1px solid var(--border-color);
    padding: var(--space-md);
    text-align: left;
}

.message-bubble th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
}

.message-bubble tr:hover {
    background: var(--hover-bg);
}

.message-bubble tr:nth-child(even) {
    background: rgba(248, 250, 252, 0.5);
}

/* Horizontal rules */
.message-bubble hr {
    border: none;
    border-top: 2px solid var(--border-color);
    margin: var(--space-xl) 0;
}


/* ===== TYPING INDICATOR ===== */

.typing-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    animation: fadeIn 0.3s ease-out;
}

.thinking-indicator {
    display: flex;
    gap: var(--space-md);
    animation: fadeIn 0.3s ease-out;
}

.thinking-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: #0366d6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.thinking-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    box-shadow: var(--shadow-sm);
}

.typing-dots,
.thinking-dots {
    display: flex;
    gap: var(--space-xs);
}

.typing-dot,
.thinking-dots span {
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: var(--radius-full);
    animation: typingDots 1.4s infinite ease-in-out;
}

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

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

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

@keyframes typingDots {
    0%, 60%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    30% {
        transform: scale(1.2);
        opacity: 1;
    }
}

.thinking-text {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ===== CITATIONS AND SOURCES ===== */

.citations {
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-light);
}

.citations-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.citations-title::before {
    content: "📖";
    font-size: 0.875rem;
}

.citation {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-bottom: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    padding-left: var(--space-md);
    border-left: 2px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    line-height: 1.4;
    transition: all var(--transition-fast);
}

.citation:hover {
    border-left-color: var(--accent-primary);
    background: var(--hover-bg);
    transform: translateX(2px);
}

.research-papers {
    margin-top: var(--space-lg);
    padding: var(--space-md);
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: var(--radius-md);
    border: 1px solid #bae6fd;
}

.research-papers-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #0c4a6e;
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.research-papers-title::before {
    content: "🔬";
    font-size: 0.875rem;
}

.research-paper {
    font-size: 0.75rem;
    color: #0369a1;
    margin-bottom: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: white;
    border-radius: var(--radius-sm);
    border-left: 3px solid #0ea5e9;
    line-height: 1.4;
    transition: all var(--transition-fast);
}

.research-paper:hover {
    border-left-color: #0284c7;
    box-shadow: var(--shadow-sm);
    transform: translateX(2px);
}

.research-paper:last-child {
    margin-bottom: 0;
}

/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 768px) {
    .app-container {
        max-width: 100%;
    }

    .messages-area {
        padding: var(--space-lg) var(--space-md);
        gap: var(--space-lg);
    }

    .message.user {
        margin-left: var(--space-md);
    }

    .message.assistant {
        margin-right: var(--space-md);
    }

    .message-bubble {
        padding: var(--space-md);
        font-size: 14px;
    }

    .welcome-screen {
        padding: var(--space-xl) var(--space-md);
    }

    .suggestions {
        grid-template-columns: 1fr;
        max-width: 100%;
    }

    .input-area {
        padding: var(--space-lg) var(--space-md);
    }

    .input-wrapper {
        padding: var(--space-sm) var(--space-md);
    }

    .message-input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

@media (max-width: 480px) {
    .message-avatar {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .thinking-avatar {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .welcome-title,
    .shell-we-begin-h2 {
        font-size: 1.5rem;
    }

    .suggestion-btn {
        padding: var(--space-md);
        font-size: 13px;
    }
}

/* ===== ACCESSIBILITY ===== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== DARK MODE SUPPORT ===== */

@media (prefers-color-scheme: dark) {
    /*:root {*/
    /*    --bg-primary: #0f172a;*/
    /*    --bg-secondary: #1e293b;*/
    /*    --bg-tertiary: #334155;*/
    /*    --text-primary: #f8fafc;*/
    /*    --text-secondary: #cbd5e1;*/
    /*    --text-muted: #94a3b8;*/
    /*    --text-light: #64748b;*/
    /*    --border-color: #334155;*/
    /*    --border-light: #1e293b;*/
    /*    --hover-bg: #1e293b;*/
    /*    --assistant-bg: #1e293b;*/
    /*    --assistant-text: #f8fafc;*/
    /*}*/

    .message-bubble {
        border-color: var(--border-color);
    }

    .message-bubble pre {
        background: #0f172a;
        border-color: #1e293b;
    }
}

/* ===== UTILITY CLASSES ===== */

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

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

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

.slide-up {
    animation: slideUp 0.3s ease-out;
}

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

/* ===== ENHANCED FEEDBACK TOAST ===== */

.feedback-toast {
    position: fixed;
    bottom: var(--space-xl);
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: var(--bg-primary);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    z-index: 10000;
    backdrop-filter: blur(10px);
}

.feedback-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-10px);
}

/* ===== LOADING STATES ===== */

.loading-message,
.error-message {
    text-align: center;
    padding: var(--space-xl);
    color: var(--text-muted);
    font-weight: 500;
}

.error-message {
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-md);
    margin: var(--space-lg);
}

.message-bubble.loading {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--border-light) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ===== ENHANCED WORKBENCH INTEGRATION ===== */

.main-container.workbench-open .content-area {
    margin-right: 500px;
    transition: margin-right var(--transition-slow);
}

@media (max-width: 1200px) {
    .main-container.workbench-open .content-area {
        margin-right: 400px;
    }
}

@media (max-width: 768px) {
    .main-container.workbench-open .content-area {
        display: none;
    }
}