/**
 * Claude Change Tracking - Diff Styling
 * Visual styles for document change review
 */

/* Change Review Panel */
.change-review-panel {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 360px;
    background: var(--color-bg-white);
    border-left: 1px solid var(--color-border);
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.05);
    padding: 20px;
    z-index: 1000;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-border);
}

.review-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: var(--color-text-primary);
}

.review-stats {
    font-size: 13px;
    color: var(--color-text-tertiary);
}

.changes-count {
    background: var(--color-primary);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Navigation Controls */
.review-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
}

.review-controls button {
    flex: 1;
    padding: 6px 12px;
    background: var(--color-bg-subtle);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.review-controls button:hover:not(:disabled) {
    background: var(--color-border);
}

.review-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.change-position {
    font-size: 12px;
    color: var(--color-text-tertiary);
    white-space: nowrap;
    min-width: 100px;
    text-align: center;
}

/* Action Buttons */
.review-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.accept-btn {
    background: var(--color-success);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.accept-btn:hover {
    background: var(--color-success-dark);
}

.reject-btn {
    background: var(--color-error);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.reject-btn:hover {
    background: var(--color-error-dark);
}

.accept-all-btn,
.reject-all-btn {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.accept-all-btn {
    background: var(--color-success-bg);
    color: var(--color-success-dark);
    border: 1px solid #86efac;
}

.accept-all-btn:hover {
    background: var(--color-success-border);
}

.reject-all-btn {
    background: var(--color-error-bg);
    color: var(--color-error-dark);
    border: 1px solid #fca5a5;
}

.reject-all-btn:hover {
    background: var(--color-error-border);
}

/* Current Change Detail */
.current-change-detail {
    padding: 12px;
    background: var(--color-bg-input);
    border-radius: 6px;
    margin-bottom: 12px;
}

.change-type-indicator {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.change-type-delete {
    background: var(--color-error-bg);
    color: var(--color-error-dark);
}

.change-type-add {
    background: var(--color-success-bg);
    color: var(--color-success-dark);
}

.change-type-modify {
    background: var(--color-warning-bg);
    color: var(--color-warning-dark);
}

.change-content-preview {
    font-size: 12px;
    color: #57534e;
    line-height: 1.5;
}

.preview-original,
.preview-new {
    margin: 8px 0;
    padding: 8px;
    border-radius: 4px;
    background: var(--color-bg-white);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--color-border);
    max-height: 80px;
    overflow: hidden;
    position: relative;
}

.preview-original:hover,
.preview-new:hover {
    border-color: var(--color-primary);
    box-shadow: 0 2px 4px rgba(234, 88, 12, 0.1);
}

.preview-original.expanded,
.preview-new.expanded {
    max-height: 400px;
    overflow-y: auto;
}

.preview-original strong,
.preview-new strong {
    display: block;
    margin-bottom: 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-tertiary);
}

.preview-content {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Inline Change Highlighting */
.claude-change-delete {
    background-color: var(--color-change-delete-bg);
    text-decoration: line-through;
    border-left: 3px solid var(--color-change-delete-border);
    padding-left: 8px;
    margin: 4px 0;
    position: relative;
    transition: all 0.2s ease;
}

.claude-change-add {
    background-color: var(--color-change-add-bg);
    border-left: 3px solid var(--color-change-add-border);
    padding-left: 8px;
    margin: 4px 0;
    position: relative;
    transition: all 0.2s ease;
}

.claude-change-modify {
    background-color: var(--color-change-modify-bg);
    border-left: 3px solid var(--color-change-modify-border);
    padding-left: 8px;
    margin: 4px 0;
    position: relative;
    transition: all 0.2s ease;
}

/* Currently focused change */
.claude-change-active {
    outline: 2px solid var(--color-change-active);
    outline-offset: 2px;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
}

/* Change number indicator */
.claude-change-number {
    position: absolute;
    left: -24px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--color-change-active);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
}

/* Keyboard Shortcuts Help */
.review-shortcuts-help {
    padding: 12px;
    background: var(--color-bg-input);
    border-radius: 6px;
    margin-top: 12px;
    border-top: 1px solid var(--color-border);
}

.review-shortcuts-help h4 {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: var(--color-text-primary);
}

.review-shortcuts-help ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.review-shortcuts-help li {
    font-size: 12px;
    color: #57534e;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
}

.review-shortcuts-help kbd {
    background: var(--color-bg-white);
    border: 1px solid var(--color-border);
    border-radius: 3px;
    padding: 2px 6px;
    font-family: monospace;
    font-size: 11px;
    margin-right: 8px;
    min-width: 32px;
    text-align: center;
    display: inline-block;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .change-review-panel {
        position: fixed;
        right: 0;
        left: 0;
        top: auto;
        bottom: 0;
        width: 100%;
        border-radius: 12px 12px 0 0;
        max-height: 60vh;
    }

    .review-controls {
        flex-direction: column;
    }

    .change-position {
        order: -1;
        margin-bottom: 8px;
    }
}

/* Animation for entering/exiting review mode */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.change-review-panel {
    animation: slideIn 0.3s ease-out;
}

/* Hover effects for change elements */
[data-change-id]:hover {
    opacity: 0.9;
    cursor: pointer;
}

/* Smooth scrolling for change navigation */
html {
    scroll-behavior: smooth;
}

/* Adjust document editor when review panel is open */
.document-editor:has(~ #documentChangeReview:not([style*="display: none"])) {
    margin-right: 360px;
}

/* Alternative: Add class-based approach for better browser support */
body.review-mode-active .document-editor {
    margin-right: 360px;
    transition: margin-right 0.3s ease;
}

body:not(.review-mode-active) .document-editor {
    margin-right: 0;
    transition: margin-right 0.3s ease;
}
