/* VineAnalyst CSS - macOS/iOS-Inspired UI with Everforest Light Theme */

/* ==== CSS Variables (Google-Inspired Design) ==== */
:root {
    /* Light Theme Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #f1f3f4;
    --bg-hover: #e8eaed;
    --accent-primary: #1a73e8;
    --accent-secondary: #1967d2;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --text-muted: #80868b;
    --border-color: #dadce0;

    /* Google Material Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
    --shadow-md: 0 1px 3px 0 rgba(60, 64, 67, 0.3), 0 4px 8px 3px rgba(60, 64, 67, 0.15);
    --shadow-lg: 0 2px 6px 2px rgba(60, 64, 67, 0.15), 0 8px 16px 4px rgba(60, 64, 67, 0.15);
    --shadow-focus: 0 0 0 2px rgba(26, 115, 232, 0.4);

    /* Google-Style Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 8px;
    --radius-xl: 12px;
}

/* ==== Dark Theme ==== */
[data-theme="dark"] {
    /* Dark Theme Colors */
    --bg-primary: #1e1e1e;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #3a3a3a;
    --bg-hover: #404040;
    --accent-primary: #8ab4f8;
    --accent-secondary: #669df6;
    --text-primary: #e8eaed;
    --text-secondary: #9aa0a6;
    --text-muted: #80868b;
    --border-color: #3c4043;

    /* Dark Theme Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3), 0 1px 3px 1px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 4px 8px 3px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 2px 6px 2px rgba(0, 0, 0, 0.15), 0 8px 16px 4px rgba(0, 0, 0, 0.15);
    --shadow-focus: 0 0 0 2px rgba(138, 180, 248, 0.4);
}

/* Dark Theme Button Overrides */
[data-theme="dark"] .btn-primary {
    background: #8ab4f8;
    color: #1e1e1e;
}

[data-theme="dark"] .btn-primary:hover {
    background: #aac7ff;
}

[data-theme="dark"] .btn-secondary {
    background: #3a3a3a;
    color: #e8eaed;
    border: 1px solid #5f6368;
}

[data-theme="dark"] .btn-secondary:hover {
    background: #4a4a4a;
    border-color: #8ab4f8;
}

[data-theme="dark"] .btn-icon {
    background: transparent;
    color: #e8eaed;
}

[data-theme="dark"] .btn-icon:hover {
    background: #3a3a3a;
}

[data-theme="dark"] .form-control:focus {
    box-shadow: 0 0 0 3px rgba(138, 180, 248, 0.2);
}

[data-theme="dark"] .file-upload-zone {
    border-color: #5f6368;
}

[data-theme="dark"] .file-upload-zone:hover,
[data-theme="dark"] .file-upload-zone.dragover {
    border-color: #8ab4f8;
    background: #2d2d2d;
}

    /* Layout */
    --sidebar-width: 280px;
    --agent-panel-width: 350px;
    --top-nav-height: 52px;
    --footer-height: 40px;

    /* macOS-Style Transitions */
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
    --transition-spring: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
    display: flex;
    flex-direction: column;
}

/* ==== Top Navigation ==== */
.top-nav {
    height: var(--top-nav-height);
    flex-shrink: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: var(--shadow-sm);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.user-email-display {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.app-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--accent-primary);
}

.project-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.project-dropdown {
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.project-dropdown:hover {
    border-color: var(--accent-primary);
}

.project-dropdown:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(141, 161, 1, 0.1);
}

/* ==== macOS-Style Buttons ==== */
.btn {
    padding: 9px 18px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 38px;
    letter-spacing: -0.01em;
}

.btn:hover {
    transform: translateY(-0.5px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: scale(0.97);
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--accent-secondary);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.7);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--accent-primary);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
    min-height: 32px;
    border-radius: var(--radius-sm);
}

.btn-icon {
    padding: 9px;
    min-width: 38px;
    min-height: 38px;
    font-size: 16px;
    border-radius: var(--radius-md);
}

/* ==== Main Container (Resizable 3-Pane Layout) ==== */
.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ==== Sidebar (File Explorer) ==== */
.sidebar {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
    min-width: 200px;
    max-width: 400px;
}

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

.sidebar-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.sidebar-actions {
    display: flex;
    gap: 6px;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    position: relative;
}

.sidebar-content.drag-active {
    background: rgba(141, 161, 1, 0.05);
    outline: 2px dashed var(--accent-primary);
    outline-offset: -4px;
}

/* Folder Tree */
.folder-tree {
    user-select: none;
}

.folder-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.folder-item:hover {
    background: var(--bg-hover);
}

.folder-item.selected {
    background: var(--accent-primary);
    color: white;
}

.folder-item.drag-over {
    background: rgba(141, 161, 1, 0.2);
    border: 2px dashed var(--accent-primary);
    border-radius: var(--radius-sm);
}

.folder-toggle {
    width: 16px;
    font-size: 10px;
    cursor: pointer;
}

.folder-icon {
    font-size: 16px;
}

.folder-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.folder-children {
    margin-left: 12px;
}

/* File Items */
.files-container {
    padding-left: 32px;
    margin-top: 4px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    margin-bottom: 2px;
}

.file-item:hover {
    background: var(--bg-hover);
}

.file-item.selected {
    background: var(--accent-primary);
    color: white;
}

.file-item.selected .file-size {
    color: rgba(255, 255, 255, 0.8);
}

.file-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.file-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.file-delete-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition-fast);
}

.file-item:hover .file-delete-btn {
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-delete-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #f85552;
}

/* File checkbox for multi-select */
.file-checkbox {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: var(--accent-primary);
    flex-shrink: 0;
}

.file-item:hover .file-checkbox {
    opacity: 1;
}

/* Delete Selected Button */
.delete-selected-btn {
    display: none;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    margin-left: auto;
    transition: var(--transition-fast);
}

.delete-selected-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
}

/* ==== Workspace (Center) ==== */
.workspace {
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    overflow: hidden;
}

.workspace-header {
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    min-height: 42px;
}

.workspace-tabs {
    display: flex;
    gap: 2px;
    padding: 6px 12px;
    overflow-x: auto;
}

.workspace-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 4px 4px 0 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-bottom: none;
    cursor: pointer;
    transition: var(--transition);
    font-size: 13px;
}

.workspace-tab:hover {
    background: var(--bg-hover);
}

.workspace-tab.active {
    background: var(--bg-primary);
    border-color: var(--accent-primary);
}

.workspace-tab-close {
    font-size: 16px;
    color: var(--text-muted);
    cursor: pointer;
}

.workspace-tab-close:hover {
    color: var(--text-primary);
}

.workspace-content {
    flex: 1;
    overflow: auto;
    position: relative;
    padding: 20px;
    height: 100%;
}

.workspace-views {
    display: none;
}

.workspace-views.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100%;
}

/* ==== Chat Panel (Right) ==== */
.agent-panel {
    background: var(--bg-primary);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
    min-width: 300px;
    max-width: 600px;
}

.agent-panel-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.agent-panel-header h2 {
    font-size: 16px;
    font-weight: 600;
}

.agent-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* Agent Selection */
.agent-selection h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.agent-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.agent-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    cursor: pointer;
    transition: var(--transition);
}

.agent-option:hover {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
}

.agent-option input[type="checkbox"] {
    margin-top: 2px;
    accent-color: var(--accent-primary);
}

.agent-badge {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.teacher-badge {
    background: linear-gradient(135deg, #8da101 0%, #7a8c00 100%);
    color: white;
}

.auditor1-badge {
    background: linear-gradient(135deg, #3a94c5 0%, #2d7a9f 100%);
    color: white;
}

.auditor2-badge {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    color: white;
}

.agent-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.agent-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.agent-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Agent Prompt */
.agent-prompt {
    margin-top: 20px;
}

.agent-prompt h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

.prompt-textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    transition: var(--transition);
}

.prompt-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(141, 161, 1, 0.1);
}

.prompt-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* Agent Results */
.agent-results {
    margin-top: 20px;
}

.agent-results h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

.results-content {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 16px;
    min-height: 200px;
    max-height: 600px;
    overflow-y: auto;
}

/* Agent Result Sections */
.agent-result-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 16px;
}

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

.agent-result-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.agent-result-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    flex: 1;
}

.agent-status {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 4px 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.agent-status.status-complete {
    background: rgba(141, 161, 1, 0.2);
    color: var(--accent-primary);
}

.agent-status.status-error {
    background: rgba(239, 68, 68, 0.2);
    color: #f85552;
}

.agent-progress {
    margin-bottom: 16px;
}

.agent-response {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
}

.agent-response h1,
.agent-response h2,
.agent-response h3 {
    margin-top: 16px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.agent-response h1 {
    font-size: 18px;
}

.agent-response h2 {
    font-size: 16px;
}

.agent-response h3 {
    font-size: 14px;
}

.agent-response strong {
    font-weight: 600;
    color: var(--accent-primary);
}

.agent-meta {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-muted);
}

.analysis-status {
    padding: 16px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

.error-message {
    padding: 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 4px;
    color: #f85552;
    font-size: 14px;
}

/* ==== Modals ==== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(60, 77, 86, 0.5);
    backdrop-filter: blur(2px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.modal-header .modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

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

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background: var(--bg-secondary);
}

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

/* Form Elements */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(141, 161, 1, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* File Upload Zone */
.file-upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: 6px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.file-upload-zone:hover,
.file-upload-zone.dragover {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.upload-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.upload-hint {
    font-size: 12px;
    color: var(--text-secondary);
}

.upload-file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 6px;
}

.file-name {
    font-size: 14px;
    font-weight: 500;
}

.file-remove {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.file-remove:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Upload Progress */
.upload-progress {
    margin-top: 16px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent-primary);
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
    text-align: center;
}

/* ==== Empty States ==== */
.empty-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.empty-state.active {
    display: flex;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.8;
}

.empty-state-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-state-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.empty-state-hint {
    font-size: 13px;
    color: var(--text-muted);
    max-width: 400px;
}

.empty-state-features {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.feature-badge {
    padding: 6px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.15s ease;
}

.feature-badge:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

/* ==== Responsive Design ==== */
@media (max-width: 1024px) {
    .main-container {
        grid-template-columns: var(--sidebar-width) 1fr;
    }

    .agent-panel {
        position: fixed;
        right: 0;
        top: var(--top-nav-height);
        height: calc(100vh - var(--top-nav-height));
        z-index: 100;
    }
}

@media (max-width: 767px) {
    :root {
        --sidebar-width: 100%;
        --agent-panel-width: 100%;
    }

    .main-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: var(--top-nav-height);
        height: calc(100vh - var(--top-nav-height));
        z-index: 90;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

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

    .agent-panel {
        top: auto;
        bottom: 0;
        height: 60vh;
        transform: translateY(100%);
    }

    .agent-panel:not(.collapsed) {
        transform: translateY(0);
    }

    .project-selector {
        flex-direction: column;
        gap: 8px;
    }

    .project-dropdown {
        min-width: auto;
        width: 100%;
    }
}

/* ==== File Preview ==== */
.file-preview-container {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 1200px;
    width: 100%;
    margin: 0;
    box-shadow: var(--shadow-sm);
}

.file-preview-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.file-preview-header h3 {
    flex: 1;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.file-type-badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--accent-primary);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.file-preview-content {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 20px;
    max-height: calc(100vh - 300px);
    overflow-y: auto;
}

.text-content pre {
    margin: 0;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-wrap: break-word;
}

.markdown-content {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-primary);
}

.markdown-content h1 {
    font-size: 24px;
    font-weight: 700;
    margin-top: 24px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.markdown-content h2 {
    font-size: 20px;
    font-weight: 600;
    margin-top: 20px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.markdown-content h3 {
    font-size: 16px;
    font-weight: 600;
    margin-top: 16px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.markdown-content p {
    margin-bottom: 16px;
}

.markdown-content code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 13px;
}

.markdown-content pre {
    background: var(--bg-tertiary);
    padding: 16px;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin-bottom: 16px;
}

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

.markdown-content li {
    margin-left: 24px;
    margin-bottom: 8px;
}

.markdown-content strong {
    font-weight: 600;
    color: var(--accent-primary);
}

.pdf-preview {
    width: 100%;
    height: calc(100vh - 250px);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-tertiary);
}

.pdf-preview iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.file-info {
    text-align: center;
    padding: 60px 40px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    max-width: 500px;
    margin: 0 auto;
}

.file-info p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.6;
}

.file-info .btn {
    margin-top: 20px;
}

/* ==== Upload Overlay ==== */
.upload-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(60, 77, 86, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.2s ease;
}

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

.upload-overlay-content {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 32px 40px;
    box-shadow: var(--shadow-lg);
    min-width: 400px;
    max-width: 500px;
    animation: slideUp 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

.upload-overlay-text {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 16px;
    text-align: center;
}

.upload-overlay-percent {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 12px;
    text-align: center;
    font-weight: 600;
}

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

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
/* ==== Settings Modal Styles ==== */
.modal-wide {
    max-width: 800px;
}

.settings-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.settings-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.settings-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px 0;
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.form-hint a {
    color: var(--accent-primary);
    text-decoration: none;
}

.form-hint a:hover {
    text-decoration: underline;
}

.privacy-notice {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(138, 180, 248, 0.1);
    border-left: 3px solid var(--accent-primary);
    border-radius: var(--radius-sm);
    margin-top: 16px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.privacy-notice svg {
    margin-top: 2px;
    color: var(--accent-primary);
}

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

.privacy-notice a {
    color: var(--accent-primary);
    text-decoration: none;
}

.privacy-notice a:hover {
    text-decoration: underline;
}

[data-theme="dark"] .privacy-notice {
    background: rgba(138, 180, 248, 0.15);
}

/* ==== Footer ==== */
.vineanalyst-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 12px 16px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.footer-separator {
    color: var(--border-color);
}

.vineanalyst-footer a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
}

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

.agent-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
}

.agent-setting-row:last-child {
    margin-bottom: 0;
}

.agent-setting-label {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

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

.agent-setting-info .agent-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.agent-setting-info .agent-desc {
    font-size: 12px;
    color: var(--text-muted);
}

.agent-setting-controls {
    min-width: 300px;
}

.model-select {
    width: 100%;
}

.connection-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-secondary);
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-muted);
    flex-shrink: 0;
}

.status-dot.connected {
    background: #73ba25;
    box-shadow: 0 0 0 3px rgba(115, 186, 37, 0.2);
}

.status-dot.error {
    background: #f85552;
    box-shadow: 0 0 0 3px rgba(248, 85, 82, 0.2);
}

.status-dot.testing {
    background: #f29718;
    box-shadow: 0 0 0 3px rgba(242, 151, 24, 0.2);
    animation: pulse 1.5s ease-in-out infinite;
}

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

/* ==== Cursor-Style Agent Model Selection ==== */
.agent-option-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.agent-option {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    flex: 1;
}

.agent-option:hover {
    background: var(--bg-hover);
}

.agent-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-primary);
}

.agent-model-select {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 12px;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.agent-model-select:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
}

.agent-model-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-focus);
}

.agent-model-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.agent-model-select option {
    padding: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* Welcome Banner */
.welcome-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 10000;
    animation: slideDown 0.5s ease-out;
}

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

.welcome-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
}

.welcome-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.welcome-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.welcome-text strong {
    font-size: 16px;
    font-weight: 600;
}

.welcome-text span {
    font-size: 14px;
    opacity: 0.95;
}

.welcome-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.welcome-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Adjust top-nav when welcome banner is shown */
body.welcome-shown .top-nav {
    top: 64px;
}

body.welcome-shown .main-container {
    margin-top: 120px;
}

/* ==== Context Menu ==== */
.context-menu {
    position: fixed;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    z-index: 10000;
    padding: 4px 0;
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
    transition: background 0.15s ease;
}

.context-menu-item:hover {
    background: var(--bg-hover);
}

.context-menu-item svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.context-menu-item-danger {
    color: #d93025;
}

.context-menu-item-danger:hover {
    background: rgba(217, 48, 37, 0.1);
}

.context-menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

/* Dark theme overrides */
[data-theme="dark"] .context-menu-item-danger:hover {
    background: rgba(234, 67, 53, 0.15);
}

/* ==== Analytics Panel (Fourth Panel) - NotebookLM Inspired ==== */
.analytics-panel {
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    border-left: 1px solid var(--border-color);
    overflow: hidden;
    min-width: 320px;
    max-width: 480px;
}

.analytics-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.analytics-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.2px;
}

.analytics-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    background: var(--bg-secondary);
}

.analytics-section {
    margin-bottom: 32px;
}

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

.section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 0 0 16px 0;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

/* Stock Data Quota Display */
.quota-display {
    margin-top: 16px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.quota-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.quota-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}

.quota-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    transition: width 0.3s ease, background 0.3s ease;
}

.quota-fill.warning {
    background: linear-gradient(90deg, #FF9800, #FFC107);
}

.quota-fill.danger {
    background: linear-gradient(90deg, #F44336, #E91E63);
}

.quota-text {
    font-size: 11px;
    color: var(--text-secondary);
    text-align: right;
}

.analytics-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.analytics-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--accent-primary);
    opacity: 0;
    transition: opacity 0.15s ease;
    pointer-events: none;
}

.analytics-card:hover {
    background: var(--bg-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.analytics-card:hover::before {
    opacity: 0.03;
}

.analytics-card:active {
    transform: translateY(-1px);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.analytics-card.multi-agent {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    border-width: 1px;
    border-style: solid;
    border-color: var(--accent-primary);
}

.analytics-card.multi-agent::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-primary);
}

.analytics-card.multi-agent:hover {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-hover) 100%);
    box-shadow: 0 2px 12px rgba(26, 115, 232, 0.15);
}

.card-icon {
    font-size: 24px;
    line-height: 1;
    margin-bottom: 2px;
    filter: grayscale(0.2);
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    letter-spacing: -0.1px;
}

.card-description {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    font-weight: 400;
}

/* Dark theme analytics panel */
[data-theme="dark"] .analytics-panel {
    background: var(--bg-secondary);
}

[data-theme="dark"] .analytics-content {
    background: var(--bg-primary);
}

[data-theme="dark"] .analytics-card {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .analytics-card:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .analytics-card.multi-agent {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
}

[data-theme="dark"] .analytics-card.multi-agent:hover {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-hover) 100%);
    box-shadow: 0 2px 12px rgba(138, 180, 248, 0.2);
}

/* Responsive: Hide analytics panel on smaller screens */
@media (max-width: 1600px) {
    .analytics-panel {
        width: 320px !important;
    }
}

@media (max-width: 1400px) {
    .analytics-panel {
        display: none;
    }

    #resizer-3 {
        display: none;
    }
}

/* Model Warning */
.model-warning {
    display: none; /* Hidden by default */
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    margin: 8px 0;
    background: rgba(255, 152, 0, 0.1);
    border: 1px solid rgba(255, 152, 0, 0.3);
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-primary);
}

.model-warning.visible {
    display: flex;
}

.model-warning svg {
    color: #FF9800;
    margin-top: 2px;
}

.model-warning strong {
    color: #FF9800;
}

/* Coming Soon Badge */
.coming-soon-badge {
    display: inline-block;
    padding: 2px 8px;
    margin-left: 8px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(158, 158, 158, 0.15);
    color: var(--text-secondary);
    border-radius: 4px;
    vertical-align: middle;
}

/* New Badge */
.new-badge {
    display: inline-block;
    padding: 2px 8px;
    margin-left: 8px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #8da101, #6b7e01);
    color: white;
    border-radius: 4px;
    vertical-align: middle;
}

/* Checkbox Label for Message Testing */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Disabled Analytics Card */
.analytics-card.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.analytics-card.disabled:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--border-color);
}

.analytics-card.disabled::before {
    display: none;
}

/* Chart Modal */
#chart-modal .modal-content {
    background: var(--surface-color);
    max-height: 95vh;  /* Allow more space for chart */
}

#chart-modal .modal-body {
    padding: 0;
    background: #1a1a1a;
    overflow: visible;  /* Ensure chart is not clipped */
}

#chart-container {
    background: #1a1a1a;
    min-height: 600px;  /* Ensure minimum height */
    overflow: visible;  /* Ensure chart is not clipped */
}

/* Ensure Plotly SVG displays fully */
#chart-container .plotly-graph-div {
    overflow: visible !important;
}

#chart-container .main-svg {
    overflow: visible !important;
}

.chart-controls {
    display: flex;
    gap: 8px;
    flex: 1;
}

.chart-controls button {
    padding: 8px 16px;
    font-size: 13px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

/* Spinner for chart loading */
.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ==== Research Platform Styles ==== */

/* Full-screen modal for research chat */
.modal-fullscreen .modal-content {
    width: 95vw;
    max-width: 1400px;
    height: 90vh;
    max-height: none;
}

/* Research project cards */
.panel-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.panel-card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-sm);
}

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

.panel-card-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
}

.panel-card-body {
    margin-bottom: 12px;
}

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

/* Research stage badges */
.research-stage-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    color: white;
    background: var(--accent-primary);
}

/* Research agents sidebar */
.research-agents-sidebar {
    background: var(--bg-secondary);
}

.research-agents-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.research-agent-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.15s;
    color: var(--text-secondary);
}

.research-agent-btn:hover {
    background: var(--bg-hover);
}

.research-agent-btn.active {
    background: var(--accent-primary);
    color: white;
}

.research-agent-btn .agent-icon {
    font-size: 18px;
}

.research-agent-btn .agent-name {
    font-size: 13px;
    font-weight: 500;
}

/* Research chat area */
.research-chat-area {
    background: var(--bg-primary);
}

#research-chat-messages {
    padding: 16px;
}

#research-chat-messages .chat-message {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

#research-chat-messages .message-avatar {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
}

#research-chat-messages .user-message .message-avatar {
    background: var(--accent-primary);
    color: white;
}

#research-chat-messages .message-content {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    font-size: 14px;
    line-height: 1.5;
}

#research-chat-messages .user-message .message-content {
    background: var(--accent-primary);
    color: white;
}

#research-chat-messages .system-message {
    justify-content: center;
}

#research-chat-messages .system-message .message-content {
    background: transparent;
    text-align: center;
    max-width: 80%;
}

/* Typing indicator */
.typing-indicator .typing-dots span {
    animation: typingBlink 1.4s infinite both;
    font-size: 20px;
}

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

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

@keyframes typingBlink {
    0%, 60%, 100% { opacity: 0.3; }
    30% { opacity: 1; }
}

/* Research chat input */
.research-chat-input {
    background: var(--bg-secondary);
}

.research-chat-input textarea {
    resize: none;
}

/* Project info in modal header */
.research-project-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    margin-right: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Radio and checkbox grids */
.radio-grid, .checkbox-grid {
    display: grid;
    gap: 8px;
}

.radio-label, .checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
}

.radio-label input, .checkbox-label input {
    cursor: pointer;
}

/* Severity badges */
.severity-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
}

.severity-low {
    background: #dcfce7;
    color: #166534;
}

.severity-medium {
    background: #fef3c7;
    color: #92400e;
}

.severity-high {
    background: #fee2e2;
    color: #991b1b;
}

[data-theme="dark"] .severity-low {
    background: #166534;
    color: #dcfce7;
}

[data-theme="dark"] .severity-medium {
    background: #92400e;
    color: #fef3c7;
}

[data-theme="dark"] .severity-high {
    background: #991b1b;
    color: #fee2e2;
}

/* Literature search results */
.paper-card {
    transition: background 0.15s;
}

.paper-card:hover {
    background: var(--bg-hover);
}

/* Panels list (shared with message testing) */
.panels-list {
    max-height: 400px;
    overflow-y: auto;
}

/* Empty and loading states */
.empty-state, .loading-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.loading-spinner {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
}

/* Privacy notice styling */
.privacy-notice {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--text-secondary);
}

.privacy-notice svg {
    flex-shrink: 0;
    margin-top: 2px;
}
