/* AI Import History Tab and Panel Styles */

.import-history-tab {
    position: fixed;
    right: 0;
    top: 282px;
    transform: translateY(-50%);
    background: var(--kendo-color-primary, #ff6358);
    color: white;
    padding: 12px 8px;
    cursor: pointer;
    border-radius: 8px 0 0 8px;
    box-shadow: -2px 2px 8px rgba(0,0,0,0.2);
    z-index: 998;
    transition: right 0.3s ease-in-out, background 0.15s;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-weight: 600;
    font-size: 14px;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 110px;
    min-width: 42px;
}

.import-history-tab:hover {
    background: var(--kendo-color-primary-hover, var(--kendo-color-primary, #ea5a51));
    filter: brightness(0.9);
}

.import-history-tab.open {
    display: none !important;
}

/* Dialog Overlay - transparent, allows interaction with page behind */
.import-history-overlay {
    display: none;
}

/* Import History Dialog */
.import-history-dialog {
    position: fixed;
    right: 0;
    top: 60px;
    width: 700px;
    height: calc(100vh - 60px);
    background: white;
    box-shadow: -2px 0 20px rgba(0,0,0,0.3);
    transform: translateX(700px);
    transition: transform 0.3s ease-in-out;
    z-index: 1999;
    display: flex;
    flex-direction: column;
}

.import-history-dialog.open {
    transform: translateX(0);
}

/* Dialog Header */
.import-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
    background: #f8f9fa;
}

.import-history-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.import-history-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #666;
    padding: 5px 10px;
}

.import-history-close:hover {
    color: #333;
}

/* Dialog Content - Two Panel Layout */
.import-history-content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Left Panel - Document List */
.import-history-list-panel {
    width: 300px;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    background: white;
    transition: width 0.3s, min-width 0.3s;
    overflow: hidden;
}

.import-history-list-panel.collapsed {
    width: 0;
    min-width: 0;
    border-right: none;
}

.import-history-list-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid #eee;
    min-width: 300px;
}

.import-history-list-panel .panel-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

/* Toggle button for collapsing list panel */
.panel-toggle-btn {
    background: var(--kendo-color-primary, #ff6358);
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.panel-toggle-btn:hover {
    filter: brightness(0.9);
}

.document-count {
    font-size: 13px;
    color: #666;
    padding: 4px 6px;
    background: #f5f5f5;
    border-radius: 4px;
}

.import-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.import-history-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.import-history-item:hover {
    background: color-mix(in srgb, var(--kendo-color-primary, #ff6358) 8%, white);
}

.import-history-item.selected {
    border-color: var(--kendo-color-primary, #ff6358);
    background: color-mix(in srgb, var(--kendo-color-primary, #ff6358) 12%, white);
}

.import-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.import-item-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
}

.import-item-date {
    font-size: 12px;
    color: #888;
}

.no-imports {
    padding: 60px 20px;
    text-align: center;
    color: #999;
}

/* Right Panel - Document Preview */
.import-history-preview-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fafafa;
}

.import-history-preview-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: white;
    border-bottom: 1px solid #eee;
}

.import-history-preview-panel .panel-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.preview-content {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.document-preview-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.no-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    font-size: 15px;
}

@media (max-width: 900px) {
    .import-history-dialog {
        width: 100%;
        transform: translateX(100%);
    }
}
