/* ---------------------------------------------------- */
/* --- Diff Component Styles --- */
/* ---------------------------------------------------- */

.diff-component-container {
    width: 100%;
    margin: 10px 0;
    border: 1px solid var(--color-border-light);
    border-radius: 4px;
    overflow: hidden;
}

.diff-component-no-changes {
    padding: 20px;
    text-align: center;
    color: var(--color-success);
    font-size: 14px;
    background-color: var(--color-background);
}

.diff-component-side-by-side {
    display: flex;
    width: 100%;
}

.diff-component-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.diff-component-left {
    border-right: 1px solid var(--color-border-light);
}

.diff-component-header {
    padding: 8px 12px;
    background-color: var(--color-background-secondary);
    border-bottom: 1px solid var(--color-border-light);
    font-weight: 600;
    font-size: 14px;
    color: var(--color-text-dark);
}

.diff-component-content {
    flex: 1;
    overflow: auto;
    margin: 0;
    padding: 0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    line-height: 1.5;
    background-color: var(--color-background);
}

.diff-component-line {
    display: flex;
    padding: 2px 0;
    min-height: 20px;
}

.diff-component-line-number {
    display: inline-block;
    width: 40px;
    padding: 0 8px;
    text-align: right;
    color: var(--color-text-secondary);
    background-color: var(--color-background-secondary);
    border-right: 1px solid var(--color-border-light);
    user-select: none;
    flex-shrink: 0;
}

.diff-component-line-text {
    padding: 0 8px;
    white-space: pre;
    flex: 1;
    overflow-x: auto;
}

.diff-component-removed {
    background-color: #ffebe9;
}

.diff-component-removed .diff-component-line-number {
    background-color: #ffdce0;
    color: #d73a49;
}

.diff-component-removed .diff-component-line-text {
    color: #d73a49;
}

.diff-component-added {
    background-color: #e6ffed;
}

.diff-component-added .diff-component-line-number {
    background-color: #cdffd8;
    color: #22863a;
}

.diff-component-added .diff-component-line-text {
    color: #22863a;
}

.diff-component-modified {
    background-color: #fff8e6;
}

.diff-component-modified .diff-component-line-number {
    background-color: #ffeaa7;
    color: #856404;
}

.diff-component-char-removed {
    background-color: #fdb8c0;
    font-weight: bold;
}

.diff-component-char-added {
    background-color: #acf2bd;
    font-weight: bold;
}

.diff-component-placeholder {
    background-color: #f6f8fa;
}

.diff-component-placeholder .diff-component-line-number {
    background-color: #f6f8fa;
    color: transparent;
}

.diff-component-placeholder .diff-component-line-text {
    color: transparent;
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .diff-component-removed {
        background-color: #3d1c1c;
    }

    .diff-component-removed .diff-component-line-number {
        background-color: #5a2626;
        color: #ff7b72;
    }

    .diff-component-removed .diff-component-line-text {
        color: #ff7b72;
    }

    .diff-component-added {
        background-color: #1c3d1c;
    }

    .diff-component-added .diff-component-line-number {
        background-color: #265a26;
        color: #7ee787;
    }

    .diff-component-added .diff-component-line-text {
        color: #7ee787;
    }
    
    .diff-component-modified {
        background-color: #3d3419;
    }

    .diff-component-modified .diff-component-line-number {
        background-color: #4d4419;
        color: #f9e79f;
    }

    .diff-component-char-removed {
        background-color: #6e2c2c;
        font-weight: bold;
    }

    .diff-component-char-added {
        background-color: #2c6e3c;
        font-weight: bold;
    }
    
    .diff-component-placeholder {
        background-color: #1c1f26;
    }

    .diff-component-placeholder .diff-component-line-number {
        background-color: #1c1f26;
    }
}
