/**
 * History Panel Styles - Advanced Selective Undo
 * BanglaPDFEditor
 */

.history-panel {
    position: fixed;
    right: 0;
    top: 0;
    width: 420px;
    max-width: 90vw;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    transform: translateX(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.history-panel.hidden {
    transform: translateX(100%);
}

.history-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.history-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.history-header {
    padding: 20px 24px;
    border-bottom: 2px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.history-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

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

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

.history-search {
    padding: 16px;
    border-bottom: 1px solid #eee;
    background: #f9f9f9;
}

.history-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

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

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #fafafa;
}

.history-empty,
.history-error {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
}

.history-error {
    color: #f44336;
}

.history-item {
    background: white;
    border-left: 4px solid #4CAF50;
    padding: 16px;
    margin-bottom: 12px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.2s;
}

.history-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transform: translateX(-2px);
}

.history-item.undone {
    opacity: 0.6;
    border-left-color: #999;
    background: #f5f5f5;
}

.history-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.version-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.operation-type {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    background: #f0f0f0;
    padding: 3px 8px;
    border-radius: 4px;
}

.conflict-warning {
    color: #ff9800;
    font-size: 14px;
    background: #fff3e0;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.undone-badge {
    background: #999;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.history-item-description {
    font-size: 14px;
    margin-bottom: 10px;
    color: #333;
    line-height: 1.5;
    word-break: break-word;
}

.history-item-meta {
    font-size: 12px;
    color: #999;
    display: flex;
    gap: 12px;
    align-items: center;
}

.timestamp {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.timestamp::before {
    content: '🕐';
}

.page-number {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #e3f2fd;
    color: #1976d2;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.page-number::before {
    content: '📄';
}

.history-item-actions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.undo-btn {
    background: linear-gradient(135deg, #f44336 0%, #e91e63 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(244, 67, 54, 0.3);
}

.undo-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(244, 67, 54, 0.4);
}

.undo-btn:active {
    transform: translateY(0);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .history-panel {
        width: 100vw;
        max-width: 100vw;
    }
    
    .history-header h2 {
        font-size: 18px;
    }
}

/* Scrollbar styling */
.history-list::-webkit-scrollbar {
    width: 8px;
}

.history-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.history-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.history-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}
