/* Diff Viewer Specific Styles */

body {
    margin: 0;
    padding: 0;
    overflow: hidden;
}

#diff-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    padding: 1.25rem;
    gap: 1rem;
    background-color: var(--bg-root);
    color: var(--fg-primary);
    box-sizing: border-box;
}

#diff-header {
    display: flex;
    align-items: center;
    gap: 20px;
}

#diff-header h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    flex: 1;
    text-align: center;
}

.header-controls {
    display: flex;
    gap: 10px;
}

#diff-inputs {
    display: flex;
    gap: 15px;
    height: 30%;
    min-height: 200px;
}

.input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 11px;
    font-weight: 600;
    color: var(--fg-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.textarea-container {
    flex: 1;
    display: flex;
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.textarea-container:focus-within {
    border-color: var(--accent);
}

.textarea-line-numbers {
    min-width: 40px;
    padding: 10px 8px 10px 0;
    text-align: right;
    color: #6e7681;
    user-select: none;
    border-right: 1px solid var(--border);
    font-family: var(--font-code);
    font-size: 13px;
    line-height: 1.5;
    white-space: pre;
    background-color: var(--bg-root);
    overflow: hidden;
}

textarea {
    flex: 1;
    background-color: transparent;
    border: none;
    color: var(--fg-primary);
    font-family: var(--font-code);
    font-size: 13px;
    line-height: 1.5;
    padding: 10px;
    resize: none;
    outline: none;
}

#diff-output-container {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.diff-view {
    flex: 1;
    background-color: var(--bg-root);
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.empty-state {
    color: var(--fg-secondary);
    text-align: center;
    margin-top: 50px;
    font-style: italic;
    font-size: 13px;
}

/* Unified View Styles */
#unified-view {
    overflow: auto;
    padding: 10px;
}

.unified-diff-container {
    display: flex;
    font-family: var(--font-code);
    font-size: 13px;
    line-height: 1.6;
}

.unified-line-numbers {
    min-width: 50px;
    padding-right: 15px;
    text-align: right;
    color: #6e7681;
    user-select: none;
    border-right: 1px solid var(--border);
    flex-shrink: 0;
    white-space: pre;
    font-family: var(--font-code);
    font-size: 13px;
    line-height: 1.6;
}

.unified-content {
    flex: 1;
    padding-left: 15px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.diff-line {
    display: block;
    width: 100%;
    padding: 2px 0;
}

.diff-added {
    background-color: rgba(46, 160, 67, 0.2);
    color: #bcc;
}

.diff-added::before {
    content: '+ ';
    color: #4caf50;
    font-weight: bold;
}

.diff-removed {
    background-color: rgba(248, 81, 73, 0.2);
    color: #cbb;
}

.diff-removed::before {
    content: '- ';
    color: #f44336;
    font-weight: bold;
}

.diff-unchanged {
    color: var(--fg-primary);
}

.diff-unchanged::before {
    content: '  ';
}

/* Inline character-level highlighting */
.inline-added {
    background-color: rgba(46, 160, 67, 0.5);
    color: #d4ffd4;
    font-weight: 500;
    padding: 1px 2px;
    border-radius: 2px;
}

.inline-removed {
    background-color: rgba(248, 81, 73, 0.5);
    color: #ffd4d4;
    font-weight: 500;
    padding: 1px 2px;
    border-radius: 2px;
}

/* Split View Styles */
#split-view {
    flex-direction: row;
    gap: 1px;
    background-color: var(--border);
}

.split-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-root);
    min-width: 0;
}

.pane-header {
    padding: 8px 15px;
    background-color: var(--bg-header);
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--fg-secondary);
    letter-spacing: 0.5px;
}

.pane-content {
    flex: 1;
    display: flex;
    overflow: auto;
    position: relative;
}

.line-numbers {
    min-width: 50px;
    background-color: var(--bg-root);
    color: #6e7681;
    text-align: right;
    padding: 10px 10px 10px 0;
    user-select: none;
    border-right: 1px solid var(--border);
    font-family: var(--font-code);
    font-size: 13px;
    line-height: 1.6;
    white-space: pre;
    flex-shrink: 0;
    overflow: hidden;
}

.code-content {
    flex: 1;
    padding: 10px 10px 10px 15px;
    font-family: var(--font-code);
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-x: auto;
}

.split-line {
    display: block;
    min-height: 1.6em;
}

.split-added {
    background-color: rgba(46, 160, 67, 0.2);
}

.split-removed {
    background-color: rgba(248, 81, 73, 0.2);
}

.split-unchanged {
    color: var(--fg-primary);
}

.split-empty {
    background-color: rgba(128, 128, 128, 0.1);
    color: var(--fg-secondary);
}

/* Scrollbar sync indicator */
.pane-content::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.pane-content::-webkit-scrollbar-track {
    background: transparent;
}

.pane-content::-webkit-scrollbar-thumb {
    background: #424242;
    border: 3px solid transparent;
    background-clip: content-box;
    border-radius: 9px;
}

.pane-content::-webkit-scrollbar-thumb:hover {
    background-color: #4f4f4f;
    background-clip: content-box;
}