/**
 * File Compare Page Styles
 * 파일 비교 도구 전용 스타일 (Beyond Compare 스타일)
 */

/* ========================================
   드롭존 영역
   ======================================== */

.compare-dropzones {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.compare-dropzones .drop-zone {
    padding: var(--space-6);
}

.compare-dropzones .drop-zone-icon {
    width: 48px;
    height: 48px;
    margin-bottom: var(--space-2);
}

/* ========================================
   Beyond Compare 스타일 뷰어
   ======================================== */

.bc-viewer {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    background: var(--bg-primary);
}

.bc-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.bc-toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bc-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.bc-stat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.bc-stat-dot.match {
    background: #22c55e;
}

.bc-stat-dot.diff {
    background: #ef4444;
}

.bc-stat-dot.add {
    background: #3b82f6;
}

/* ========================================
   패널 영역
   ======================================== */

.bc-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.bc-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border-right: 2px solid var(--border);
}

.bc-panel:last-child {
    border-right: none;
}

.bc-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
}

.bc-panel-title {
    font-weight: 600;
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.bc-panel-info {
    font-size: 11px;
    color: var(--text-muted);
}

.bc-panel-content {
    flex: 1;
    overflow-y: auto;
    max-height: 500px;
}

/* ========================================
   라인 스타일
   ======================================== */

.bc-line {
    display: flex;
    min-height: 22px;
    line-height: 22px;
}

.bc-line-num {
    width: 40px;
    padding: 0 8px;
    text-align: right;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    user-select: none;
    flex-shrink: 0;
}

.bc-line-text {
    flex: 1;
    padding: 0 12px;
    white-space: pre;
    overflow-x: auto;
}

/* 상태별 색상 */
.bc-line.match .bc-line-text {
    background: transparent;
}

.bc-line.diff .bc-line-text {
    background: rgba(239, 68, 68, 0.15);
}

.bc-line.diff .bc-line-num {
    background: rgba(239, 68, 68, 0.2);
    color: #dc2626;
}

.bc-line.add .bc-line-text {
    background: rgba(34, 197, 94, 0.15);
}

.bc-line.add .bc-line-num {
    background: rgba(34, 197, 94, 0.2);
    color: #16a34a;
}

.bc-line.remove .bc-line-text {
    background: rgba(239, 68, 68, 0.15);
}

.bc-line.remove .bc-line-num {
    background: rgba(239, 68, 68, 0.2);
    color: #dc2626;
}

.bc-line.empty .bc-line-text {
    background: var(--bg-secondary);
}

.bc-line.empty .bc-line-num {
    color: transparent;
}

/* ========================================
   해시 비교 결과
   ======================================== */

.hash-result {
    margin-top: var(--space-4);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.hash-result.match {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.hash-result.mismatch {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.hash-result-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hash-result.match .hash-result-icon {
    background: #22c55e;
    color: white;
}

.hash-result.mismatch .hash-result-icon {
    background: #ef4444;
    color: white;
}

.hash-result-text {
    flex: 1;
}

.hash-result-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.hash-result-desc {
    font-size: 12px;
    color: var(--text-muted);
}

/* ========================================
   파일 로드 상태
   ======================================== */

.file-loaded {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
}

.file-loaded-icon {
    color: var(--accent);
}

.file-loaded-name {
    font-weight: 500;
    color: var(--text-primary);
    word-break: break-all;
    text-align: center;
}

.file-loaded-meta {
    font-size: 12px;
    color: var(--text-muted);
}

/* ========================================
   동기화 스크롤
   ======================================== */

.bc-sync-scroll {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
}

.bc-sync-scroll input {
    accent-color: var(--accent);
}

/* ========================================
   반응형
   ======================================== */

@media (max-width: 768px) {
    .compare-dropzones {
        grid-template-columns: 1fr;
    }
    
    .bc-panels {
        grid-template-columns: 1fr;
    }
    
    .bc-panel {
        border-right: none;
        border-bottom: 2px solid var(--border);
    }
    
    .bc-panel:last-child {
        border-bottom: none;
    }
}
