/* Design Tokens - Contrails Brand */
:root {
    --sky-blue: #3480FF;
    --midnight-navy: #081625;
    --icy-cyan: #5FE3FF;
    --afterburn-orange: #F35B04;
    --jet-grey: #A8B0B9;
    --sky-blue-hover: #2970E5;
    --midnight-navy-light: #0F2847;
    --cloud-white: #F0F4F8;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    height: 100vh;
    overflow: hidden;
    display: flex;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--midnight-navy) 0%, var(--midnight-navy-light) 100%);
    border-right: 1px solid var(--midnight-navy-light);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px 16px 16px;
    border-bottom: 1px solid var(--midnight-navy-light);
}

.sidebar-logo {
    width: 100%;
    height: auto;
    max-width: 180px;
    display: block;
    object-fit: contain;
    filter: brightness(0.7) saturate(1.3);
}

body.dark-mode .sidebar-logo {
    filter: none;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.new-chat-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--sky-blue);
    border: 1px solid var(--sky-blue);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
    transition: all 0.2s;
    margin-bottom: 12px;
}

.new-chat-btn:hover {
    background: var(--sky-blue-hover);
    border-color: var(--sky-blue-hover);
    color: #ffffff;
}

.chat-history {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chat-history-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    color: var(--jet-grey);
    font-size: 14px;
}

.chat-history-item:hover {
    background-color: var(--midnight-navy-light);
}

.chat-history-item.active {
    background-color: var(--sky-blue);
    color: white;
}

/* Date group headers */
.date-group-header {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--jet-grey);
    padding: 12px 12px 6px;
    margin-top: 8px;
    letter-spacing: 0.5px;
}

.date-group-header:first-child {
    margin-top: 0;
}

/* Chat actions container */
.chat-actions {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.15s ease;
    margin-left: auto;
}

.chat-history-item:hover .chat-actions {
    opacity: 1;
}

.chat-history-item.active .chat-actions {
    opacity: 1;
}

/* Rename button */
.rename-chat-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    color: inherit;
    transition: all 0.2s;
}

.rename-chat-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--sky-blue);
}

/* Delete button */
.delete-chat-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    color: inherit;
    transition: all 0.2s;
}

.delete-chat-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ff6b6b;
}

/* Chat title */
.chat-title {
    min-width: 0;
}

/* Inline edit input */
.chat-title-input {
    background: transparent;
    border: 1px solid var(--sky-blue);
    border-radius: 4px;
    padding: 2px 6px;
    color: inherit;
    font-size: inherit;
    width: 100%;
    outline: none;
    flex: 1;
    min-width: 0;
}

.chat-title-input:focus {
    background: rgba(255, 255, 255, 0.05);
}

/* Search container */
.search-container {
    padding: 12px 12px 8px;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 10px;
    color: var(--jet-grey);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 8px 32px 8px 32px;
    background: var(--midnight-navy-light);
    border: 1px solid transparent;
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-input:focus {
    border-color: var(--sky-blue);
}

.clear-search-btn {
    position: absolute;
    right: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--jet-grey);
    border-radius: 4px;
}

.clear-search-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* Search results */
.search-results-header {
    font-size: 11px;
    color: var(--jet-grey);
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-results-count {
    background: var(--sky-blue);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
}

.match-badge {
    font-size: 9px;
    background: rgba(95, 227, 255, 0.2);
    color: var(--icy-cyan);
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 4px;
}

.user-section {
    border-top: 1px solid var(--midnight-navy-light);
    padding: 8px;
}

.user-avatar-icon {
    background: var(--sky-blue);
}

.sidebar-text {
    color: #d4d4d4;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
}

.top-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #cbd6e2;
    background: white;
    height: 60px;
}

.header-title {
    color: #1f2937;
}

body.dark-mode .header-title {
    color: #e5e5e5;
}

.sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    background: #f3f4f6;
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.theme-toggle:hover {
    background: #f3f4f6;
}

/* Messages Container */
.messages-container {
    flex: 1;
    overflow-y: auto;
    background: white;
}

.messages-wrapper {
    max-width: 48rem;
    margin: 0 auto;
    padding: 24px 16px;
}

/* Welcome Screen */
.welcome-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
}

.welcome-content {
    text-align: center;
}

.welcome-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: var(--sky-blue);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.welcome-title {
    font-size: 28px;
    font-weight: 600;
    color: #1f1f1f;
}

/* Quick Prompts */
.quick-prompts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 24px;
    max-width: 480px;
    width: 100%;
}

.quick-prompt-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    text-align: center;
    min-height: 52px;
}

.quick-prompt-btn:hover {
    background: var(--sky-blue);
    border-color: var(--sky-blue);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 128, 255, 0.25);
}

.quick-prompt-btn svg {
    flex-shrink: 0;
}

body.dark-mode .quick-prompt-btn {
    background: #40414f;
    border-color: #565869;
    color: #e5e5e5;
}

body.dark-mode .quick-prompt-btn:hover {
    background: var(--sky-blue);
    border-color: var(--sky-blue);
    color: white;
}

/* Message Styles */
.message-group {
    margin-bottom: 32px;
    animation: fadeIn 0.4s ease-out;
    position: relative;
}

/* Copy Message Button */
.copy-message-btn {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    opacity: 0;
    transition: all 0.15s ease;
}

.message-group:hover .copy-message-btn {
    opacity: 1;
}

.copy-message-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.copy-message-btn.copied {
    background: #059669;
    border-color: #059669;
    color: white;
    opacity: 1;
}

.copy-message-btn svg {
    width: 14px;
    height: 14px;
}

body.dark-mode .copy-message-btn {
    background: #40414f;
    border-color: #565869;
    color: #9ca3af;
}

body.dark-mode .copy-message-btn:hover {
    background: #4a4b57;
    color: #e5e5e5;
}

body.dark-mode .copy-message-btn.copied {
    background: #059669;
    border-color: #059669;
    color: white;
}

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

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

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

.message-avatar.user {
    background: var(--sky-blue);
    color: white;
}

.message-avatar.assistant {
    background: var(--midnight-navy);
    color: white;
}

.message-role {
    font-weight: 600;
    font-size: 14px;
    color: #1f1f1f;
}

.rag-badge, .sql-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
    padding: 3px 8px;
    background: var(--icy-cyan);
    color: var(--midnight-navy);
    font-size: 11px;
    font-weight: 600;
    border-radius: 12px;
    cursor: help;
}

.sql-badge {
    background: var(--midnight-navy);
    color: white;
}

.rag-badge svg, .sql-badge svg {
    width: 12px;
    height: 12px;
}

.message-content {
    padding-left: 44px;
    color: #374151;
    line-height: 1.7;
}

/* Markdown Styling */
.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4 {
    font-weight: 600;
    margin-top: 24px;
    margin-bottom: 12px;
    color: #1f1f1f;
}

.message-content h1 { font-size: 1.5em; }
.message-content h2 { font-size: 1.3em; }
.message-content h3 { font-size: 1.15em; }

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

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

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

.message-content li {
    margin: 6px 0;
}

.message-content code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 0.9em;
    color: #1f1f1f;
}

.message-content pre {
    background: #1f2937;
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
    margin: 16px 0;
    position: relative;
}

.message-content pre code {
    background: none;
    padding: 0;
    color: #e5e7eb;
    font-size: 0.875em;
    line-height: 1.6;
}

.code-block-wrapper {
    position: relative;
    margin: 16px 0;
}

.code-block-header {
    background: #374151;
    color: #9ca3af;
    padding: 8px 16px;
    border-radius: 8px 8px 0 0;
    font-size: 12px;
    font-family: monospace;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.code-block-wrapper pre {
    margin: 0;
    border-radius: 0 0 8px 8px;
}

/* Copy Code Button */
.message-content pre {
    position: relative;
}

.copy-code-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 4px;
    font-size: 11px;
    color: #9ca3af;
    cursor: pointer;
    opacity: 0;
    transition: all 0.15s ease;
}

.message-content pre:hover .copy-code-btn {
    opacity: 1;
}

.copy-code-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #e5e5e5;
}

.copy-code-btn.copied {
    background: #059669;
    color: white;
    opacity: 1;
}

.copy-code-btn svg {
    width: 12px;
    height: 12px;
}

/* Message Timestamp */
.message-timestamp {
    font-size: 11px;
    color: #9ca3af;
    margin-left: auto;
}

body.dark-mode .message-timestamp {
    color: #6b7280;
}

.message-content blockquote {
    border-left: 3px solid #e5e7eb;
    padding-left: 16px;
    margin: 16px 0;
    color: #6b7280;
    font-style: italic;
}

.message-content a {
    color: var(--sky-blue);
    text-decoration: underline;
}

.message-content a:hover {
    color: var(--sky-blue-hover);
}

.message-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 16px 0;
}

.message-content th,
.message-content td {
    border: 1px solid #e5e7eb;
    padding: 8px 12px;
    text-align: left;
}

.message-content th {
    background: #f9fafb;
    font-weight: 600;
}

/* Highcharts Container */
.chart-container {
    margin: 20px 0;
    padding: 16px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: relative;
}

.chart-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f1f1f;
    margin-bottom: 12px;
}

/* Chart/Table Export Actions */
.export-actions {
    display: flex;
    gap: 6px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.export-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s ease;
}

.export-btn:hover {
    background: var(--sky-blue);
    border-color: var(--sky-blue);
    color: white;
}

.export-btn svg {
    width: 14px;
    height: 14px;
}

.export-btn.copied {
    background: #059669;
    border-color: #059669;
    color: white;
}

body.dark-mode .export-actions {
    border-top-color: #3e3f4b;
}

body.dark-mode .export-btn {
    background: #40414f;
    border-color: #565869;
    color: #e5e5e5;
}

body.dark-mode .export-btn:hover {
    background: var(--sky-blue);
    border-color: var(--sky-blue);
    color: white;
}

/* Table wrapper for export */
.table-wrapper {
    position: relative;
}

.table-export-actions {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.highcharts-container {
    width: 100% !important;
}

.highcharts-background {
    fill: transparent;
}

.highcharts-credits {
    display: none;
}

/* Thinking Indicator */
.thinking-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 8px;
}

.thinking-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top-color: var(--sky-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.thinking-text {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}

.thinking-steps {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
}

.thinking-step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #9ca3af;
}

.thinking-step.active {
    color: var(--sky-blue);
}

.thinking-step.completed {
    color: #059669;
}

.thinking-step svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

body.dark-mode .thinking-indicator {
    background: #2a2b32;
}

body.dark-mode .thinking-text {
    color: #9ca3af;
}

body.dark-mode .thinking-spinner {
    border-color: #3e3f4b;
    border-top-color: var(--sky-blue);
}

/* SQL Preview */
.sql-preview {
    margin-top: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.sql-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
    user-select: none;
}

.sql-preview-header:hover {
    background: #f3f4f6;
}

.sql-preview-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
}

.sql-preview-title svg {
    width: 14px;
    height: 14px;
}

.sql-preview-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #6b7280;
}

.sql-preview-toggle svg {
    width: 14px;
    height: 14px;
    transition: transform 0.2s;
}

.sql-preview.expanded .sql-preview-toggle svg {
    transform: rotate(180deg);
}

.sql-preview-content {
    display: none;
    padding: 12px;
    background: #1f2937;
    max-height: 200px;
    overflow-y: auto;
}

.sql-preview.expanded .sql-preview-content {
    display: block;
}

.sql-preview-content pre {
    margin: 0;
    padding: 0;
    background: transparent;
}

.sql-preview-content code {
    font-size: 12px;
    line-height: 1.5;
    color: #e5e7eb;
    white-space: pre-wrap;
    word-break: break-word;
}

.sql-preview-actions {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    border-top: 1px solid #374151;
    background: #1f2937;
}

body.dark-mode .sql-preview {
    border-color: #3e3f4b;
}

body.dark-mode .sql-preview-header {
    background: #2a2b32;
    border-bottom-color: #3e3f4b;
}

body.dark-mode .sql-preview-header:hover {
    background: #343541;
}

body.dark-mode .sql-preview-title {
    color: #e5e5e5;
}

/* Row count badge */
.row-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #ecfdf5;
    color: #059669;
    font-size: 12px;
    font-weight: 600;
    border-radius: 12px;
    margin-left: 8px;
}

.row-count-badge svg {
    width: 12px;
    height: 12px;
}

body.dark-mode .row-count-badge {
    background: rgba(5, 150, 105, 0.2);
    color: #34d399;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 0;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #9ca3af;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

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

/* Input Container */
.input-wrapper {
    padding: 20px 16px;
    background: white;
    border-top: 1px solid #cbd6e2;
}

.input-container-modern {
    max-width: 48rem;
    margin: 0 auto;
    position: relative;
    background: white;
    border: 1px solid #cbd6e2;
    border-radius: 24px;
    padding: 12px 16px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: border-color 0.2s;
}

.input-container-modern:focus-within {
    border-color: var(--sky-blue);
    box-shadow: 0 2px 4px rgba(52, 128, 255, 0.1);
}

.message-input {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    font-size: 15px;
    line-height: 24px;
    max-height: 200px;
    overflow-y: auto;
    font-family: inherit;
    color: #1f1f1f;
    background: transparent;
}

.message-input::placeholder {
    color: #9ca3af;
}

.voice-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.voice-btn:hover {
    background: #f3f4f6;
    color: var(--sky-blue);
}

.voice-btn.recording {
    color: #ef4444;
    animation: pulse 1.5s infinite;
}

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

.send-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--sky-blue);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.send-btn:hover:not(:disabled) {
    background: var(--sky-blue-hover);
    transform: scale(1.05);
}

.send-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

/* Stop Generating Button (inside input) */
.stop-btn {
    display: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fee2e2;
    border: none;
    color: #dc2626;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.stop-btn.visible {
    display: flex;
}

.stop-btn:hover {
    background: #fecaca;
    transform: scale(1.05);
}

.stop-btn svg {
    width: 16px;
    height: 16px;
}

body.dark-mode .stop-btn {
    background: rgba(220, 38, 38, 0.2);
    color: #f87171;
}

body.dark-mode .stop-btn:hover {
    background: rgba(220, 38, 38, 0.3);
}

/* Voice Input Modal - ChatGPT Style */
.voice-modal {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: auto;
    min-width: 320px;
    max-width: 500px;
}

.voice-modal.hidden {
    display: none;
}

.voice-modal-content {
    background: #2f2f2f;
    border-radius: 24px;
    padding: 24px 32px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.close-voice-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    width: 32px;
    height: 32px;
}

.close-voice-btn svg {
    width: 18px;
    height: 18px;
}

.close-voice-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.voice-status {
    color: white;
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 16px;
    text-align: center;
}

.waveform-container {
    width: 100%;
    padding: 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
    margin-bottom: 16px;
}

.waveform-canvas {
    width: 100%;
    height: 48px;
    background: transparent;
    display: block;
}

.voice-text {
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
    min-height: 20px;
    line-height: 1.4;
    max-width: 100%;
    word-wrap: break-word;
}

.voice-text:not(:empty) {
    margin-bottom: 16px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    color: #e5e7eb;
}

.stop-voice-btn {
    width: 48px;
    height: 48px;
    padding: 0;
    background: white;
    color: #2f2f2f;
    border: none;
    border-radius: 50%;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 8px;
}

.stop-voice-btn svg {
    width: 20px;
    height: 20px;
}

.stop-voice-btn:hover {
    background: #e5e7eb;
    transform: scale(1.05);
}

.input-footer {
    max-width: 48rem;
    margin: 12px auto 0;
    text-align: center;
    font-size: 12px;
    color: #9ca3af;
}

/* Scrollbar */
.messages-container::-webkit-scrollbar {
    width: 8px;
}

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

.messages-container::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Dark Mode Support */
body.dark-mode {
    background: #1f1f1f;
}

body.dark-mode .sidebar {
    background: linear-gradient(180deg, var(--midnight-navy) 0%, var(--midnight-navy-light) 100%);
    border-right-color: var(--midnight-navy-light);
}

body.dark-mode .new-chat-btn {
    background: var(--sky-blue);
    border-color: var(--sky-blue);
    color: #ffffff;
}

body.dark-mode .new-chat-btn:hover {
    background: var(--sky-blue-hover);
    border-color: var(--sky-blue-hover);
    color: #ffffff;
}

body.dark-mode .user-section {
    border-top-color: var(--midnight-navy-light);
}

body.dark-mode .main-content {
    background: #343541;
}

body.dark-mode .top-header {
    background: #343541;
    border-bottom-color: #3e3f4b;
}

body.dark-mode .sidebar-toggle:hover,
body.dark-mode .theme-toggle:hover {
    background: #40414f;
}

body.dark-mode .messages-container {
    background: #343541;
}

body.dark-mode .welcome-title {
    color: #e5e5e5;
}

body.dark-mode .message-role,
body.dark-mode .message-content {
    color: #e5e5e5;
}

body.dark-mode .message-content h1,
body.dark-mode .message-content h2,
body.dark-mode .message-content h3,
body.dark-mode .message-content h4 {
    color: #e5e5e5;
}

body.dark-mode .message-content code {
    background: #2a2b32;
    color: #e5e5e5;
}

body.dark-mode .input-wrapper {
    background: #343541;
    border-top-color: #3e3f4b;
}

body.dark-mode .input-container-modern {
    background: #40414f;
    border-color: #565869;
}

body.dark-mode .message-input {
    color: #e5e5e5;
}

body.dark-mode .theme-toggle {
    color: #9ca3af;
}

body.dark-mode .voice-modal-content {
    background: #40414f;
    border-color: #565869;
}

body.dark-mode .voice-header h3 {
    color: #e5e5e5;
}

body.dark-mode .waveform-canvas {
    background: #2a2b32;
}

body.dark-mode .voice-text {
    background: #2a2b32;
    color: #9ca3af;
}

body.dark-mode .voice-btn:hover {
    background: #40414f;
    color: var(--sky-blue);
}

body.dark-mode .chart-container {
    background: #2a2b32;
    border-color: #3e3f4b;
}

body.dark-mode .chart-title {
    color: #e5e5e5;
}

/* File Upload Styles */
.upload-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    margin-bottom: 0;
    align-self: center;
}

.upload-btn:hover {
    background: #f3f4f6;
    color: var(--sky-blue);
}

body.dark-mode .upload-btn {
    color: #9ca3af;
}

body.dark-mode .upload-btn:hover {
    background: #40414f;
    color: var(--sky-blue);
}

/* Drag and Drop Overlay */
.drop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(52, 128, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fadeIn 0.2s ease-out;
}

.drop-overlay.hidden {
    display: none;
}

.drop-content {
    text-align: center;
    color: white;
}

.drop-content svg {
    margin: 0 auto 16px;
}

.drop-content h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.drop-content p {
    font-size: 14px;
    opacity: 0.9;
}

/* Upload Toast */
.upload-toast {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    animation: slideUp 0.3s ease-out;
}

.upload-toast.hidden {
    display: none;
}

.upload-toast {
    transition: opacity 0.3s ease, transform 0.3s ease, bottom 0.3s ease;
}

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

.upload-toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--midnight-navy);
    color: white;
    padding: 12px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.upload-toast.success .upload-toast-content {
    background: #059669;
}

.upload-toast.error .upload-toast-content {
    background: #dc2626;
}

.upload-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-icon svg {
    width: 20px;
    height: 20px;
}

.upload-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.upload-filename {
    font-weight: 600;
    font-size: 14px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-status {
    font-size: 12px;
    opacity: 0.9;
}

/* Animate spin for upload icon */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Upload Progress Bar */
.upload-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}

.upload-progress-fill {
    height: 100%;
    background: #60a5fa;
    border-radius: 2px;
    transition: width 0.15s ease-out;
}

.upload-toast.success .upload-progress-bar {
    display: none;
}

.upload-toast.error .upload-progress-bar {
    display: none;
}

/* ChatGPT-style File Attachment Block */
.file-attachment-block {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f7f7f8;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 12px 16px;
    max-width: 400px;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.file-attachment-block:hover {
    background: #ececec;
    border-color: #d5d5d5;
}

body.dark-mode .file-attachment-block {
    background: #2d2d30;
    border-color: #404040;
}

body.dark-mode .file-attachment-block:hover {
    background: #3a3a3d;
    border-color: #505050;
}

.file-attachment-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: var(--midnight-navy, #063C71);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.file-attachment-icon svg {
    width: 22px;
    height: 22px;
}

.file-attachment-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.file-attachment-name {
    font-weight: 600;
    font-size: 14px;
    color: #1f1f1f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.dark-mode .file-attachment-name {
    color: #e5e5e5;
}

.file-attachment-meta {
    font-size: 12px;
    color: #6b7280;
}

body.dark-mode .file-attachment-meta {
    color: #9ca3af;
}

.file-attachment-status {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    background: #10b981;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.file-attachment-status svg {
    width: 14px;
    height: 14px;
}

.file-attachment-summary {
    margin-top: 8px;
    padding: 10px 14px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    font-size: 13px;
    color: #1e3a5f;
    line-height: 1.5;
    max-width: 400px;
}

body.dark-mode .file-attachment-summary {
    background: #1e3a5f;
    border-color: #2563eb;
    color: #e0f2fe;
}

/* Saved File Card (OneDrive files created by assistant) */
.saved-file-card {
    margin-top: 16px;
    max-width: 400px;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    overflow: hidden;
    background: #f7f7f8;
}

body.dark-mode .saved-file-card {
    background: #2d2d30;
    border-color: #404040;
}

.saved-file-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #0078d4 0%, #106ebe 100%);
    color: white;
    font-size: 12px;
    font-weight: 500;
}

.saved-file-header .onedrive-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.saved-file-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.saved-file-content:hover {
    background: #ececec;
}

body.dark-mode .saved-file-content:hover {
    background: #3a3a3d;
}

.saved-file-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: var(--midnight-navy, #063C71);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.saved-file-icon svg {
    width: 20px;
    height: 20px;
}

.saved-file-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.saved-file-name {
    font-weight: 600;
    font-size: 14px;
    color: #1f1f1f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.dark-mode .saved-file-name {
    color: #e5e5e5;
}

.saved-file-meta {
    font-size: 12px;
    color: #6b7280;
}

body.dark-mode .saved-file-meta {
    color: #9ca3af;
}

.saved-file-action {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
}

.saved-file-action svg {
    width: 16px;
    height: 16px;
}

body.dark-mode .saved-file-action {
    color: #9ca3af;
}

/* Document Viewer Modal */
.doc-viewer-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    padding: 20px;
}

.doc-viewer-modal.hidden {
    display: none;
}

.doc-viewer-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 1000px;
    height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

body.dark-mode .doc-viewer-content {
    background: #2d2d30;
}

.doc-viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

body.dark-mode .doc-viewer-header {
    border-bottom-color: #404040;
}

.doc-viewer-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f1f1f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}

body.dark-mode .doc-viewer-header h2 {
    color: #e5e5e5;
}

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

.doc-viewer-btn {
    background: transparent;
    border: none;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    color: #6b7280;
    transition: background-color 0.15s, color 0.15s;
}

.doc-viewer-btn:hover {
    background: #f3f4f6;
    color: #1f1f1f;
}

body.dark-mode .doc-viewer-btn {
    color: #9ca3af;
}

body.dark-mode .doc-viewer-btn:hover {
    background: #3a3a3d;
    color: #e5e5e5;
}

.doc-viewer-btn svg {
    width: 20px;
    height: 20px;
}

.doc-viewer-body {
    flex: 1;
    overflow: auto;
    min-height: 400px;
}

.doc-viewer-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    height: 100%;
    min-height: 400px;
    color: #6b7280;
}

body.dark-mode .doc-viewer-loading {
    color: #9ca3af;
}

.doc-viewer-loading svg {
    color: var(--midnight-navy, #063C71);
}

body.dark-mode .doc-viewer-loading svg {
    color: #60a5fa;
}

.doc-viewer-iframe {
    width: 100%;
    height: 100%;
    min-height: 500px;
    border: none;
}

.doc-viewer-image {
    max-width: 100%;
    max-height: 80vh;
    display: block;
    margin: 20px auto;
}

.doc-viewer-text {
    padding: 20px;
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #1f1f1f;
    background: #f9fafb;
    overflow: auto;
    max-height: 70vh;
}

body.dark-mode .doc-viewer-text {
    background: #1e1e1e;
    color: #e5e5e5;
}

.doc-viewer-unsupported,
.doc-viewer-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 60px 20px;
    text-align: center;
    color: #6b7280;
}

body.dark-mode .doc-viewer-unsupported,
body.dark-mode .doc-viewer-error {
    color: #9ca3af;
}

.doc-viewer-unsupported svg,
.doc-viewer-error svg {
    color: #9ca3af;
}

.doc-viewer-unsupported p,
.doc-viewer-error p {
    margin: 0;
    font-size: 16px;
    color: #1f1f1f;
}

body.dark-mode .doc-viewer-unsupported p,
body.dark-mode .doc-viewer-error p {
    color: #e5e5e5;
}

.doc-viewer-error span {
    font-size: 13px;
    color: #dc2626;
}

.doc-viewer-download-btn {
    background: var(--midnight-navy, #063C71);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s;
}

.doc-viewer-download-btn:hover {
    background: #0a5080;
}

/* Main content needs relative positioning for overlay */
.main-content {
    position: relative;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 50;
        transform: translateX(-100%);
    }

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

    .messages-wrapper {
        padding: 16px 12px;
    }

    .message-content {
        padding-left: 0;
    }

    .message-header {
        margin-bottom: 8px;
    }

    .welcome-title {
        font-size: 24px;
    }

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

    .input-wrapper {
        padding: 16px 12px;
    }
}

/* ============================================
   Documents Modal
   ============================================ */

.docs-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}

.docs-modal.hidden {
    display: none;
}

.docs-modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 800px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.dark-mode .docs-modal-content {
    background: #2a2b32;
}

.docs-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.dark-mode .docs-modal-header {
    border-bottom-color: #3e3f4b;
}

.docs-modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.dark-mode .docs-modal-header h2 {
    color: #e5e5e5;
}

.close-docs-btn {
    padding: 4px;
    border-radius: 6px;
    color: #6b7280;
    transition: all 0.15s ease;
}

.close-docs-btn:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.dark-mode .close-docs-btn:hover {
    background: #3e3f4b;
    color: #e5e5e5;
}

.docs-modal-toolbar {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.dark-mode .docs-modal-toolbar {
    border-bottom-color: #3e3f4b;
}

.docs-toolbar-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    background: #f3f4f6;
    color: #374151;
    transition: all 0.15s ease;
}

.docs-toolbar-btn:hover:not(:disabled) {
    background: #e5e7eb;
}

.docs-toolbar-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.dark-mode .docs-toolbar-btn {
    background: #3e3f4b;
    color: #e5e5e5;
}

.dark-mode .docs-toolbar-btn:hover:not(:disabled) {
    background: #4e4f5b;
}

.docs-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.docs-loading {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

.docs-empty {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

.doc-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid #e5e7eb;
    transition: all 0.15s ease;
}

.doc-item:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.dark-mode .doc-item {
    border-color: #3e3f4b;
}

.dark-mode .doc-item:hover {
    background: #343541;
    border-color: #4e4f5b;
}

.doc-checkbox {
    margin-top: 4px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.doc-info {
    flex: 1;
    min-width: 0;
}

.doc-title {
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dark-mode .doc-title {
    color: #e5e5e5;
}

.doc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: #6b7280;
}

.doc-status {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.doc-status.approved {
    background: #dcfce7;
    color: #166534;
}

.doc-status.pending, .doc-status.awaiting_consent {
    background: #fef3c7;
    color: #92400e;
}

.doc-status.processing {
    background: #dbeafe;
    color: #1e40af;
}

.doc-status.error {
    background: #fee2e2;
    color: #991b1b;
}

.dark-mode .doc-status.approved {
    background: #166534;
    color: #dcfce7;
}

.dark-mode .doc-status.pending, .dark-mode .doc-status.awaiting_consent {
    background: #92400e;
    color: #fef3c7;
}

.dark-mode .doc-status.processing {
    background: #1e40af;
    color: #dbeafe;
}

.dark-mode .doc-status.error {
    background: #991b1b;
    color: #fee2e2;
}

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

.doc-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    background: #f3f4f6;
    color: #374151;
    transition: all 0.15s ease;
}

.doc-action-btn:hover {
    background: #e5e7eb;
}

.doc-action-btn.reprocess {
    background: #3c97c6;
    color: white;
}

.doc-action-btn.reprocess:hover {
    background: #2d7ba3;
}

.doc-action-btn.reprocess:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.doc-action-btn.reprocess.processing {
    background: #6b7280;
}

.doc-action-btn.delete {
    background: #dc2626;
    color: white;
}

.doc-action-btn.delete:hover {
    background: #b91c1c;
}

.doc-action-btn.open {
    background: #0078d4;
    color: white;
    text-decoration: none;
}

.doc-action-btn.open:hover {
    background: #106ebe;
}

.doc-action-btn.disabled {
    background: #9ca3af;
    color: #f3f4f6;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Source badges for document types */
.doc-source-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.doc-source-badge.source-onedrive {
    background: #0078d4;
    color: white;
}

.doc-source-badge.source-rag {
    background: #059669;
    color: white;
}

.doc-checkbox-placeholder {
    width: 18px;
    height: 18px;
}

.doc-action-btn.delete:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.doc-action-btn.delete.processing {
    background: #6b7280;
}

.doc-action-btn.delete.confirming {
    background: #f59e0b;
    animation: pulse-warning 1s ease-in-out infinite;
}

@keyframes pulse-warning {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.doc-action-btn.cancel-delete {
    background: #6b7280;
    color: white;
}

.doc-action-btn.cancel-delete:hover {
    background: #4b5563;
}

.dark-mode .doc-action-btn.delete.confirming {
    background: #d97706;
}

.dark-mode .doc-action-btn.cancel-delete {
    background: #4b5563;
}

.dark-mode .doc-action-btn.cancel-delete:hover {
    background: #374151;
}

.dark-mode .doc-action-btn.delete {
    background: #991b1b;
}

.dark-mode .doc-action-btn.delete:hover {
    background: #7f1d1d;
}

.dark-mode .doc-action-btn {
    background: #3e3f4b;
    color: #e5e5e5;
}

.dark-mode .doc-action-btn:hover {
    background: #4e4f5b;
}

@media (max-width: 640px) {
    .docs-modal-content {
        max-height: 90vh;
    }

    .doc-item {
        flex-direction: column;
    }

    .doc-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* ===================================
   Confirmation Toast (Non-Modal)
   =================================== */
.confirm-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    z-index: 9999;
    opacity: 0;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    pointer-events: none;
}

.confirm-toast.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.confirm-toast-content {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: #1f2937;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    border: 1px solid #374151;
    pointer-events: auto;
}

.confirm-toast-message {
    color: #f3f4f6;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.confirm-toast-actions {
    display: flex;
    gap: 8px;
    pointer-events: auto;
}

.confirm-toast-btn {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background 0.2s, transform 0.1s;
    pointer-events: auto;
    position: relative;
    z-index: 10;
}

.confirm-toast-btn:active {
    transform: scale(0.97);
}

.confirm-toast-btn-danger {
    background: #dc2626;
    color: white;
}

.confirm-toast-btn-danger:hover {
    background: #b91c1c;
}

.confirm-toast-btn-cancel {
    background: #4b5563;
    color: #f3f4f6;
}

.confirm-toast-btn-cancel:hover {
    background: #6b7280;
}

/* Light mode adjustments */
.confirm-toast-content {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.confirm-toast-message {
    color: #1f2937;
}

.confirm-toast-btn-cancel {
    background: #e5e7eb;
    color: #374151;
}

.confirm-toast-btn-cancel:hover {
    background: #d1d5db;
}

/* Dark mode */
.dark-mode .confirm-toast-content {
    background: #1f2937;
    border: 1px solid #374151;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.dark-mode .confirm-toast-message {
    color: #f3f4f6;
}

.dark-mode .confirm-toast-btn-cancel {
    background: #4b5563;
    color: #f3f4f6;
}

.dark-mode .confirm-toast-btn-cancel:hover {
    background: #6b7280;
}

/* ===================================
   SharePoint Connection Indicator
   =================================== */

.sharepoint-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(156, 163, 175, 0.1);
    color: #9ca3af;
    margin-right: 8px;
    cursor: help;
    transition: all 0.3s ease;
}

.sharepoint-indicator svg {
    width: 14px;
    height: 14px;
}

/* Connected state */
.sharepoint-indicator.connected {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    animation: sharepoint-pulse 0.5s ease-out;
}

body.dark-mode .sharepoint-indicator {
    background: rgba(156, 163, 175, 0.15);
}

body.dark-mode .sharepoint-indicator.connected {
    background: rgba(16, 185, 129, 0.15);
}

@keyframes sharepoint-pulse {
    0% {
        transform: scale(0.8);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* User Menu Popup */
.user-section {
    position: relative;
}

.user-menu-trigger {
    transition: background-color 0.2s ease;
}

.user-menu-trigger:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

body.dark-mode .user-menu-trigger:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.user-popup-menu {
    position: absolute;
    bottom: 100%;
    left: 8px;
    right: 8px;
    margin-bottom: 8px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 8px;
    z-index: 100;
    animation: userMenuSlideUp 0.15s ease-out;
}

body.dark-mode .user-popup-menu {
    background: #1f2937;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

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

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    background: none;
    text-align: left;
    font-size: 14px;
    color: #374151;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    text-decoration: none;
}

.user-menu-item:hover {
    background-color: #f3f4f6;
}

body.dark-mode .user-menu-item {
    color: #e5e7eb;
}

body.dark-mode .user-menu-item:hover {
    background-color: #374151;
}

.user-menu-item.text-red-500 {
    color: #ef4444;
}

.user-menu-item.text-red-500:hover {
    background-color: #fef2f2;
}

body.dark-mode .user-menu-item.text-red-500:hover {
    background-color: rgba(239, 68, 68, 0.1);
}

.user-menu-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 8px 0;
}

body.dark-mode .user-menu-divider {
    background: #374151;
}

/* ===================================
   Prompt Enhancer
   =================================== */

/* Enhance Button (in input container) */
.enhance-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.enhance-btn:hover {
    background: #f3f4f6;
    color: var(--sky-blue);
}

.enhance-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

body.dark-mode .enhance-btn {
    color: #9ca3af;
}

body.dark-mode .enhance-btn:hover {
    background: #40414f;
    color: var(--sky-blue);
}

/* Enhance Modal */
.enhance-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}

.enhance-modal.hidden {
    display: none;
}

.enhance-modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

body.dark-mode .enhance-modal-content {
    background: #2a2b32;
}

.enhance-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

body.dark-mode .enhance-modal-header {
    border-bottom-color: #3e3f4b;
}

.enhance-modal-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.enhance-modal-header h2 svg {
    color: var(--sky-blue);
}

body.dark-mode .enhance-modal-header h2 {
    color: #e5e5e5;
}

.close-enhance-btn {
    padding: 4px;
    border-radius: 6px;
    color: #6b7280;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.close-enhance-btn:hover {
    background: #f3f4f6;
    color: #1f2937;
}

body.dark-mode .close-enhance-btn:hover {
    background: #3e3f4b;
    color: #e5e5e5;
}

/* Original prompt display */
.enhance-original {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

body.dark-mode .enhance-original {
    border-bottom-color: #3e3f4b;
}

.enhance-original label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

body.dark-mode .enhance-original label {
    color: #9ca3af;
}

.enhance-original-text {
    font-size: 14px;
    color: #374151;
    line-height: 1.5;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

body.dark-mode .enhance-original-text {
    background: #343541;
    border-color: #3e3f4b;
    color: #e5e5e5;
}

/* Suggestions container */
.enhance-suggestions {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.enhance-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 20px;
    color: #6b7280;
    font-size: 14px;
}

body.dark-mode .enhance-loading {
    color: #9ca3af;
}

.enhance-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top-color: var(--sky-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

body.dark-mode .enhance-spinner {
    border-color: #3e3f4b;
    border-top-color: var(--sky-blue);
}

/* Suggestion cards */
.enhance-suggestion {
    padding: 16px;
    margin-bottom: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.enhance-suggestion:last-child {
    margin-bottom: 0;
}

.enhance-suggestion:hover {
    border-color: var(--sky-blue);
    box-shadow: 0 4px 12px rgba(52, 128, 255, 0.15);
    transform: translateY(-1px);
}

body.dark-mode .enhance-suggestion {
    background: #343541;
    border-color: #3e3f4b;
}

body.dark-mode .enhance-suggestion:hover {
    border-color: var(--sky-blue);
    box-shadow: 0 4px 12px rgba(52, 128, 255, 0.25);
}

.enhance-suggestion-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.enhance-suggestion-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--sky-blue);
    color: white;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.enhance-suggestion-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--sky-blue);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.enhance-suggestion-text {
    font-size: 14px;
    color: #374151;
    line-height: 1.6;
}

body.dark-mode .enhance-suggestion-text {
    color: #e5e5e5;
}

.enhance-suggestion-use {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--sky-blue);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.enhance-suggestion:hover .enhance-suggestion-use {
    opacity: 1;
}

.enhance-suggestion-use svg {
    width: 14px;
    height: 14px;
}

/* Error state */
.enhance-error {
    text-align: center;
    padding: 40px 20px;
    color: #dc2626;
}

.enhance-error svg {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    opacity: 0.7;
}

.enhance-error p {
    margin: 0;
    font-size: 14px;
}

/* Modal footer */
.enhance-modal-footer {
    padding: 12px 20px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
}

body.dark-mode .enhance-modal-footer {
    border-top-color: #3e3f4b;
}

.enhance-cancel-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    background: #f3f4f6;
    border: none;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s ease;
}

.enhance-cancel-btn:hover {
    background: #e5e7eb;
}

body.dark-mode .enhance-cancel-btn {
    background: #3e3f4b;
    color: #e5e5e5;
}

body.dark-mode .enhance-cancel-btn:hover {
    background: #4e4f5b;
}

/* Responsive */
@media (max-width: 640px) {
    .enhance-modal-content {
        max-height: 90vh;
    }

    .enhance-suggestion {
        padding: 12px;
    }
}

/* ===================================
   Context Indicator
   =================================== */

.context-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--jet-grey);
    padding: 4px 8px;
    border-radius: 12px;
    transition: all 0.2s;
    margin-top: 8px;
    justify-content: center;
}

.context-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--jet-grey);
    transition: background 0.2s;
}

.context-indicator.warning .context-dot {
    background: #f59e0b;
}

.context-indicator.critical .context-dot {
    background: #ef4444;
    animation: pulse 1.5s infinite;
}

.context-indicator.warning .context-text {
    color: #f59e0b;
}

.context-indicator.critical .context-text {
    color: #ef4444;
}

body.dark-mode .context-indicator {
    color: #9ca3af;
}

/* Fork button */
.fork-btn {
    margin-left: 8px;
    padding: 2px 8px;
    font-size: 11px;
    background: var(--sky-blue);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.fork-btn:hover {
    background: var(--sky-blue-hover);
}

.fork-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===================================
   Memory Modal
   =================================== */

.memory-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
}

.memory-modal.hidden { display: none; }

.memory-modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

body.dark-mode .memory-modal-content {
    background: #2d2e36;
}

.memory-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

body.dark-mode .memory-modal-header {
    border-color: #3e3f4b;
}

.memory-modal-header h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

body.dark-mode .memory-modal-header h2 {
    color: #f3f4f6;
}

.close-memory-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #6b7280;
    border-radius: 6px;
    transition: background 0.2s;
}

.close-memory-btn:hover {
    background: #f3f4f6;
}

body.dark-mode .close-memory-btn:hover {
    background: #3e3f4b;
}

.memory-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 20px;
}

body.dark-mode .memory-tabs {
    border-color: #3e3f4b;
}

.memory-tab {
    padding: 12px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 14px;
    color: #6b7280;
    transition: all 0.2s;
}

.memory-tab:hover {
    color: #1f2937;
}

.memory-tab.active {
    color: var(--sky-blue);
    border-bottom-color: var(--sky-blue);
}

body.dark-mode .memory-tab {
    color: #9ca3af;
}

body.dark-mode .memory-tab:hover {
    color: #f3f4f6;
}

body.dark-mode .memory-tab.active {
    color: var(--sky-blue);
}

.memory-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.memory-loading {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.memory-empty {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.memory-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    background: #f9fafb;
}

body.dark-mode .memory-item {
    background: #3e3f4b;
}

.memory-category {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--sky-blue);
    color: white;
    white-space: nowrap;
}

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

.memory-text {
    font-size: 14px;
    color: #1f2937;
    line-height: 1.4;
}

body.dark-mode .memory-text {
    color: #f3f4f6;
}

.memory-meta {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
}

.memory-delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #9ca3af;
    opacity: 0;
    transition: all 0.2s;
}

.memory-item:hover .memory-delete-btn {
    opacity: 1;
}

.memory-delete-btn:hover {
    color: #ef4444;
}

/* ===================================
   Styled Tooltips for Input Buttons
   =================================== */

.tooltip-btn {
    position: relative;
}

.tooltip-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 10px;
    background: #1f2937;
    color: white;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 6px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s, visibility 0.15s;
    pointer-events: none;
    z-index: 100;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.tooltip-btn::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1f2937;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s, visibility 0.15s;
    pointer-events: none;
    z-index: 100;
}

.tooltip-btn:hover::after,
.tooltip-btn:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Dark mode adjustments */
body.dark-mode .tooltip-btn::after {
    background: #f3f4f6;
    color: #1f2937;
}

body.dark-mode .tooltip-btn::before {
    border-top-color: #f3f4f6;
}

/* ===================================
   What's New Toast & Modal
   =================================== */

/* Toast notification */
.whats-new-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.whats-new-toast.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.whats-new-toast.hidden {
    display: none;
}

.whats-new-toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #3480FF 0%, #2563eb 100%);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(52, 128, 255, 0.3);
    color: white;
}

.whats-new-toast-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
}

.whats-new-toast-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.whats-new-toast-title {
    font-size: 14px;
    font-weight: 600;
}

.whats-new-toast-link {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    text-align: left;
}

.whats-new-toast-link:hover {
    color: white;
}

.whats-new-toast-dismiss {
    flex-shrink: 0;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}

.whats-new-toast-dismiss:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* What's New Modal */
.whats-new-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.whats-new-modal.hidden {
    display: none;
}

.whats-new-modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modalSlideIn 0.3s ease;
}

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

body.dark-mode .whats-new-modal-content {
    background: #2d2e36;
}

.whats-new-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

body.dark-mode .whats-new-modal-header {
    border-color: #3e3f4b;
}

.whats-new-modal-header h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

body.dark-mode .whats-new-modal-header h2 {
    color: #f3f4f6;
}

.whats-new-modal-header h2 svg {
    color: var(--sky-blue);
}

.close-whats-new-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #6b7280;
    border-radius: 6px;
    transition: background 0.2s;
}

.close-whats-new-btn:hover {
    background: #f3f4f6;
}

body.dark-mode .close-whats-new-btn:hover {
    background: #3e3f4b;
}

.whats-new-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.whats-new-loading {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.whats-new-release {
    margin-bottom: 20px;
}

.whats-new-release:last-child {
    margin-bottom: 0;
}

.whats-new-release-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.whats-new-version {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    background: var(--sky-blue);
    color: white;
    border-radius: 10px;
}

.whats-new-date {
    font-size: 12px;
    color: #9ca3af;
}

.whats-new-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

body.dark-mode .whats-new-title {
    color: #f3f4f6;
}

.whats-new-highlights {
    list-style: none;
    padding: 0;
    margin: 0;
}

.whats-new-highlights li {
    position: relative;
    padding-left: 20px;
    font-size: 14px;
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 4px;
}

body.dark-mode .whats-new-highlights li {
    color: #d1d5db;
}

.whats-new-highlights li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 6px;
    height: 6px;
    background: var(--sky-blue);
    border-radius: 50%;
}

.whats-new-modal-footer {
    padding: 12px 20px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
}

body.dark-mode .whats-new-modal-footer {
    border-top-color: #3e3f4b;
}

.whats-new-got-it-btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    background: var(--sky-blue);
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.15s ease;
}

.whats-new-got-it-btn:hover {
    background: var(--sky-blue-hover);
}

/* Responsive */
@media (max-width: 640px) {
    .whats-new-toast {
        bottom: 16px;
        right: 16px;
        left: 16px;
    }

    .whats-new-modal-content {
        max-height: 90vh;
    }
}

/* ============================================
   Pending Chat Attachments (ChatGPT-style)
   ============================================ */

.pending-attachments-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
    border: 1px solid #e0e0e0;
    border-bottom: none;
    margin: 0 auto;
    max-width: 768px;
    width: 100%;
}

body.dark-mode .pending-attachments-container {
    background: #2a2a2a;
    border-color: #404040;
}

.pending-attachment {
    position: relative;
    display: inline-flex;
    align-items: center;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    /* overflow: visible to allow X button to extend outside bounds */
}

body.dark-mode .pending-attachment {
    background: #3a3a3a;
    border-color: #505050;
}

/* Image thumbnail preview */
.pending-attachment-preview {
    width: 60px;
    height: 60px;
    overflow: hidden;
}

.pending-attachment-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* File icon display */
.pending-attachment-file {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    max-width: 200px;
}

.pending-attachment-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.pending-attachment-icon svg {
    width: 100%;
    height: 100%;
    stroke: #666;
}

body.dark-mode .pending-attachment-icon svg {
    stroke: #aaa;
}

.pending-attachment-name {
    font-size: 12px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.dark-mode .pending-attachment-name {
    color: #ddd;
}

/* Remove button */
.pending-attachment-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ff4d4d;
    border: 2px solid white;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.pending-attachment:hover .pending-attachment-remove {
    opacity: 1;
}

.pending-attachment-remove svg {
    width: 12px;
    height: 12px;
    stroke: white;
}

.pending-attachment-remove:hover {
    background: #ff3333;
}

body.dark-mode .pending-attachment-remove {
    border-color: #2a2a2a;
}

/* Adjust input container when attachments present */
.pending-attachments-container + .input-container-modern {
    border-radius: 0 0 12px 12px;
    border-top: none;
}

/* ============================================
   Message Attachment Blocks (in conversation stream)
   ============================================ */

.message-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.message-attachment-block {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    max-width: 280px;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.message-attachment-block.clickable {
    cursor: pointer;
}

.message-attachment-block.clickable:hover {
    background: #eaeaea;
    border-color: #ccc;
}

body.dark-mode .message-attachment-block {
    background: #3a3a3a;
    border-color: #505050;
}

body.dark-mode .message-attachment-block.clickable:hover {
    background: #444;
    border-color: #666;
}

.message-attachment-thumbnail {
    width: 48px;
    height: 48px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}

.message-attachment-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message-attachment-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.message-attachment-icon svg {
    width: 100%;
    height: 100%;
    stroke: #666;
}

body.dark-mode .message-attachment-icon svg {
    stroke: #aaa;
}

.message-attachment-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.message-attachment-name {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.dark-mode .message-attachment-name {
    color: #e0e0e0;
}

.message-attachment-size {
    font-size: 11px;
    color: #888;
}

body.dark-mode .message-attachment-size {
    color: #999;
}

/* ============================================
   File Preview Modal
   ============================================ */

.file-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.file-preview-modal.visible {
    opacity: 1;
    visibility: visible;
}

.file-preview-container {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.file-preview-modal.visible .file-preview-container {
    transform: scale(1);
}

body.dark-mode .file-preview-container {
    background: #2a2a2a;
}

.file-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

body.dark-mode .file-preview-header {
    background: #333;
    border-color: #444;
}

.file-preview-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    margin-right: 16px;
}

body.dark-mode .file-preview-title {
    color: #e0e0e0;
}

.file-preview-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: background-color 0.15s ease;
}

.file-preview-close:hover {
    background: #e0e0e0;
}

body.dark-mode .file-preview-close {
    color: #aaa;
}

body.dark-mode .file-preview-close:hover {
    background: #444;
}

.file-preview-close svg {
    width: 20px;
    height: 20px;
}

.file-preview-content {
    flex: 1;
    overflow: auto;
    padding: 20px;
    min-height: 300px;
    max-height: calc(90vh - 120px);
}

.file-preview-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #888;
    font-size: 14px;
}

.file-preview-image {
    max-width: 100%;
    max-height: calc(90vh - 160px);
    display: block;
    margin: 0 auto;
    border-radius: 4px;
}

.file-preview-pdf {
    width: 100%;
    height: calc(90vh - 160px);
    border: none;
    border-radius: 4px;
}

.file-preview-text,
.file-preview-code {
    margin: 0;
    padding: 16px;
    background: #f5f5f5;
    border-radius: 8px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
    color: #333;
}

body.dark-mode .file-preview-text,
body.dark-mode .file-preview-code {
    background: #1e1e1e;
    color: #d4d4d4;
}

.file-preview-code code {
    background: transparent;
    padding: 0;
}

.file-preview-error {
    text-align: center;
    padding: 40px;
    color: #666;
}

.file-preview-error p {
    margin-bottom: 16px;
}

.file-preview-error a {
    color: var(--primary-color);
    text-decoration: none;
}

.file-preview-error a:hover {
    text-decoration: underline;
}

.file-preview-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 12px 20px;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
}

body.dark-mode .file-preview-footer {
    background: #333;
    border-color: #444;
}

.file-preview-download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: background-color 0.15s ease;
}

.file-preview-download:hover {
    background: var(--primary-color-dark);
    color: white;
    text-decoration: none;
}

/* ============================================
   Conversation Sharing
   ============================================ */

/* Section label for sidebar */
.section-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--jet-grey);
    padding: 12px 12px 6px;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Conversation Tabs */
.conversation-tabs {
    display: flex;
    gap: 4px;
    padding: 0 12px;
    margin-bottom: 8px;
}

.conversation-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--cloud-white);
    background: transparent;
    border: 1px solid var(--midnight-navy-light);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    opacity: 0.7;
}

.conversation-tab:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.05);
}

.conversation-tab.active {
    opacity: 1;
    background: var(--midnight-navy-light);
    border-color: var(--sky-blue);
}

/* Tab badge (shared count) */
.tab-badge {
    font-size: 10px;
    font-weight: 600;
    background: var(--sky-blue);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.tab-badge.hidden {
    display: none;
}

/* Tab content panels */
.tab-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tab-panel {
    flex: 1;
    overflow-y: auto;
}

.tab-panel.hidden {
    display: none;
}

/* Shared conversation item styling */
.shared-conversation-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    color: var(--jet-grey);
    font-size: 14px;
}

.shared-conversation-item:hover {
    background-color: var(--midnight-navy-light);
}

.shared-conversation-item.active {
    background-color: var(--sky-blue);
    color: white;
}

.shared-conversation-item .shared-icon {
    flex-shrink: 0;
    color: var(--icy-cyan);
}

.shared-conversation-item.active .shared-icon {
    color: white;
}

.shared-owner {
    font-size: 10px;
    color: var(--jet-grey);
    opacity: 0.7;
    margin-left: auto;
    white-space: nowrap;
}

.shared-conversation-item.active .shared-owner {
    color: white;
    opacity: 0.8;
}

/* Header title container with share button */
.header-title-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Share button in header */
.share-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.share-btn:hover {
    background: #f3f4f6;
    color: var(--sky-blue);
}

.share-btn.hidden {
    display: none;
}

body.dark-mode .share-btn {
    color: #9ca3af;
}

body.dark-mode .share-btn:hover {
    background: #3e3f4b;
    color: var(--sky-blue);
}

/* Share Modal */
.share-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
}

.share-modal.hidden {
    display: none;
}

.share-modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

body.dark-mode .share-modal-content {
    background: #2d2e36;
}

.share-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

body.dark-mode .share-modal-header {
    border-color: #3e3f4b;
}

.share-modal-header h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

body.dark-mode .share-modal-header h2 {
    color: #f3f4f6;
}

.close-share-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #6b7280;
    border-radius: 6px;
    transition: background 0.2s;
}

.close-share-btn:hover {
    background: #f3f4f6;
}

body.dark-mode .close-share-btn:hover {
    background: #3e3f4b;
}

.share-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

/* Share tabs */
.share-tab {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.share-tab:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

body.dark-mode .share-tab {
    border-color: #3e3f4b;
}

.share-tab h3 {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
}

body.dark-mode .share-tab h3 {
    color: #e5e5e5;
}

/* Share form */
.share-form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.share-input {
    flex: 1;
    min-width: 180px;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: #1f2937;
    background: white;
    outline: none;
    transition: border-color 0.2s;
}

.share-input:focus {
    border-color: var(--sky-blue);
}

body.dark-mode .share-input {
    background: #3e3f4b;
    border-color: #565869;
    color: #f3f4f6;
}

/* User autocomplete for share dialog */
.share-input-wrapper {
    position: relative;
    flex: 1;
    min-width: 180px;
}

.share-input-wrapper .share-input {
    width: 100%;
    min-width: unset;
}

.user-autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1001;
    background: white;
    border: 1px solid #d1d5db;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 240px;
    overflow-y: auto;
}

.user-autocomplete.hidden {
    display: none;
}

body.dark-mode .user-autocomplete {
    background: #3e3f4b;
    border-color: #565869;
}

.autocomplete-item {
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-bottom: 1px solid #f3f4f6;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background: #f0f9ff;
}

body.dark-mode .autocomplete-item {
    border-color: #565869;
}

body.dark-mode .autocomplete-item:hover,
body.dark-mode .autocomplete-item.selected {
    background: #4a4b5a;
}

.autocomplete-name {
    font-weight: 500;
    color: #1f2937;
    font-size: 14px;
}

body.dark-mode .autocomplete-name {
    color: #f3f4f6;
}

.autocomplete-email {
    font-size: 12px;
    color: #6b7280;
}

body.dark-mode .autocomplete-email {
    color: #9ca3af;
}

.autocomplete-job {
    font-size: 11px;
    color: #9ca3af;
}

body.dark-mode .autocomplete-job {
    color: #6b7280;
}

.autocomplete-loading,
.autocomplete-empty {
    padding: 12px;
    text-align: center;
    color: #6b7280;
    font-size: 13px;
}

body.dark-mode .autocomplete-loading,
body.dark-mode .autocomplete-empty {
    color: #9ca3af;
}

.share-select {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: #1f2937;
    background: white;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.share-select:focus {
    border-color: var(--sky-blue);
}

body.dark-mode .share-select {
    background: #3e3f4b;
    border-color: #565869;
    color: #f3f4f6;
}

.share-submit-btn {
    padding: 10px 20px;
    background: var(--sky-blue);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.share-submit-btn:hover {
    background: var(--sky-blue-hover);
}

.share-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Share link form */
.share-link-form {
    display: flex;
    gap: 8px;
}

.share-link-btn {
    padding: 10px 20px;
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.share-link-btn:hover {
    background: #e5e7eb;
}

body.dark-mode .share-link-btn {
    background: #3e3f4b;
    color: #e5e5e5;
    border-color: #565869;
}

body.dark-mode .share-link-btn:hover {
    background: #4a4b55;
}

/* Share link result */
.share-link-result {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.share-link-result.hidden {
    display: none;
}

.share-link-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    color: #1f2937;
    background: #f9fafb;
    outline: none;
}

body.dark-mode .share-link-input {
    background: #3e3f4b;
    border-color: #565869;
    color: #f3f4f6;
}

.copy-link-btn {
    padding: 10px 12px;
    background: var(--sky-blue);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-link-btn:hover {
    background: var(--sky-blue-hover);
}

.copy-link-btn.copied {
    background: #10b981;
}

/* Current shares section */
.current-shares h3 {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
}

body.dark-mode .current-shares h3 {
    color: #e5e5e5;
}

.shares-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shares-loading {
    text-align: center;
    padding: 20px;
    color: #6b7280;
    font-size: 14px;
}

.shares-empty {
    text-align: center;
    padding: 20px;
    color: #9ca3af;
    font-size: 14px;
}

.share-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
}

body.dark-mode .share-item {
    background: #3e3f4b;
}

.share-item-info {
    flex: 1;
    min-width: 0;
}

.share-item-email {
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.dark-mode .share-item-email {
    color: #f3f4f6;
}

.share-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.share-item-permission {
    font-size: 11px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
    background: #e5e7eb;
    color: #6b7280;
}

body.dark-mode .share-item-permission {
    background: #565869;
    color: #d1d5db;
}

.share-item-date {
    font-size: 11px;
    color: #9ca3af;
}

.share-item-type {
    font-size: 10px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--icy-cyan);
    color: var(--midnight-navy);
}

.revoke-share-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: #9ca3af;
    border-radius: 6px;
    transition: all 0.2s;
}

.revoke-share-btn:hover {
    background: #fee2e2;
    color: #ef4444;
}

body.dark-mode .revoke-share-btn:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Read-only indicator for shared conversations */
.read-only-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #fef3c7;
    color: #92400e;
    font-size: 13px;
    border-bottom: 1px solid #fcd34d;
}

body.dark-mode .read-only-indicator {
    background: #78350f;
    color: #fef3c7;
    border-color: #92400e;
}

.read-only-indicator svg {
    flex-shrink: 0;
}

.read-only-indicator .fork-shared-btn {
    margin-left: auto;
    padding: 4px 12px;
    background: var(--sky-blue);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.read-only-indicator .fork-shared-btn:hover {
    background: var(--sky-blue-hover);
}

/* Responsive */
@media (max-width: 640px) {
    .share-modal-content {
        max-height: 90vh;
    }

    .share-form {
        flex-direction: column;
    }

    .share-input {
        min-width: 100%;
    }
}

/* SharePoint Connection Modal */
.sharepoint-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
}

.sharepoint-modal.hidden {
    display: none;
}

.sharepoint-modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

body.dark-mode .sharepoint-modal-content {
    background: #2d2e36;
}

.sharepoint-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

body.dark-mode .sharepoint-modal-header {
    border-color: #3e3f4b;
}

.sharepoint-modal-header h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

body.dark-mode .sharepoint-modal-header h2 {
    color: #f3f4f6;
}

.sharepoint-modal-header h2 svg {
    width: 20px;
    height: 20px;
    color: var(--sky-blue);
}

.close-sharepoint-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #6b7280;
    border-radius: 6px;
    transition: background 0.2s;
}

.close-sharepoint-btn:hover {
    background: #f3f4f6;
}

body.dark-mode .close-sharepoint-btn:hover {
    background: #3e3f4b;
}

.sharepoint-modal-body {
    padding: 20px;
}

.sharepoint-modal-body p {
    color: #4b5563;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 12px;
}

body.dark-mode .sharepoint-modal-body p {
    color: #9ca3af;
}

.sharepoint-modal-body .sharepoint-note {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 0;
}

body.dark-mode .sharepoint-modal-body .sharepoint-note {
    color: #6b7280;
}

.sharepoint-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
}

body.dark-mode .sharepoint-modal-footer {
    border-color: #3e3f4b;
}

.sharepoint-skip-btn {
    padding: 10px 20px;
    background: transparent;
    color: #6b7280;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.sharepoint-skip-btn:hover {
    background: #f3f4f6;
}

body.dark-mode .sharepoint-skip-btn {
    border-color: #4b5563;
    color: #9ca3af;
}

body.dark-mode .sharepoint-skip-btn:hover {
    background: #3e3f4b;
}

.sharepoint-connect-btn {
    padding: 10px 24px;
    background: var(--sky-blue);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.sharepoint-connect-btn:hover {
    background: var(--sky-blue-hover);
}

/* ============================================
   Feedback Styles
   ============================================ */

/* Message feedback container - shown on hover */
.message-feedback {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.message-group:hover .message-feedback {
    opacity: 1;
}

/* Base feedback button style */
.feedback-btn {
    background: none;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #6b7280;
    transition: all 0.15s ease;
}

.feedback-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.feedback-btn svg {
    width: 14px;
    height: 14px;
}

/* Active states */
.feedback-btn.active.positive {
    background: #dcfce7;
    border-color: #22c55e;
    color: #16a34a;
}

.feedback-btn.active.negative {
    background: #fee2e2;
    border-color: #ef4444;
    color: #dc2626;
}

/* Dark mode feedback buttons */
body.dark-mode .feedback-btn {
    border-color: #4b5563;
    color: #9ca3af;
}

body.dark-mode .feedback-btn:hover {
    background: #374151;
    border-color: #6b7280;
}

body.dark-mode .feedback-btn.active.positive {
    background: rgba(34, 197, 94, 0.2);
    border-color: #22c55e;
    color: #4ade80;
}

body.dark-mode .feedback-btn.active.negative {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #f87171;
}

/* Feedback dropdown modal */
.feedback-dropdown {
    position: fixed;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.3);
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

.feedback-dropdown.hidden {
    display: none;
}

.feedback-dropdown-content {
    background: white;
    border-radius: 12px;
    padding: 20px;
    max-width: 360px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.2s ease-out;
}

.feedback-dropdown-content h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 16px;
}

/* Feedback option buttons */
.feedback-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.feedback-option {
    padding: 12px 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
}

.feedback-option:hover {
    background: var(--sky-blue);
    border-color: var(--sky-blue);
    color: white;
}

/* Feedback other input */
.feedback-other-input {
    margin-top: 12px;
    animation: fadeIn 0.2s ease-out;
}

.feedback-other-input.hidden {
    display: none;
}

.feedback-other-input textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    outline: none;
    transition: border-color 0.15s ease;
}

.feedback-other-input textarea:focus {
    border-color: var(--sky-blue);
}

.feedback-other-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}

.feedback-btn-cancel {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s ease;
}

.feedback-btn-cancel:hover {
    background: #f3f4f6;
}

.feedback-btn-submit {
    padding: 8px 16px;
    background: var(--sky-blue);
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: white;
    cursor: pointer;
    transition: background 0.15s ease;
}

.feedback-btn-submit:hover {
    background: var(--sky-blue-hover);
}

/* Dark mode feedback dropdown */
body.dark-mode .feedback-dropdown-content {
    background: #2a2b32;
}

body.dark-mode .feedback-dropdown-content h3 {
    color: #e5e5e5;
}

body.dark-mode .feedback-option {
    background: #40414f;
    border-color: #565869;
    color: #e5e5e5;
}

body.dark-mode .feedback-option:hover {
    background: var(--sky-blue);
    border-color: var(--sky-blue);
    color: white;
}

body.dark-mode .feedback-other-input textarea {
    background: #40414f;
    border-color: #565869;
    color: #e5e5e5;
}

body.dark-mode .feedback-other-input textarea:focus {
    border-color: var(--sky-blue);
}

body.dark-mode .feedback-btn-cancel {
    border-color: #4b5563;
    color: #9ca3af;
}

body.dark-mode .feedback-btn-cancel:hover {
    background: #374151;
}

/* ============================================
   Export Button Styles
   ============================================ */

.export-btn {
    background: none;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 4px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.15s ease;
    margin-left: 8px;
}

.export-btn:hover {
    background: var(--sky-blue);
    border-color: var(--sky-blue);
    color: white;
}

.export-btn svg {
    width: 14px;
    height: 14px;
}

body.dark-mode .export-btn {
    border-color: #4b5563;
    color: #9ca3af;
}

body.dark-mode .export-btn:hover {
    background: var(--sky-blue);
    border-color: var(--sky-blue);
    color: white;
}

/* Toast notification for feedback success */
.feedback-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 1001;
    animation: slideUp 0.3s ease-out, fadeOut 0.3s ease-in 2.7s forwards;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

body.dark-mode .feedback-toast {
    background: #4b5563;
}

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