/* ===================================
   Diff Viewer Component Styles
   Side-by-side code comparison
   =================================== */

.side-by-side-diff-container {
    display: flex;
    gap: 0;
    height: 70vh;
    overflow: hidden;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.diff-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Important for flexbox text overflow */
}

.diff-panel-old {
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.diff-panel-header {
    padding: 16px 20px;
    background: rgba(40, 40, 40, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.diff-panel-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
}

.diff-panel-header::after {
    content: "🔗";
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    opacity: 0.3;
    font-size: 14px;
    pointer-events: none;
}

.diff-panel-content {
    flex: 1;
    overflow: auto;
    background: #0d1117;
}

/* Diff Table */
.diff-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
}

.diff-table tr {
    border: none;
}

.diff-table td {
    padding: 0;
    border: none;
    vertical-align: top;
}

.diff-line-number {
    width: 50px;
    min-width: 50px;
    padding: 2px 10px;
    text-align: right;
    user-select: none;
    color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.02);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 12px;
}

.diff-line-indicator {
    width: 20px;
    min-width: 20px;
    padding: 2px 8px;
    text-align: center;
    user-select: none;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.02);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.diff-line-content {
    padding: 2px 10px;
    white-space: pre;
    overflow-x: auto;
}

.diff-line-content pre {
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
    white-space: pre;
}

/* Diff Line Types */
.diff-line-unchanged {
    background: transparent;
}

.diff-line-inserted {
    background: rgba(46, 160, 67, 0.15);
}

.diff-line-inserted .diff-line-indicator {
    color: #3fb950;
    background: rgba(46, 160, 67, 0.2);
}

.diff-line-inserted .diff-line-content {
    background: rgba(46, 160, 67, 0.15);
}

.diff-line-deleted {
    background: rgba(248, 81, 73, 0.15);
}

.diff-line-deleted .diff-line-indicator {
    color: #f85149;
    background: rgba(248, 81, 73, 0.2);
}

.diff-line-deleted .diff-line-content {
    background: rgba(248, 81, 73, 0.15);
}

.diff-line-modified-old {
    background: rgba(248, 81, 73, 0.15);
}

.diff-line-modified-old .diff-line-indicator {
    color: #f85149;
    background: rgba(248, 81, 73, 0.2);
}

.diff-line-modified-old .diff-line-content {
    background: rgba(248, 81, 73, 0.15);
}

.diff-line-modified-new {
    background: rgba(46, 160, 67, 0.15);
}

.diff-line-modified-new .diff-line-indicator {
    color: #3fb950;
    background: rgba(46, 160, 67, 0.2);
}

.diff-line-modified-new .diff-line-content {
    background: rgba(46, 160, 67, 0.15);
}

.diff-line-imaginary {
    background: rgba(255, 255, 255, 0.02);
    opacity: 0.3;
}

.diff-line-imaginary .diff-line-content {
    color: transparent;
}

/* Scrollbar Styles for Diff Panel */
.diff-panel-content::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.diff-panel-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.diff-panel-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
}

.diff-panel-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .side-by-side-diff-container {
        flex-direction: column;
        height: auto;
    }
    
    .diff-panel-old {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .diff-panel-content {
        max-height: 400px;
    }
}
