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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f7f8fc;
    height: 100vh;
    overflow: hidden;
}

/* App Container */
.app-container {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: #ffffff;
    border-right: 1px solid #e1e5e9;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    z-index: 1000;
    flex-shrink: 0;
}

.sidebar.collapsed {
    width: 0;
    overflow: hidden;
    border-right: none;
}

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

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

.logo i {
    font-size: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo h2 {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #666;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.sidebar-toggle:hover {
    background: #f0f0f0;
    color: #333;
}

.sidebar-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.new-chat-btn {
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 24px;
}

.new-chat-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

.chat-history h3 {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.history-list {
    flex: 1;
    overflow-y: auto;
}

.history-item {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 4px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.history-item:hover {
    background: #f5f7fa;
    border-left-color: #667eea;
}

.history-item.active {
    background: #f0f3ff;
    border-left-color: #667eea;
}

.history-item-content {
    flex: 1;
    min-width: 0;
}

.history-item-title {
    font-weight: 500;
    color: #333;
    font-size: 14px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item-time {
    font-size: 12px;
    color: #888;
}

.history-item-actions {
    opacity: 0;
    transition: opacity 0.2s ease;
    margin-left: 8px;
}

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

.delete-chat-btn {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 12px;
}

.delete-chat-btn:hover {
    background: #fef2f2;
    color: #dc2626;
}

.sidebar-footer {
    border-top: 1px solid #e1e5e9;
    padding-top: 16px;
    margin-top: 16px;
}

.config-btn, .help-btn {
    width: 100%;
    padding: 10px 12px;
    background: none;
    border: none;
    text-align: left;
    color: #666;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.config-btn:hover, .help-btn:hover {
    background: #f0f0f0;
    color: #333;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    position: relative;
    transition: all 0.3s ease;
    min-width: 0;
}

.top-bar {
    height: 64px;
    border-bottom: 1px solid #e1e5e9;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Unified Sidebar Toggle Button */
.sidebar-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #666;
    border-radius: 6px;
    transition: all 0.2s ease;
    opacity: 0;
    visibility: hidden;
}

.sidebar-toggle-btn.visible {
    opacity: 1;
    visibility: visible;
}

.sidebar-toggle-btn:hover {
    background: #f0f0f0;
    color: #333;
}

/* Remove old toggle button styles */
.mobile-sidebar-toggle, .desktop-sidebar-toggle {
    display: none;
}

.chat-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: pulse 2s infinite;
}

.status-dot.offline {
    background: #ef4444;
    animation: none;
}

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

/* Chat Area */
.chat-area {
    flex: 1;
    position: relative;
    overflow: hidden;
}

/* Welcome Screen */
.welcome-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f7f8fc 0%, #ffffff 100%);
}

.welcome-content {
    text-align: center;
    max-width: 600px;
    padding: 40px;
}

.welcome-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
}

.welcome-icon i {
    font-size: 32px;
    color: white;
}

.welcome-content h2 {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 12px;
}

.welcome-content p {
    font-size: 16px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 32px;
}

.suggested-prompts h3 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
}

.prompt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.prompt-card {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 16px;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.prompt-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.prompt-card i {
    font-size: 18px;
    color: #667eea;
    width: 24px;
    text-align: center;
}

.prompt-card span {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

/* Messages Container */
.messages-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

.messages-wrapper {
    height: 100%;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.messages-list {
    max-width: 768px;
    margin: 0 auto;
    padding: 24px;
}

/* Message Styles */
.message {
    margin-bottom: 24px;
    animation: fadeInUp 0.4s ease;
}

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

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

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

.user-message .message-avatar {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.bot-message .message-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.message-author {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.message-time {
    font-size: 12px;
    color: #888;
    margin-left: auto;
}

.message-content {
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 16px 20px;
    line-height: 1.6;
    color: #333;
    font-size: 15px;
}

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

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

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

.message-content code {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 14px;
}

.user-message .message-content code {
    background: rgba(255, 255, 255, 0.2);
}

/* Streaming Message Styles */
.message.streaming {
    position: relative;
}

.streaming-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
}

.streaming-indicator i {
    font-size: 12px;
    color: #667eea;
    animation: spin 1s linear infinite;
}

.streaming-content {
    position: relative;
}

.streaming-content::after {
    content: '';
    display: inline-block;
    width: 2px;
    height: 16px;
    background: #667eea;
    margin-left: 2px;
    animation: blink 1s infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Enhanced message animations for streaming */
.message.streaming .message-content {
    background: linear-gradient(90deg, #f8f9fa 0%, #f0f3ff 50%, #f8f9fa 100%);
    background-size: 200% 100%;
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Typing Indicator */
.typing-indicator-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, #ffffff 70%, transparent);
    padding: 24px;
}

.typing-indicator-wrapper {
    max-width: 768px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.typing-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
}

.typing-text {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 20px;
    padding: 8px 16px;
}

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

.typing-dots span {
    width: 6px;
    height: 6px;
    background: #999;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

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

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

.typing-label {
    font-size: 13px;
    color: #666;
    font-style: italic;
}

/* Input Area */
.input-area {
    border-top: 1px solid #e1e5e9;
    background: #ffffff;
    padding: 20px 24px;
}

.input-container {
    max-width: 768px;
    margin: 0 auto;
}

.input-wrapper {
    position: relative;
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 10px 50px 10px 12px;
    transition: all 0.3s ease;
}

.input-wrapper:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: white;
}

#messageInput {
    width: 100%;
    background: none;
    border: none;
    outline: none;
    resize: none;
    font-size: 15px;
    line-height: 1.5;
    color: #333;
    font-family: inherit;
    min-height: 22px;
    max-height: 120px;
}

#messageInput::placeholder {
    color: #999;
}

.input-actions {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 4px;
}

.attach-btn, .send-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.attach-btn {
    background: none;
    color: #666;
}

.attach-btn:hover {
    background: #e1e5e9;
    color: #333;
}

.send-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

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

.send-btn:disabled {
    background: #e1e5e9;
    color: #999;
    cursor: not-allowed;
    transform: none;
}

.input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 12px;
    color: #666;
}

.input-hint {
    display: flex;
    align-items: center;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.modal-overlay.active {
    display: flex;
}

.modal-container {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}

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

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.modal-close {
    background: #f0f0f0;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #e1e5e9;
    color: #333;
}

.modal-content {
    padding: 24px;
    overflow-y: auto;
    max-height: 60vh;
}

.config-section, .help-section {
    margin-bottom: 32px;
}

.config-section:last-child, .help-section:last-child {
    margin-bottom: 0;
}

.config-section h4, .help-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
    font-size: 14px;
}

.form-group input, .form-group textarea {
    width: 100%;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 14px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-help {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-top: 6px;
    padding-left: 26px;
    font-style: italic;
    line-height: 1.4;
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
    margin-bottom: 8px;
}

.checkbox-label input[type="checkbox"] {
    width: 16px !important;
    height: 16px;
    margin: 0;
    accent-color: #667eea;
}

.help-section ul {
    list-style: none;
    padding: 0;
}

.help-section li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    color: #666;
    line-height: 1.5;
}

.help-section li:last-child {
    border-bottom: none;
}

.help-section kbd {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-family: monospace;
}

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

.btn-primary, .btn-secondary {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #e1e5e9;
}

.btn-secondary:hover {
    background: #f0f0f0;
}

/* Prompt Cards Configuration Styles */
.prompt-cards-config {
    margin-top: 15px;
}

.prompt-card-config {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    background: #f8fafc;
}

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

.remove-prompt-card {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.remove-prompt-card:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.prompt-card-fields {
    margin-top: 15px;
}

.prompt-card-fields .form-group {
    margin-bottom: 12px;
}

.prompt-card-fields input,
.prompt-card-fields textarea {
    font-size: 14px;
    padding: 8px 12px;
}

/* RFP Agent Configuration Styles */
.config-section h4 {
    color: #1f2937;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.config-section h4::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

#analysisDepth {
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    width: 100%;
    transition: all 0.2s ease;
}

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

/* Enhanced form styles */
.form-help {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
    font-style: italic;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
    margin-bottom: 8px;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.1);
}

/* Button styling improvements */
#addPromptCard {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

#addPromptCard:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Enhanced RFP Agent Configuration Styles */
.config-section[data-section="rfp"] {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.config-section h4 {
    color: #1f2937;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.config-section h4::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

/* Fix checkbox spacing and alignment */
.checkbox-label {
    display: flex !important;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
    margin-bottom: 8px;
    gap: 10px;
}

.checkbox-label input[type="checkbox"] {
    width: 16px !important;
    height: 16px;
    margin: 0;
    accent-color: #667eea;
}

/* Hide custom checkmark since we're using native styling */
.checkmark {
    display: none;
}

/* Document Viewer and Code Editor Styles */
.content-viewer {
    background: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    margin: 16px 0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.content-viewer-header {
    background: #f8f9fa;
    border-bottom: 1px solid #e1e5e9;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.content-type-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.content-type-indicator i {
    font-size: 16px;
}

.document-indicator {
    color: #2563eb;
}

.code-indicator {
    color: #059669;
}

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

.action-btn {
    background: none;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.action-btn:hover {
    background: #f0f0f0;
    border-color: #d1d5db;
}

.action-btn.copy-btn {
    color: #059669;
}

.action-btn.download-btn {
    color: #2563eb;
}

.action-btn.fullscreen-btn {
    color: #7c3aed;
}

/* Document Viewer */
.document-viewer {
    max-height: 500px;
    overflow-y: auto;
    background: #ffffff;
}

.document-content {
    padding: 24px 32px;
    line-height: 1.8;
    color: #374151;
    font-size: 15px;
}

.document-content h1, 
.document-content h2, 
.document-content h3 {
    color: #1f2937;
    margin-top: 24px;
    margin-bottom: 12px;
    font-weight: 600;
}

.document-content h1 {
    font-size: 24px;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 8px;
}

.document-content h2 {
    font-size: 20px;
}

.document-content h3 {
    font-size: 18px;
}

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

.document-content ul, 
.document-content ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.document-content li {
    margin-bottom: 8px;
}

.document-content blockquote {
    border-left: 4px solid #2563eb;
    background: #f8fafc;
    padding: 16px 20px;
    margin: 16px 0;
    font-style: italic;
    color: #4b5563;
}

.document-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}

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

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

/* Code Editor */
.code-editor {
    background: #1e1e1e;
    color: #d4d4d4;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
}

.code-editor-header {
    background: #2d2d30 !important;
    color: #cccccc !important;
    border-bottom: 1px solid #3e3e42 !important;
}

.code-editor-header .content-type-indicator {
    color: #cccccc !important;
}

.code-editor .action-btn {
    background: #3c3c3c;
    border: 1px solid #555;
    color: #cccccc;
}

.code-editor .action-btn:hover {
    background: #4a4a4a;
    border-color: #666;
}

.code-content {
    padding: 16px;
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
}

.code-line {
    display: flex;
    min-height: 20px;
}

.line-number {
    color: #858585;
    text-align: right;
    padding-right: 16px;
    min-width: 40px;
    user-select: none;
    font-size: 13px;
}

.line-content {
    flex: 1;
    white-space: pre;
}

/* Code Syntax Highlighting */
.keyword { color: #569cd6; }
.string { color: #ce9178; }
.comment { color: #6a9955; font-style: italic; }
.number { color: #b5cea8; }
.function { color: #dcdcaa; }
.variable { color: #9cdcfe; }
.operator { color: #d4d4d4; }
.bracket { color: #ffd700; }

/* Fullscreen Modal */
.fullscreen-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    z-index: 10001;
    backdrop-filter: blur(5px);
}

.fullscreen-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.fullscreen-content {
    background: #ffffff;
    border-radius: 12px;
    width: 95%;
    height: 90%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.fullscreen-content.code-theme {
    background: #1e1e1e;
}

.fullscreen-header {
    background: #f8f9fa;
    border-bottom: 1px solid #e1e5e9;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.fullscreen-header.code-theme {
    background: #2d2d30;
    border-bottom-color: #3e3e42;
    color: #cccccc;
}

.fullscreen-close {
    background: #ef4444;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.fullscreen-close:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.fullscreen-body {
    flex: 1;
    overflow: auto;
    padding: 0;
}

.fullscreen-document {
    padding: 40px;
    max-width: 800px;
    margin: 0 auto;
}

.fullscreen-code {
    height: 100%;
    background: #1e1e1e;
    color: #d4d4d4;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    padding: 20px;
    overflow: auto;
}

/* Copy success animation */
.copy-success {
    animation: copyPulse 0.3s ease;
}

@keyframes copyPulse {
    0% { background: #059669; color: white; }
    100% { background: #f0f0f0; color: #059669; }
}

/* Print-friendly styles for documents */
@media print {
    .content-viewer-header,
    .content-actions {
        display: none !important;
    }
    
    .document-content {
        padding: 0;
        font-size: 12pt;
        line-height: 1.6;
    }
    
    .document-content h1,
    .document-content h2,
    .document-content h3 {
        page-break-after: avoid;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .content-viewer-header {
        padding: 10px 12px;
    }
    
    .document-content {
        padding: 16px 20px;
        font-size: 14px;
    }
    
    .code-content {
        padding: 12px;
        font-size: 13px;
    }
    
    .line-number {
        min-width: 30px;
        padding-right: 12px;
    }
    
    .fullscreen-content {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
    
    .fullscreen-document {
        padding: 20px;
    }
}