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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Main chat container */
.chat-container {
    width: 100%;
    max-width: 1200px;
    height: 90vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 20px;
}

/* Mobile viewport optimizations */
@supports (-webkit-touch-callout: none) {
    /* iOS Safari specific optimizations */
    .chat-container {
        height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    }
}

/* Header */
.chat-header {
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: white;
    padding: 20px;
    text-align: center;
    position: relative;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    font-size: 2rem;
}

.logo-image {
    width: 4.5rem !important;
    height: 4.5rem !important;
    max-width: 4.5rem !important;
    max-height: 4.5rem !important;
    margin-right: 0.5rem;
    border-radius: 8px;
    object-fit: contain;
    display: inline-block;
}

.data-character {
    background: linear-gradient(45deg, #ff6b35, #f7931e, #74b9ff, #00cec9);
    background-size: 300% 300%;
    animation: dataGlow 3s ease-in-out infinite;
    padding: 8px;
    border-radius: 12px;
    display: inline-block;
}

@keyframes dataGlow {
    0%, 100% {
        background-position: 0% 50%;
        transform: scale(1);
    }
    50% {
        background-position: 100% 50%;
        transform: scale(1.1);
    }
}

.subtitle {
    font-size: 0.9rem;
    font-weight: 400;
    opacity: 0.8;
}

.language-toggle {
    display: flex;
    align-items: center;
}

.language-toggle button {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.language-toggle button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Chat messages area */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    display: flex;
    animation: slideIn 0.3s ease;
}

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

.message.user {
    justify-content: flex-end;
}

.message.assistant {
    justify-content: flex-start;
}

.message-bubble {
    max-width: 80%;
    padding: 12px 18px;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.4;
}

.message.user .message-bubble {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.assistant .message-bubble {
    background: #f8f9fa;
    color: #2c3e50;
    border: 1px solid #e9ecef;
    border-bottom-left-radius: 4px;
}

.welcome-message {
    background: linear-gradient(135deg, #48c6ef, #6f86d6) !important;
    color: white !important;
    border: none !important;
}

.welcome-message h3 {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.welcome-message p {
    margin-bottom: 8px;
}

.welcome-message a {
    color: #0f172a;
    text-decoration: underline;
    font-weight: 600;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    transition: all 0.2s ease;
}

.welcome-message a:hover {
    color: #1e293b;
    text-decoration: none;
    background-color: rgba(15, 23, 42, 0.15);
    padding: 3px 6px;
    border-radius: 4px;
    transform: translateY(-1px);
}

.external-link-btn {
    display: inline-block;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(15, 23, 42, 0.2);
    padding: 10px 20px;
    border-radius: 8px;
    margin-top: 10px;
    text-decoration: none;
    font-weight: 600;
    color: #0f172a;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.external-link-btn:hover {
    background: rgba(255, 255, 255, 1);
    border-color: #0f172a;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    padding: 10px 20px;
}

/* Suggestion buttons */
.suggestions-container {
    margin-top: 15px;
}

.suggestions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.suggestion-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 12px 16px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    text-align: center;
    backdrop-filter: blur(10px);
}

.suggestion-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.suggestion-btn:active {
    transform: translateY(0);
}

/* Chat input */
.chat-input-container {
    padding: 20px;
    border-top: 1px solid #e9ecef;
    background: #fafbfc;
}

.input-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.input-buttons {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

#clearButton {
    width: 44px;
    height: 44px;
    border: 2px solid #e1e5e9;
    border-radius: 50%;
    background: white;
    color: #6c757d;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

#clearButton:hover:not(:disabled) {
    border-color: #dc3545;
    color: #dc3545;
    transform: scale(1.05);
}

#clearButton:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

#messageInput {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 20px;
    resize: none;
    font-size: 16px;
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
    max-height: 120px;
    min-height: 44px;
}

#messageInput:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#sendButton {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

#sendButton:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

#sendButton:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}


/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: white;
    padding: 20px;
    text-align: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.4rem;
}

.modal-body {
    padding: 25px;
    max-height: 400px;
    overflow-y: auto;
}

.modal-body p {
    margin-bottom: 15px;
    line-height: 1.5;
    color: #4a5568;
}

.modal-body ul {
    margin: 15px 0 15px 20px;
}

.modal-body li {
    margin-bottom: 8px;
    color: #4a5568;
}

.checkbox-container {
    margin-top: 20px;
    padding: 16px;
    border-top: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.checkbox-container.validation-warning {
    background: #fff3cd;
    border: 2px solid #ffc107;
    animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.checkbox-container label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
}

.checkbox-container input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #667eea;
    cursor: pointer;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-footer button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

#privacyDecline {
    background: #e2e8f0;
    color: #4a5568;
}

#privacyDecline:hover {
    background: #cbd5e0;
}

.primary-button,
#privacyAcceptBtn,
#readAcceptBtn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.primary-button:hover,
#privacyAcceptBtn:hover:not(:disabled),
#readAcceptBtn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

#privacyAcceptBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading indicator */
.loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    z-index: 1001;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e1e5e9;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

#loadingText {
    color: #4a5568;
    font-weight: 500;
}

/* Enhanced Responsive Design */

/* Mobile phones - portrait */
@media (max-width: 480px) {
    body {
        align-items: stretch;
        min-height: 100vh;
        padding: 0;
    }

    .chat-container {
        height: 100vh;
        margin: 0;
        border-radius: 0;
        max-width: none;
    }

    /* Compact header for mobile */
    .chat-header {
        padding: 8px 12px;
    }

    .header-content {
        flex-direction: row;
        gap: 8px;
        align-items: center;
    }

    .chat-header h1 {
        font-size: 1.1rem;
        gap: 6px;
    }

    .logo-image {
        width: 2rem !important;
        height: 2rem !important;
        max-width: 2rem !important;
        max-height: 2rem !important;
        margin-right: 0.25rem;
    }

    .subtitle {
        font-size: 0.7rem;
        display: block;
    }

    .language-toggle button {
        padding: 4px 8px;
        font-size: 0.8rem;
    }

    /* Hide footer on mobile to save space */
    .footer {
        display: none;
    }

    /* Optimize chat messages area */
    .chat-messages {
        padding: 12px;
        gap: 10px;
    }

    .message-bubble {
        max-width: 85%;
        padding: 10px 14px;
        font-size: 0.9rem;
    }

    /* Compact input area */
    .chat-input-container {
        padding: 12px;
    }

    .input-wrapper {
        gap: 8px;
    }

    #messageInput {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 10px 14px;
        min-height: 40px;
    }

    #sendButton, #clearButton {
        width: 40px;
        height: 40px;
    }

    .modal-content {
        margin: 10px;
        width: calc(100% - 20px);
        max-height: 90vh;
    }

    .modal-body {
        max-height: calc(90vh - 200px);
        font-size: 14px;
    }

    .modal-footer {
        flex-wrap: wrap;
        gap: 8px;
    }

    .modal-footer button {
        flex: 1;
        min-width: 120px;
        padding: 12px 16px;
        font-size: 14px;
    }

    /* Compact suggestion buttons */
    .suggestions-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .suggestion-btn {
        padding: 10px 14px;
        font-size: 0.85rem;
    }
}

/* Mobile phones - landscape & small tablets */
@media (min-width: 481px) and (max-width: 768px) {
    body {
        align-items: stretch;
    }

    .chat-container {
        height: 100vh;
        margin: 0;
        border-radius: 0;
    }

    /* Reduced header size */
    .chat-header {
        padding: 12px 16px;
    }

    .header-content {
        flex-direction: row;
        gap: 12px;
    }

    .chat-header h1 {
        font-size: 1.3rem;
    }

    .logo-image {
        width: 3rem !important;
        height: 3rem !important;
        max-width: 3rem !important;
        max-height: 3rem !important;
        margin-right: 0.4rem;
    }

    .subtitle {
        font-size: 0.75rem;
    }

    /* Fade footer on tablets */
    .footer {
        opacity: 0.6;
        padding: 12px;
    }

    .footer-content {
        font-size: 0.8rem;
    }

    .chat-messages {
        padding: 16px;
    }

    .message-bubble {
        max-width: 88%;
    }

    .chat-input-container {
        padding: 16px;
    }

    .modal-content {
        margin: 20px;
        width: calc(100% - 40px);
    }
}

/* Small desktop screens & large tablets */
@media (min-width: 769px) and (max-width: 1024px) {
    .chat-container {
        height: 95vh;
        margin: 10px;
    }

    .chat-header {
        padding: 16px;
    }

    .logo-image {
        width: 3.5rem !important;
        height: 3.5rem !important;
        max-width: 3.5rem !important;
        max-height: 3.5rem !important;
    }

    .footer {
        opacity: 0.8;
        padding: 16px;
    }
}

/* Very small screens (older phones) */
@media (max-width: 320px) {
    .chat-header h1 {
        font-size: 1rem;
    }

    .logo-image {
        width: 1.8rem !important;
        height: 1.8rem !important;
        max-width: 1.8rem !important;
        max-height: 1.8rem !important;
    }

    .subtitle {
        font-size: 0.65rem;
    }

    .language-toggle button {
        padding: 3px 6px;
        font-size: 0.75rem;
    }

    .chat-messages {
        padding: 8px;
    }

    .chat-input-container {
        padding: 8px;
    }
}

/* Additional mobile optimizations */
@media (max-width: 480px) {
    /* Ensure proper viewport usage */
    html {
        height: 100%;
        overflow: hidden;
    }

    body {
        height: 100%;
        overflow: hidden;
    }

    /* Optimize suggestion buttons layout */
    .welcome-message .suggestions-container {
        margin-top: 10px;
    }

    .welcome-message h3 {
        margin-bottom: 8px;
        font-size: 1rem;
    }

    .welcome-message p {
        margin-bottom: 6px;
        font-size: 0.9rem;
    }

    /* Reduce spacing in chat messages */
    .message {
        margin-bottom: 8px;
    }

    /* Optimize thinking indicators for mobile */
    .thinking-indicator {
        gap: 8px;
    }

    .thinking-text {
        font-size: 0.8rem;
    }

    /* Optimize modals for mobile */
    .modal-body {
        padding: 20px;
        max-height: 60vh;
    }

    .modal-header {
        padding: 15px;
    }

    .modal-footer {
        padding: 15px;
    }

    /* Compact markdown formatting */
    .message-bubble h1 {
        font-size: 1.2rem;
        margin: 12px 0 8px 0;
    }

    .message-bubble h2 {
        font-size: 1.1rem;
        margin: 10px 0 6px 0;
    }

    .message-bubble h3 {
        font-size: 1rem;
        margin: 8px 0 4px 0;
    }

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

/* Landscape mobile optimizations */
@media (max-width: 768px) and (orientation: landscape) {
    .chat-container {
        height: 100vh;
    }

    .chat-header {
        padding: 6px 12px;
    }

    .chat-header h1 {
        font-size: 1rem;
    }

    .logo-image {
        width: 1.8rem !important;
        height: 1.8rem !important;
        max-width: 1.8rem !important;
        max-height: 1.8rem !important;
    }

    .subtitle {
        font-size: 0.65rem;
    }

    .footer {
        display: none;
    }
}

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

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

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Thinking process styles */
.message.thinking {
    opacity: 0.9;
}

.thinking-bubble {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef) !important;
    border: 1px solid #dee2e6;
    border-radius: 18px;
    padding: 15px 20px;
    position: relative;
    overflow: hidden;
}

.thinking-bubble::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s infinite;
}

.thinking-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #6c757d;
    font-style: italic;
}

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

.thinking-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #007bff;
    animation: pulse 1.4s ease-in-out infinite both;
}

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

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

.thinking-text {
    font-size: 0.9rem;
    font-weight: 500;
    transition: opacity 0.3s ease;
}

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

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Thinking process status updates */
.thinking-bubble .status-update {
    color: #495057;
    font-weight: 500;
    font-style: normal;
}

/* Additional thinking states */
.thinking-bubble.analyzing {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb) !important;
}

.thinking-bubble.querying {
    background: linear-gradient(135deg, #fff3e0, #ffcc02) !important;
}

.thinking-bubble.processing {
    background: linear-gradient(135deg, #f3e5f5, #ce93d8) !important;
}

.thinking-bubble.synthesizing {
    background: linear-gradient(135deg, #e8f5e8, #a5d6a7) !important;
}

/* Markdown formatting styles */
.message-bubble h1,
.message-bubble h2,
.message-bubble h3 {
    margin: 16px 0 12px 0;
    font-weight: 600;
    line-height: 1.3;
    color: #2c3e50;
}

.message-bubble h1 {
    font-size: 1.4rem;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 8px;
}

.message-bubble h2 {
    font-size: 1.2rem;
    color: #34495e;
}

.message-bubble h3 {
    font-size: 1.1rem;
    color: #34495e;
}

.message-bubble p {
    margin: 8px 0;
    line-height: 1.5;
}

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

.message-bubble li {
    margin: 4px 0;
    line-height: 1.4;
}

.message-bubble ul li {
    list-style: disc;
}

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

.message-bubble code {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 2px 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #e83e8c;
}

.message-bubble hr {
    border: none;
    border-top: 1px solid #e9ecef;
    margin: 16px 0;
}

.message-bubble a {
    color: #667eea;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.message-bubble a:hover {
    border-bottom-color: #667eea;
    color: #5a6fd8;
}

.message-bubble strong {
    font-weight: 600;
    color: #2c3e50;
}

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

/* Footer styles */
.footer {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 20px;
    margin-top: auto;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    text-align: center;
    font-size: 0.85rem;
    color: #6c757d;
}

.footer-content a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-content a:hover {
    color: #5a6fd8;
    text-decoration: underline;
}

.footer-separator {
    color: #6c757d;
    margin: 0 4px;
}

/* Footer responsive styles are now handled in the enhanced responsive section above */

/* Table wrapper for responsive behavior */
.message-bubble .table-wrapper {
    overflow-x: auto;
    margin: 16px 0;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Table styling for markdown tables */
.message-bubble table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    background: #fff;
    border-radius: 8px;
    font-size: 0.9rem;
    min-width: 300px; /* Ensure tables don't get too narrow */
}

.message-bubble thead {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.message-bubble th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
}

.message-bubble td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
}

.message-bubble tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.message-bubble tbody tr:hover {
    background: #e3f2fd;
    transition: background-color 0.2s ease;
}

.message-bubble tbody tr:last-child td {
    border-bottom: none;
}

/* Responsive table handling */
@media (max-width: 768px) {
    .message-bubble table {
        font-size: 0.8rem;
        margin: 12px 0;
    }

    .message-bubble th,
    .message-bubble td {
        padding: 8px 12px;
    }

    .message-bubble th {
        font-size: 0.75rem;
    }
}

/* Very small screens - stack table content */
@media (max-width: 480px) {
    .message-bubble table {
        font-size: 0.75rem;
    }

    .message-bubble th,
    .message-bubble td {
        padding: 6px 8px;
    }
}

/* Code blocks and inline code */
.message-bubble code {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 2px 6px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.85em;
    color: #d63384;
}

.message-bubble pre {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
    margin: 12px 0;
    overflow-x: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.4;
}

.message-bubble pre code {
    background: none;
    border: none;
    padding: 0;
    color: #212529;
}

/* Blockquotes */
.message-bubble blockquote {
    border-left: 4px solid #667eea;
    padding-left: 16px;
    margin: 16px 0;
    font-style: italic;
    color: #6c757d;
    background: #f8f9fa;
    padding: 12px 16px;
    border-radius: 0 8px 8px 0;
}

/* Lists */
.message-bubble ul,
.message-bubble ol {
    margin: 12px 0;
    padding-left: 24px;
}

.message-bubble li {
    margin: 6px 0;
    line-height: 1.5;
}

/* Headers in messages */
.message-bubble h1,
.message-bubble h2,
.message-bubble h3,
.message-bubble h4,
.message-bubble h5,
.message-bubble h6 {
    margin: 16px 0 8px 0;
    color: #2c3e50;
    font-weight: 600;
}

.message-bubble h1 {
    font-size: 1.5rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 8px;
}

.message-bubble h2 {
    font-size: 1.3rem;
}

.message-bubble h3 {
    font-size: 1.1rem;
}

.message-bubble h4,
.message-bubble h5,
.message-bubble h6 {
    font-size: 1rem;
}

/* Horizontal rules */
.message-bubble hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, #667eea, transparent);
    margin: 20px 0;
}