/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a0a;
    color: #e5e5e5;
    overflow: hidden;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    z-index: 1000;
    backdrop-filter: blur(20px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 18px;
    color: #ffffff;
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: #e5e5e5;
    transition: color 0.3s ease;
}

.logo-icon:hover {
    color: #fbbf24;
}

.logo-text {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-link {
    color: #e5e5e5;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
    transform: translateY(-1px);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 80%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Google Sign-In Styles */
.user-section {
    display: flex;
    align-items: center;
}

.google-signin-btn {
    margin-right: 8px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    padding: 6px 12px;
    margin-right: 8px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #4a4a4a;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-name {
    color: #e5e5e5;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
}

.trial-status {
    font-size: 11px;
    color: #999;
    line-height: 1;
}

.request-count {
    color: #fbbf24;
    font-weight: 600;
}

.request-limit {
    color: #999;
}

.sign-out-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sign-out-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.new-chat-btn {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
}

.new-chat-btn:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.api-key-btn {
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    padding: 8px 16px;
    color: #e5e5e5;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
}

.api-key-btn:hover {
    background: #3a3a3a;
    border-color: #4a4a4a;
}

.api-key-btn i {
    font-size: 12px;
    opacity: 0.7;
}

/* Chat Container */
.chat-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 70px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #3a3a3a;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #4a4a4a;
}

/* Welcome Message */
.welcome-message {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
    max-width: 800px;
}

.assistant-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-size: 18px;
    flex-shrink: 0;
    padding: 6px;
}

.avatar-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.message-content h3 {
    color: #ffffff;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.message-content p {
    color: #b5b5b5;
    line-height: 1.6;
    margin-bottom: 16px;
}

.capabilities {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.capability-tag {
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 16px;
    padding: 4px 12px;
    font-size: 12px;
    color: #fbbf24;
    font-weight: 500;
}

/* Message Bubbles */
.message {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    max-width: 800px;
}

.message.user {
    flex-direction: row-reverse;
    margin-left: auto;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: #2a2a2a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e5e5e5;
    font-size: 16px;
    flex-shrink: 0;
}

.message-bubble {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 16px;
    padding: 16px 20px;
    max-width: 100%;
    position: relative;
}

.message.user .message-bubble {
    background: #2a2a2a;
    border-color: #3a3a3a;
}

.message-text {
    color: #e5e5e5;
    line-height: 1.6;
    word-wrap: break-word;
}

.message-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #2a2a2a;
    font-size: 12px;
    color: #7a7a7a;
    gap: 16px;
}

.meta-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.copy-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 12px;
    opacity: 0.7;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.message:hover .copy-btn {
    opacity: 1;
}

.copy-btn:hover {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
}

.message-time {
    flex-shrink: 0;
}

.message-info {
    display: flex;
    gap: 16px;
    font-size: 11px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Typing Animation */
.typing-indicator {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    max-width: 800px;
}

.typing-bubble {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border-radius: 50%;
    animation: typingAnimation 1.4s infinite ease-in-out;
    box-shadow: 0 2px 6px rgba(251, 191, 36, 0.3);
}

.typing-dot:nth-child(1) { animation-delay: 0ms; }
.typing-dot:nth-child(2) { animation-delay: 200ms; }
.typing-dot:nth-child(3) { animation-delay: 400ms; }

@keyframes typingAnimation {
    0%, 60%, 100% {
        transform: translateY(0) scale(0.8);
        opacity: 0.4;
        box-shadow: 0 2px 6px rgba(251, 191, 36, 0.1);
    }
    30% {
        transform: translateY(-10px) scale(1.1);
        opacity: 1;
        box-shadow: 0 4px 12px rgba(251, 191, 36, 0.4);
    }
}

/* Chat Input */
.chat-input-container {
    padding: 24px;
    border-top: 1px solid #2a2a2a;
    background: #0a0a0a;
}

/* Chat Options */
.chat-options {
    max-width: 800px;
    margin: 0 auto 16px auto;
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
}

.option-group {
    display: flex;
    align-items: center;
}

.option-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #b5b5b5;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
    user-select: none;
}

.option-label:hover {
    color: #e5e5e5;
}

.option-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #4a4a4a;
    border-radius: 4px;
    margin-right: 8px;
    position: relative;
    transition: all 0.2s ease;
    background: transparent;
}

.option-label:hover .checkmark {
    border-color: #fbbf24;
}

.option-label input[type="checkbox"]:checked + .checkmark {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border-color: #fbbf24;
}

.option-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: #000;
    font-size: 12px;
    font-weight: bold;
}

.chat-input-wrapper {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 24px;
    padding: 12px 16px;
    transition: border-color 0.2s ease;
}

.chat-input-wrapper:focus-within {
    border-color: #fbbf24;
}

.portfolio-toggle-btn {
    width: 36px;
    height: 36px;
    background: rgba(107, 114, 128, 0.2);
    border: 1px solid rgba(107, 114, 128, 0.3);
    border-radius: 8px;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.portfolio-toggle-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
    color: #3b82f6;
}

.portfolio-toggle-btn.active {
    background: rgba(59, 130, 246, 0.3);
    border-color: #3b82f6;
    color: #3b82f6;
}

#messageInput {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #e5e5e5;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    resize: none;
    max-height: 200px;
    min-height: 60px;
    padding: 8px 0;
    overflow-y: hidden;
    overflow-x: hidden;
}

#messageInput::placeholder {
    color: #7a7a7a;
}

.send-btn {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border: none;
    border-radius: 50%;
    color: #000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 16px;
    max-width: 400px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 24px 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: #7a7a7a;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: #2a2a2a;
    color: #e5e5e5;
}

.modal-body {
    padding: 24px;
}

.input-group {
    position: relative;
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #e5e5e5;
    font-weight: 500;
    font-size: 14px;
}

.input-group input {
    width: 100%;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    padding: 12px 16px;
    color: #e5e5e5;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #fbbf24;
}

.input-group input::placeholder {
    color: #7a7a7a;
}

.toggle-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #7a7a7a;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s ease;
}

.toggle-btn:hover {
    color: #e5e5e5;
}

.modal-note {
    color: #7a7a7a;
    font-size: 12px;
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.modal-note i {
    margin-top: 2px;
    flex-shrink: 0;
}

.modal-footer {
    padding: 0 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.cancel-btn {
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    padding: 8px 16px;
    color: #e5e5e5;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.cancel-btn:hover {
    background: #3a3a3a;
}

.save-btn {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    color: #000;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.save-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
}

.save-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Markdown Styling */
.message-text h1, .message-text h2, .message-text h3 {
    color: #ffffff;
    margin: 16px 0 8px 0;
    font-weight: 600;
}

.message-text h1 { font-size: 24px; }
.message-text h2 { font-size: 20px; }
.message-text h3 { font-size: 18px; }

.message-text p {
    margin: 12px 0;
    line-height: 1.6;
}

.message-text ul, .message-text ol {
    margin: 12px 0;
    padding-left: 24px;
}

.message-text li {
    margin: 4px 0;
    line-height: 1.6;
    list-style: none;  /* Remove default browser bullets */
}

.message-text code {
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 4px;
    padding: 2px 6px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 14px;
    color: #fbbf24;
}

.message-text pre {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
    overflow-x: auto;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 14px;
    line-height: 1.5;
}

.message-text pre code {
    background: none;
    border: none;
    padding: 0;
    color: #e5e5e5;
}

.message-text blockquote {
    border-left: 3px solid #fbbf24;
    padding-left: 16px;
    margin: 16px 0;
    font-style: italic;
    color: #b5b5b5;
}

.message-text table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    overflow: hidden;
}

.message-text th,
.message-text td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #2a2a2a;
}

.message-text th {
    background: #2a2a2a;
    color: #ffffff;
    font-weight: 600;
}

.message-text tr:last-child td {
    border-bottom: none;
}

.message-text a {
    color: #fbbf24;
    text-decoration: none;
    transition: color 0.2s ease;
}

.message-text a:hover {
    color: #f59e0b;
    text-decoration: underline;
}

/* Enhanced Message Formatting Styles */

/* Paragraphs */
.response-paragraph {
    margin: 0 0 12px 0;
    line-height: 1.6;
    color: #e5e5e5;
}

/* Headings */
.response-h1 {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    margin: 24px 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #fbbf24;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.response-h2 {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    margin: 20px 0 12px 0;
    padding-left: 12px;
    border-left: 3px solid #fbbf24;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.response-h3 {
    font-size: 16px;
    font-weight: 600;
    color: #f3f4f6;
    margin: 16px 0 10px 0;
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(245, 158, 11, 0.1));
    border-radius: 6px;
    border-left: 3px solid #fbbf24;
}

/* Text Formatting */
.response-bold {
    font-weight: 600;
    color: #ffffff;
}

.response-italic {
    font-style: italic;
    color: #d1d5db;
}

/* Code */
.inline-code {
    background: #1f2937;
    color: #fbbf24;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 0.875em;
    border: 1px solid #374151;
}

.code-block {
    background: #111827;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
    overflow-x: auto;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 0.875em;
    line-height: 1.5;
}

.code-block code {
    color: #e5e7eb;
    background: none;
    padding: 0;
    border: none;
}

/* Tables */
.table-container {
    margin: 20px 0;
    overflow-x: auto;
    border-radius: 12px;
    background: linear-gradient(135deg, #1f2937, #111827);
    border: 1px solid #374151;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.response-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875em;
    background: transparent;
}

.response-table th {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #111827;
    font-weight: 600;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 2px solid #374151;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.response-table th:first-child {
    border-top-left-radius: 12px;
}

.response-table th:last-child {
    border-top-right-radius: 12px;
}

.response-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #374151;
    color: #e5e7eb;
    vertical-align: top;
    line-height: 1.5;
}

.response-table tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.02);
}

.response-table tr:hover td {
    background: rgba(251, 191, 36, 0.08);
    transition: background-color 0.2s ease;
}

.response-table tr:last-child td:first-child {
    border-bottom-left-radius: 12px;
}

.response-table tr:last-child td:last-child {
    border-bottom-right-radius: 12px;
}

.response-table tr:last-child td {
    border-bottom: none;
}

/* Structured Data Styling */
.response-summary {
    background: linear-gradient(135deg, #1e3a8a, #1e40af);
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    color: #e5e7eb;
    font-weight: 500;
    line-height: 1.6;
}

.positive-change {
    color: #10b981 !important;
    font-weight: 600;
}

.negative-change {
    color: #ef4444 !important;
    font-weight: 600;
}

.json-response {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 20px;
    margin: 16px 0;
    overflow-x: auto;
}

.json-response code {
    color: #e2e8f0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
}

/* Lists */
.bullet-point {
    margin: 8px 0 8px 16px;
    padding-left: 12px;
    position: relative;
    line-height: 1.6;
    color: #e5e7eb;
}

.bullet-point::before {
    content: "•";
    color: #fbbf24;
    font-weight: bold;
    position: absolute;
    left: -12px;
    top: 0;
}

.numbered-point {
    margin: 8px 0 8px 24px;
    padding-left: 8px;
    line-height: 1.6;
    color: #e5e7eb;
    counter-increment: list-counter;
}

.numbered-point::before {
    content: counter(list-counter) ".";
    color: #fbbf24;
    font-weight: 600;
    margin-right: 8px;
    min-width: 20px;
    display: inline-block;
}

/* HTML List Styling (when server sends HTML lists) */
.response-list {
    margin: 16px 0;
    padding-left: 0;
    list-style: none;
}

.response-list-item {
    margin: 8px 0 8px 16px;
    padding-left: 12px;
    position: relative;
    line-height: 1.6;
    color: #e5e7eb;
}

.response-list-item::before {
    content: "•";
    color: #fbbf24;
    font-weight: bold;
    position: absolute;
    left: -12px;
    top: 0;
}

/* Section Divider */
.section-divider {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, #fbbf24, transparent);
    margin: 24px 0;
    border-radius: 1px;
    opacity: 0.6;
}

/* Enhanced spacing for formatted content */
.message-text h1:first-child,
.message-text h2:first-child,
.message-text h3:first-child,
.message-text p:first-child {
    margin-top: 0;
}

.message-text h1:last-child,
.message-text h2:last-child,
.message-text h3:last-child,
.message-text p:last-child {
    margin-bottom: 0;
}

/* Enhanced Response Content Styles */

/* Additional Heading Levels */
.response-h4 {
    color: #fbbf24;
    font-size: 16px;
    font-weight: 600;
    margin: 16px 0 12px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid #333;
}

.response-h5 {
    color: #f59e0b;
    font-size: 14px;
    font-weight: 600;
    margin: 14px 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.response-h6 {
    color: #d97706;
    font-size: 12px;
    font-weight: 600;
    margin: 12px 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.75px;
    opacity: 0.9;
}

/* Enhanced Text Formatting */
.response-strikethrough {
    text-decoration: line-through;
    opacity: 0.7;
    color: #999;
}

.response-link {
    color: #60a5fa;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
    position: relative;
}

.response-link:hover {
    color: #93c5fd;
    border-bottom-color: #60a5fa;
    text-shadow: 0 0 8px rgba(96, 165, 250, 0.3);
}

.response-link::after {
    content: '↗';
    font-size: 0.8em;
    margin-left: 4px;
    opacity: 0.6;
}

/* Blockquotes */
.response-blockquote {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
    border-left: 4px solid #fbbf24;
    padding: 16px 20px;
    margin: 16px 0;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    position: relative;
    backdrop-filter: blur(10px);
}

.response-blockquote::before {
    content: '"';
    font-size: 48px;
    color: #fbbf24;
    position: absolute;
    top: -8px;
    left: 12px;
    opacity: 0.3;
    font-family: Georgia, serif;
}

/* Task Lists */
.task-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 0;
    padding: 8px 12px;
    border-radius: 6px;
    background: rgba(42, 42, 42, 0.3);
    transition: all 0.2s ease;
}

.task-item:hover {
    background: rgba(42, 42, 42, 0.5);
}

.task-item.completed {
    opacity: 0.7;
    text-decoration: line-through;
}

.task-checkbox {
    font-size: 14px;
    color: #fbbf24;
    font-weight: bold;
    min-width: 20px;
}

/* Welcome Message Enhancements */
.welcome-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #333;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(42, 42, 42, 0.3);
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.feature-item:hover {
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.3);
    transform: translateY(-2px);
}

.feature-item i {
    color: #fbbf24;
    font-size: 16px;
    min-width: 20px;
}

.feature-item span {
    font-size: 14px;
    color: #e0e0e0;
}

/* Enhanced Code Blocks */
.code-block {
    background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 20px;
    margin: 16px 0;
    overflow-x: auto;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.code-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 32px;
    background: linear-gradient(135deg, #333 0%, #2a2a2a 100%);
    border-radius: 12px 12px 0 0;
    border-bottom: 1px solid #444;
}

.code-block code {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #e0e0e0;
    display: block;
    margin-top: 16px;
    white-space: pre;
    overflow-x: auto;
}

/* Enhanced Inline Code */
.inline-code {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15) 0%, rgba(245, 158, 11, 0.1) 100%);
    color: #fbbf24;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.9em;
    border: 1px solid rgba(251, 191, 36, 0.2);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Enhanced Section Dividers */
.section-divider {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #fbbf24 20%, #f59e0b 50%, #fbbf24 80%, transparent 100%);
    margin: 24px 0;
    border-radius: 1px;
    opacity: 0.6;
}

/* Enhanced Error States */
.input-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Mobile responsiveness for tables */
@media (max-width: 768px) {
    .table-container {
        margin: 16px -8px;
        border-radius: 8px;
    }
    
    .response-table th,
    .response-table td {
        padding: 8px 12px;
        font-size: 0.8em;
    }
    
    .response-table th {
        font-size: 0.75em;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        padding: 0 16px;
    }
    
    .logo-text {
        display: none;
    }
    
    .chat-messages {
        padding: 16px;
    }
    
    .chat-input-container {
        padding: 16px;
    }
    
    .chat-options {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .option-group {
        justify-content: center;
    }
    
    .option-label {
        font-size: 13px;
    }
    
    .message {
        max-width: 100%;
    }
    
    .welcome-message {
        max-width: 100%;
    }
    
    .modal-content {
        margin: 16px;
        width: calc(100% - 32px);
    }
    
    /* Enhanced Mobile Styles */
    .welcome-features {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .feature-item {
        padding: 8px 10px;
    }
    
    .response-blockquote {
        padding: 12px 16px;
        margin: 12px 0;
    }
    
    .response-blockquote::before {
        font-size: 36px;
        top: -4px;
        left: 8px;
    }
    
    .code-block {
        padding: 16px;
        margin: 12px 0;
    }
    
    .code-block code {
        font-size: 13px;
        margin-top: 12px;
    }
    
    .task-item {
        padding: 6px 10px;
        gap: 10px;
    }
    
    .response-h1 { font-size: 20px; }
    .response-h2 { font-size: 18px; }
    .response-h3 { font-size: 16px; }
    .response-h4 { font-size: 14px; }
    .response-h5 { font-size: 13px; }
    .response-h6 { font-size: 12px; }
}

/* Animations */
.message {
    animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Advanced Animations & Micro-interactions */
.response-link, .inline-code, .task-item, .feature-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.response-table tr {
    transition: background-color 0.2s ease;
}

.bullet-point, .numbered-point {
    transition: transform 0.2s ease;
}

.bullet-point:hover, .numbered-point:hover {
    transform: translateX(4px);
}

/* Gradient Text Animations */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.logo-text {
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

/* Focus States for Accessibility */
.api-key-btn:focus,
.send-btn:focus,
button:focus {
    outline: 2px solid #fbbf24;
    outline-offset: 2px;
}

.message-input:focus {
    border-color: #fbbf24;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.1);
}

/* Enhanced Scrollbar Styling */
.chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

/* Portfolio Upload Section */
.portfolio-upload-section {
    margin: 24px 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
}

.upload-header {
    text-align: center;
    margin-bottom: 20px;
}

.upload-header h3 {
    color: #6b7280;
    margin: 0 0 6px 0;
    font-size: 1.1em;
    font-weight: 600;
    letter-spacing: -0.025em;
}

.upload-header p {
    color: #9ca3af;
    margin: 0;
    font-size: 0.875em;
    font-weight: 400;
}

.upload-area {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: #ffffff;
    position: relative;
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transition: left 0.5s ease;
}

.upload-area:hover::before {
    left: 100%;
}

.upload-area:hover {
    border-color: #3b82f6;
    background: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.upload-area.drag-over {
    border-color: #1d4ed8;
    background: #eff6ff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.upload-icon {
    color: #9ca3af;
    transition: all 0.2s ease;
}

.upload-area:hover .upload-icon {
    color: #3b82f6;
    transform: scale(1.05);
}

.upload-area h4 {
    color: #374151;
    margin: 0;
    font-size: 1.0em;
    font-weight: 500;
    letter-spacing: -0.025em;
}

.upload-area p {
    color: #9ca3af;
    margin: 0;
    font-size: 0.875em;
    font-weight: 400;
}

.uploaded-files {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #ffffff;
    border: 1px solid #f3f4f6;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.file-item:hover {
    border-color: #e5e7eb;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.file-icon {
    font-size: 1.5em;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.file-icon.csv {
    background: #dcfce7;
    color: #16a34a;
}

.file-icon.pdf {
    background: #fef2f2;
    color: #dc2626;
}

.file-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.file-name {
    font-weight: 500;
    color: #111827;
    font-size: 0.875em;
    letter-spacing: -0.025em;
}

.file-size {
    color: #6b7280;
    font-size: 0.75em;
    font-weight: 400;
}

.file-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8em;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 20px;
}

.status-processing {
    color: #d97706;
    background: #fef3c7;
}

.status-success {
    color: #059669;
    background: #d1fae5;
}

.status-error {
    color: #dc2626;
    background: #fee2e2;
}

.remove-file {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    color: #6b7280;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 0.875em;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-file:hover {
    background: #fee2e2;
    border-color: #fecaca;
    color: #dc2626;
}

/* Animation for file processing */
@keyframes processingPulse {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.8;
        transform: scale(0.98);
    }
}

.processing {
    animation: processingPulse 2s ease-in-out infinite;
}

/* Success Toast Notification */
.success-toast {
    position: fixed;
    top: 90px;
    right: 24px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(34, 197, 94, 0.3);
    z-index: 10000;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 400px;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.success-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    font-size: 14px;
}

.toast-content i {
    font-size: 18px;
    flex-shrink: 0;
}

/* Responsive Toast */
@media (max-width: 768px) {
    .success-toast {
        right: 16px;
        left: 16px;
        right: 16px;
        max-width: none;
    }
}
