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

:root {
    /* Modern color palette inspired by the design */
    --color-primary: #6366f1;
    --color-primary-light: #818cf8;
    --color-accent: #f97316;
    --color-accent-teal: #14b8a6;
    --color-text: #1f2937;
    --color-text-light: #6b7280;
    --color-text-muted: #9ca3af;
    --color-bg-lavender: #f3f4f6;
    --color-bg-peach: #fef3c7;
    --color-bg-card: #ffffff;
    --color-border: #e5e7eb;
    --color-border-light: #f3f4f6;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.7;
    color: var(--color-text);
    background: var(--color-bg-lavender);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Navbar - Modern, clean design */
.navbar {
    background: white;
    color: var(--color-text);
    padding: 1rem 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.nav-brand {
    color: var(--color-primary);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

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

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--color-text-light);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--color-primary);
}

.nav-user {
    color: var(--color-text-muted);
    padding: 0 0.75rem;
    font-size: 0.9rem;
}

.nav-logout {
    color: var(--color-accent) !important;
}

/* Main content */
main {
    min-height: calc(100vh - 200px);
    padding: 3rem 0;
}

/* Hero section - Modern gradient */
.hero {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px;
    margin-bottom: 3rem;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.95;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Buttons - Modern, bold */
.btn {
    display: inline-block;
    padding: 0.875rem 1.75rem;
    background: white;
    color: var(--color-text);
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--color-primary-light);
}

.btn-secondary {
    background: var(--color-text-light);
    color: white;
}

.btn-secondary:hover {
    background: var(--color-text);
}

.btn-danger {
    background: transparent;
    color: #ef4444;
    border: 2px solid #ef4444;
    padding: calc(0.875rem - 2px) calc(1.75rem - 2px);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #dc2626;
    color: #dc2626;
}

.btn-sm {
    padding: 0.625rem 1.25rem;
    font-size: 0.9rem;
}

.btn-outline-light {
    background: transparent;
    color: white;
    border: 2px solid white;
    padding: calc(0.875rem - 2px) calc(1.75rem - 2px);
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: white;
    color: white;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Auth pages - Login and signup */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 3rem;
    min-height: calc(100vh - 80px);
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.auth-card {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 3rem;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.auth-card h1 {
    margin: 0 0 0.5rem 0;
    font-size: 1.875rem;
    color: var(--color-text);
    font-weight: 800;
    letter-spacing: -0.025em;
}

.auth-subtitle {
    color: var(--color-text-light);
    margin: 0 0 2rem 0;
    font-size: 1rem;
}

.error-message {
    background: #fef2f2;
    color: #991b1b;
    padding: 0.875rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid #fecaca;
    font-weight: 500;
}

.auth-form {
    margin-bottom: 1.5rem;
}

.auth-form .form-group {
    margin-bottom: 1.5rem;
}

.auth-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.auth-form input[type="email"],
.auth-form input[type="text"],
.auth-form input[type="password"] {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.auth-footer {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
    color: var(--color-text-light);
}

.auth-footer a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Templates section */
.templates-section {
    background: var(--color-bg-card);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.template-card {
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 1.75rem;
    background: white;
    transition: all 0.2s;
    cursor: pointer;
}

.template-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.template-card h3 {
    margin-bottom: 0.75rem;
    color: var(--color-text);
    font-weight: 700;
    font-size: 1.25rem;
}

.template-description {
    color: var(--color-text-light);
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

.template-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.template-actions {
    display: flex;
    gap: 0.75rem;
}

/* Template list */
.template-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.template-item {
    background: white;
    padding: 1.75rem;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: start;
    transition: all 0.2s;
}

.template-item:hover {
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

.template-item h3 {
    margin-bottom: 0.5rem;
}

.template-item h3 a {
    color: var(--color-text);
    text-decoration: none;
    font-weight: 700;
}

.template-item h3 a:hover {
    color: var(--color-primary);
}

.template-item-actions {
    display: flex;
    gap: 0.75rem;
}

/* Page header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.page-header h1 {
    color: var(--color-text);
    font-weight: 800;
    font-size: 2.25rem;
    letter-spacing: -0.025em;
}

.page-actions {
    display: flex;
    gap: 0.75rem;
}

/* Forms - Clean and modern */
.form {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 1.75rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.625rem;
    font-weight: 600;
    color: var(--color-text);
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 0.875rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group textarea {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    resize: vertical;
    min-height: 200px;
}

.form-group small {
    display: block;
    margin-top: 0.5rem;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* Template details */
.template-details {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.detail-section {
    margin-bottom: 2.5rem;
}

.detail-section h2 {
    color: var(--color-text);
    margin-bottom: 1.25rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.template-content {
    background: var(--color-bg-lavender);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    white-space: pre-wrap;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

.variable-list {
    list-style: none;
}

.variable-list li {
    padding: 0.75rem;
    background: var(--color-bg-lavender);
    margin-bottom: 0.625rem;
    border-radius: 8px;
    border: 1px solid var(--color-border-light);
}

.variable-list code {
    color: var(--color-accent-teal);
    font-weight: 600;
}

.metadata {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.75rem 1.5rem;
}

.metadata dt {
    font-weight: 600;
    color: var(--color-text-light);
}

.metadata dd {
    color: var(--color-text);
}

/* Versions */
.versions-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.version-item {
    background: white;
    padding: 1.75rem;
    border: 1px solid var(--color-border);
    border-radius: 12px;
}

.version-item.current-version {
    border-color: var(--color-primary);
    border-width: 2px;
    background: linear-gradient(to right, rgba(99, 102, 241, 0.03), white);
}

.version-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.version-note {
    color: var(--color-text-light);
    margin-bottom: 1rem;
}

.version-restored {
    color: var(--color-accent);
    font-style: italic;
    margin-bottom: 1rem;
}

.version-content {
    background: var(--color-bg-lavender);
    padding: 1.25rem;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    font-family: 'SF Mono', Monaco, monospace;
    white-space: pre-wrap;
    font-size: 0.9rem;
}

details {
    cursor: pointer;
}

details summary {
    font-weight: 600;
    color: var(--color-primary);
    user-select: none;
}

/* Chat interface - Modern messaging */
.chat-container {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.messages {
    min-height: 400px;
    max-height: 600px;
    overflow-y: auto;
    margin-bottom: 2rem;
    padding: 1.5rem;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-bg-lavender);
}

.message {
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.message-user {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-left: 15%;
}

.message-assistant {
    background: white;
    margin-right: 15%;
    border: 1px solid var(--color-border);
}

.message-system {
    background: var(--color-bg-peach);
    font-style: italic;
    border: 1px solid #fde68a;
}

.message-role {
    display: inline-block;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    margin-right: 0.625rem;
    background: rgba(0, 0, 0, 0.1);
}

.message-user .message-role {
    background: rgba(255, 255, 255, 0.25);
}

.message-assistant .message-role {
    background: var(--color-bg-lavender);
    color: var(--color-text-light);
}

.message-content {
    display: inline;
    white-space: pre-wrap;
    line-height: 1.7;
}

#loading-message .message-content {
    font-style: italic;
    opacity: 0.8;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.message-form {
    margin-top: 1.5rem;
}

.message-form textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.message-form textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.system-prompt,
.conversation-context {
    background: var(--color-bg-lavender);
    padding: 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--color-border);
}

.conversation-meta {
    color: var(--color-text-muted);
    margin-top: 0.625rem;
    font-size: 0.9rem;
}

/* Alerts - Modern with better visibility */
.alert {
    padding: 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* Badges and tags */
.badge {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    background: var(--color-primary);
    color: white;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.tag {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    background: var(--color-bg-lavender);
    color: var(--color-text);
    border-radius: 6px;
    font-size: 0.875rem;
    margin-right: 0.5rem;
    font-weight: 500;
}

/* Empty states */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--color-text-muted);
}

.empty-state p {
    font-size: 1.125rem;
}

/* Error page */
.error-page {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.error-page h1 {
    font-size: 3rem;
    color: #ef4444;
    margin-bottom: 1rem;
    font-weight: 800;
}

.error-message {
    font-size: 1.25rem;
    color: var(--color-text-light);
    margin-bottom: 2rem;
}

/* File uploads */
.conversation-files {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    margin-top: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.conversation-files h2 {
    color: var(--color-text);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.25rem;
    background: var(--color-bg-lavender);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    transition: all 0.2s;
}

.file-item:hover {
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

/* Prominent status badge on the left */
.file-status-badge {
    min-width: 150px;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 800;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    border: 2px solid transparent;
}

.file-status-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.file-status-badge:active {
    transform: scale(0.98);
}

.status-activated {
    background: #10b981;
    color: white;
    border-color: #059669;
}

.status-activated:hover {
    background: #059669;
}

.status-deactivated {
    background: #9ca3af;
    color: white;
    border-color: #6b7280;
}

.status-deactivated:hover {
    background: #6b7280;
}

.status-not-processed {
    background: #f59e0b;
    color: white;
    border-color: #d97706;
}

.status-not-processed:hover {
    background: #d97706;
}

.file-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.file-name {
    font-weight: 600;
    color: var(--color-text);
}

.file-meta {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.file-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.upload-form {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}

.upload-form input[type="file"] {
    display: block;
    padding: 0.75rem;
    margin-top: 0.75rem;
    border: 2px dashed var(--color-border);
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    transition: border-color 0.2s;
}

.upload-form input[type="file"]:hover {
    border-color: var(--color-primary);
}

.file-upload-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Footer */
.footer {
    background: white;
    color: var(--color-text);
    padding: 2.5rem 0;
    margin-top: 4rem;
    text-align: center;
    border-top: 1px solid var(--color-border);
}

.footer p {
    color: var(--color-text-muted);
}

/* Utility classes */
.text-accent {
    color: var(--color-accent);
}

.text-teal {
    color: var(--color-accent-teal);
}

.text-primary {
    color: var(--color-primary);
}

.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

/* RAG Context Indicators */
.message-with-rag {
    border-left: 4px solid var(--color-accent-teal);
}

.rag-indicator {
    display: inline-flex;
    align-items: center;
    margin-left: 0.5rem;
    color: var(--color-accent-teal);
    vertical-align: middle;
}

.rag-indicator svg {
    width: 16px;
    height: 16px;
}

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

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--color-border);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--color-bg-lavender);
    color: var(--color-text);
}

.modal-body {
    overflow-y: auto;
    padding: 2rem;
}

/* Markdown Modal Display */
.markdown-display {
    background: var(--color-bg-lavender);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    white-space: pre-wrap;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    max-height: 500px;
    overflow-y: auto;
    color: var(--color-text);
}

/* Document Mode Selector */
.document-mode-selector {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    margin-top: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.document-mode-selector h3 {
    color: var(--color-text);
    margin-bottom: 1.25rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.mode-pills {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.mode-pill {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--color-bg-lavender);
    border: 2px solid var(--color-border);
    border-radius: 12px;
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.mode-pill:hover {
    border-color: var(--color-primary);
    background: linear-gradient(to bottom, white, var(--color-bg-lavender));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.mode-pill.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.mode-pill.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.mode-pill-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.mode-pill-content svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.mode-pill-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.mode-pill-title {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.2;
}

.mode-pill-desc {
    font-size: 0.8rem;
    font-weight: 400;
    opacity: 0.7;
    line-height: 1.3;
}

.mode-pill.active .mode-pill-desc {
    opacity: 0.85;
}

.spotlight-selector {
    background: var(--color-bg-lavender);
    padding: 1.5rem;
    border-radius: 12px;
    border: 2px solid var(--color-primary);
    margin-top: 1rem;
    animation: slideDown 0.3s ease-out;
}

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

.spotlight-selector label {
    display: block;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.spotlight-doc-select {
    width: 100%;
    padding: 0.875rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: white;
    color: var(--color-text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.spotlight-doc-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

#spotlight-no-docs {
    font-style: italic;
    text-align: center;
    padding: 1rem;
    background: rgba(249, 115, 22, 0.1);
    border: 1px dashed var(--color-accent);
    border-radius: 8px;
}

/* Context Display */
.context-display {
    background: var(--color-bg-lavender);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    white-space: pre-wrap;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    max-height: 500px;
    overflow-y: auto;
    color: var(--color-text);
}

#context-mode-info {
    background: linear-gradient(to right, rgba(99, 102, 241, 0.1), transparent);
    padding: 1rem;
    border-left: 4px solid var(--color-primary);
    border-radius: 4px;
    font-size: 0.95rem;
}

#context-mode-text {
    color: var(--color-primary);
    font-weight: 700;
}

/* Message Actions */
.message-actions {
    margin-top: 0.75rem;
    display: flex;
    gap: 0.5rem;
}

.view-chunks-btn {
    padding: 0.5rem 1rem;
    background: var(--color-accent-teal);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.view-chunks-btn:hover {
    background: #0f9e8d;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(20, 184, 166, 0.3);
}

/* Markdown Rendering in Messages */
.markdown-content p {
    margin: 0;
    margin-bottom: 0.75rem;  /* Only bottom margin for paragraph separation */
}

.markdown-content p:first-child {
    margin-top: 0;
}

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

.markdown-content strong {
    font-weight: 700;
    color: var(--color-text);
}

.markdown-content em {
    font-style: italic;
}

.markdown-content code {
    background: rgba(99, 102, 241, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.9em;
}

.markdown-content pre {
    background: var(--color-bg-lavender);
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 0.75rem 0;
}

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

.markdown-content ul, .markdown-content ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.markdown-content li {
    margin: 0.25rem 0;
}

.markdown-content blockquote {
    border-left: 3px solid var(--color-primary);
    padding-left: 1rem;
    margin: 0.75rem 0;
    color: var(--color-text-light);
}

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

.markdown-content h1 {
    font-size: 1.5rem;
}

.markdown-content h2 {
    font-size: 1.3rem;
}

.markdown-content h3 {
    font-size: 1.1rem;
}

.markdown-content a {
    color: var(--color-primary);
    text-decoration: underline;
}

.markdown-content a:hover {
    color: var(--color-accent-teal);
}

.markdown-content hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 1rem 0;
}

.markdown-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 0.75rem 0;
}

.markdown-content th, .markdown-content td {
    border: 1px solid var(--color-border);
    padding: 0.5rem;
    text-align: left;
}

.markdown-content th {
    background: var(--color-bg-lavender);
    font-weight: 700;
}
