/* 리비전 비교 뷰 컴포넌트 스타일 */

.revision-comparison-view {
    background: #f8f9fa;
    min-height: 100vh;
    padding: 20px;
}

/* 로딩 및 빈 상태 */
.revision-comparison-loading,
.revision-comparison-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.revision-comparison-loading p,
.revision-comparison-empty p {
    margin-top: 16px;
    color: #6b7280;
    font-size: 14px;
}

/* 헤더 */
.comparison-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.header-info h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
}

.header-info p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
}

.comparison-date {
    font-size: 12px;
    color: #9ca3af;
    margin-left: 8px;
}

.header-actions {
    display: flex;
    gap: 12px;
}

.btn-export,
.btn-refresh {
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    color: #374151;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-export:hover,
.btn-refresh:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.btn-export:disabled,
.btn-refresh:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 요약 카드 */
.comparison-summary-card {
    margin-bottom: 24px;
}

/* 필터 섹션 */
.comparison-filters {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
}

.filter-group select,
.filter-group input[type="text"] {
    padding: 6px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    min-width: 120px;
}

.filter-group select:focus,
.filter-group input[type="text"]:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.filter-group input[type="checkbox"] {
    margin-right: 6px;
}

.btn-reset-filters {
    padding: 6px 12px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-reset-filters:hover {
    background: #e5e7eb;
}

/* 필터링된 요약 */
.filtered-summary {
    padding: 12px 20px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #0369a1;
}

.filter-note {
    color: #6b7280;
    margin-left: 8px;
}

/* 탭 네비게이션 */
.comparison-tabs {
    display: flex;
    background: white;
    border-radius: 8px 8px 0 0;
    border: 1px solid #e5e7eb;
    border-bottom: none;
}

.tab-button {
    flex: 1;
    padding: 12px 20px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
}

.tab-button:first-child {
    border-radius: 8px 0 0 0;
}

.tab-button:last-child {
    border-radius: 0 8px 0 0;
}

.tab-button:hover {
    background: #f9fafb;
    color: #374151;
}

.tab-button.active {
    background: white;
    color: #6366f1;
    border-bottom-color: #6366f1;
}

/* 탭 콘텐츠 */
.comparison-content {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0 0 8px 8px;
    min-height: 400px;
}

/* 요약 탭 */
.comparison-summary-tab {
    padding: 24px;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #f3f4f6;
    text-align: center;
}

.stat-card h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
}

.change-previews {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.change-preview {
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #f3f4f6;
}

.change-preview h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.preview-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.preview-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    background: white;
    border-radius: 6px;
    font-size: 12px;
}

.material-desc {
    flex: 1;
    color: #374151;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-more {
    padding: 8px;
    text-align: center;
    color: #6b7280;
    font-size: 12px;
    font-style: italic;
}

/* 상세 변경사항 탭 */
.comparison-details-tab {
    padding: 24px;
}

.change-type-section {
    margin-bottom: 32px;
}

.change-type-header {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.change-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.change-item-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    overflow: hidden;
    transition: all 0.2s ease;
}

.change-item-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.change-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.change-item-header:hover {
    background: #f9fafb;
}

.item-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.item-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-select {
    padding: 4px 12px;
    background: #6366f1;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-select:hover {
    background: #5558e3;
}

.expand-icon {
    color: #9ca3af;
    font-size: 12px;
    transition: transform 0.2s ease;
}

.change-item-details {
    padding: 16px;
    border-top: 1px solid #f3f4f6;
    background: #f9fafb;
}

/* 자재별 보기 탭 */
.comparison-materials-tab {
    padding: 24px;
}

.materials-table {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.table-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 100px;
    gap: 16px;
    padding: 12px 16px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
    font-size: 14px;
    color: #374151;
}

.table-body {
    max-height: 600px;
    overflow-y: auto;
}

.table-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 100px;
    gap: 16px;
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
    color: #374151;
    transition: background-color 0.2s ease;
}

.table-row:hover {
    background: #f9fafb;
}

.table-row:last-child {
    border-bottom: none;
}

.btn-select-small {
    padding: 2px 8px;
    background: #6366f1;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-select-small:hover {
    background: #5558e3;
}

/* 자재 변경 상세 정보 */
.material-change-details {
    background: white;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 16px;
}

.detail-section h5 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    padding-bottom: 8px;
    border-bottom: 1px solid #f3f4f6;
}

.detail-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    font-size: 13px;
}

.detail-item .label {
    font-weight: 500;
    color: #6b7280;
    min-width: 80px;
}

.detail-item .value {
    color: #374151;
    text-align: right;
    flex: 1;
}

.change-value {
    display: flex;
    align-items: center;
    gap: 6px;
}

.old-value {
    color: #dc2626;
    text-decoration: line-through;
}

.arrow {
    color: #6b7280;
    font-size: 12px;
}

.new-value {
    color: #059669;
    font-weight: 500;
}

.change-amount {
    color: #6b7280;
    font-size: 11px;
}

/* 반응형 디자인 */
@media (max-width: 1200px) {
    .comparison-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .filter-group {
        justify-content: space-between;
    }
    
    .summary-stats {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .change-previews {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .revision-comparison-view {
        padding: 16px;
    }
    
    .comparison-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .header-actions {
        justify-content: stretch;
    }
    
    .btn-export,
    .btn-refresh {
        flex: 1;
    }
    
    .comparison-tabs {
        flex-direction: column;
    }
    
    .tab-button {
        border-radius: 0;
        border-bottom: 1px solid #e5e7eb;
    }
    
    .tab-button:first-child {
        border-radius: 8px 8px 0 0;
    }
    
    .tab-button:last-child {
        border-radius: 0;
        border-bottom: none;
    }
    
    .table-header,
    .table-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .table-header span,
    .table-row span {
        padding: 4px 0;
    }
    
    .table-header span:before,
    .table-row span:before {
        content: attr(data-label) ': ';
        font-weight: 600;
        color: #6b7280;
        display: inline-block;
        min-width: 80px;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .detail-item {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }
    
    .detail-item .value {
        text-align: left;
    }
}

/* 애니메이션 */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.change-item-details {
    animation: slideDown 0.2s ease-out;
}

.comparison-content {
    animation: slideDown 0.3s ease-out;
}

/* 스크롤바 스타일 */
.table-body::-webkit-scrollbar {
    width: 6px;
}

.table-body::-webkit-scrollbar-track {
    background: #f3f4f6;
}

.table-body::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.table-body::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}
