/* Custom patches for Codersarts Agent Platform */

/* Fix: Chat messages container scrolling - allow overflow-y auto on the messages area */
/* Target the chat messages container that has overflow-hidden but should scroll */
.relative.overflow-hidden.flex-1.p-6 {
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* Also ensure the card container properly constrains height for scrolling */
.rounded-lg.border.bg-card.text-card-foreground.shadow-sm.flex-1.flex.flex-col.overflow-hidden {
    min-height: 0;
}

/* Ensure the inner flex column properly shrinks to allow scrolling */
.flex-1.flex.flex-col.p-0 {
    min-height: 0;
    overflow: hidden;
}

/* Document preview modal styles */
.doc-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
}

.doc-preview-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

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

.doc-preview-header h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: #1f2937;
}

.doc-preview-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #6b7280;
    font-size: 20px;
    line-height: 1;
}

.doc-preview-close:hover {
    color: #1f2937;
}

.doc-preview-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    white-space: pre-wrap;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    line-height: 1.7;
    color: #374151;
}

.doc-preview-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 24px;
    border-top: 1px solid #e5e7eb;
}

/* Document action buttons injected into the dialog */
.doc-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: white;
    color: #374151;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

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

.doc-action-btn.primary {
    background: #7c3aed;
    color: white;
    border-color: #7c3aed;
}

.doc-action-btn.primary:hover {
    background: #6d28d9;
}

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