/* File Compare Tool - Custom Styles */

/* Diff output styling */
#diffOutput {
    max-height: 600px;
    overflow: auto;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.375rem;
    background-color: var(--bs-body-bg);
}

[data-bs-theme="dark"] #diffOutput {
    border-color: rgba(255, 255, 255, 0.1);
    background-color: rgba(30, 34, 42, 0.6);
}

/* Binary diff display */
.binary-diff {
    padding: 1rem;
    background-color: var(--bs-light-bg-subtle);
    border-radius: 0.375rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875rem;
    margin: 0;
}

[data-bs-theme="dark"] .binary-diff {
    background-color: rgba(20, 24, 32, 0.6);
}

/* Plain diff display */
.plain-diff {
    padding: 1rem;
    background-color: var(--bs-light-bg-subtle);
    border-radius: 0.375rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875rem;
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

[data-bs-theme="dark"] .plain-diff {
    background-color: rgba(20, 24, 32, 0.6);
}

/* Summary cards */
#summaryContainer .card {
    border: 1px solid var(--bs-border-color);
}

#summaryContainer .card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

#summaryContainer .card-text {
    font-size: 0.875rem;
}

[data-bs-theme="dark"] #summaryContainer .card {
    border-color: rgba(255, 255, 255, 0.1);
    background-color: rgba(30, 34, 42, 0.6);
}

/* Diff2Html overrides for better integration */
#diffOutput .d2h-wrapper {
    border: none;
    font-size: 0.875rem;
}

#diffOutput .d2h-file-header {
    background-color: var(--bs-secondary-bg);
    border-color: var(--bs-border-color);
    padding: 0.5rem 1rem;
}

#diffOutput .d2h-file-name {
    font-size: 0.9375rem;
    font-weight: 600;
}

#diffOutput .d2h-code-line {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.8125rem;
    line-height: 1.5;
}

#diffOutput .d2h-code-line-ctn {
    padding: 0 0.5rem;
}

/* Light mode diff colors */
#diffOutput .d2h-ins {
    background-color: #e6ffec;
}

#diffOutput .d2h-ins .d2h-code-line-ctn {
    background-color: #acf2bd;
}

#diffOutput .d2h-del {
    background-color: #ffebe9;
}

#diffOutput .d2h-del .d2h-code-line-ctn {
    background-color: #ffc1c1;
}

#diffOutput .d2h-info {
    background-color: #f0f8ff;
    color: #0366d6;
}

/* Dark mode diff colors */
[data-bs-theme="dark"] #diffOutput .d2h-wrapper {
    background-color: transparent;
}

[data-bs-theme="dark"] #diffOutput .d2h-file-header {
    background-color: rgba(30, 34, 42, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--dark-text-primary);
}

[data-bs-theme="dark"] #diffOutput .d2h-code-line {
    background-color: rgba(30, 34, 42, 0.4);
    color: var(--dark-text-secondary);
    border-color: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] #diffOutput .d2h-ins {
    background-color: rgba(40, 167, 69, 0.15);
}

[data-bs-theme="dark"] #diffOutput .d2h-ins .d2h-code-line-ctn {
    background-color: rgba(40, 167, 69, 0.25);
}

[data-bs-theme="dark"] #diffOutput .d2h-del {
    background-color: rgba(220, 53, 69, 0.15);
}

[data-bs-theme="dark"] #diffOutput .d2h-del .d2h-code-line-ctn {
    background-color: rgba(220, 53, 69, 0.25);
}

[data-bs-theme="dark"] #diffOutput .d2h-info {
    background-color: rgba(79, 172, 254, 0.15);
    color: #4facfe;
}

[data-bs-theme="dark"] #diffOutput .d2h-code-side-line {
    border-color: rgba(255, 255, 255, 0.05);
}

/* Enhanced word-level highlighting */
#diffOutput .d2h-code-line ins,
#diffOutput .d2h-code-line del {
    font-weight: 600;
    text-decoration: none;
}

#diffOutput .d2h-code-line ins {
    background-color: rgba(40, 167, 69, 0.4);
}

#diffOutput .d2h-code-line del {
    background-color: rgba(220, 53, 69, 0.4);
}

[data-bs-theme="dark"] #diffOutput .d2h-code-line ins {
    background-color: rgba(40, 167, 69, 0.5);
}

[data-bs-theme="dark"] #diffOutput .d2h-code-line del {
    background-color: rgba(220, 53, 69, 0.5);
}

/* Responsive */
@media (max-width: 768px) {
    #diffOutput {
        max-height: 500px;
        font-size: 0.8125rem;
    }
    
    .binary-diff,
    .plain-diff {
        font-size: 0.8125rem;
        padding: 0.75rem;
    }
}

@media (max-width: 576px) {
    #diffOutput {
        max-height: 400px;
        font-size: 0.75rem;
    }
    
    .binary-diff,
    .plain-diff {
        font-size: 0.75rem;
        padding: 0.5rem;
    }
}

