/* static/css/styles.css - 관리자 페이지 스타일 */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Pretendard', 'Noto Sans KR', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 헤더 영역 */
.admin-header {
    background-color: #046CF5;
    color: white;
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-title {
    display: flex;
    align-items: center;
}

.admin-title h1 {
    font-size: 24px;
    margin: 0;
}

.admin-badge {
    background-color: #5e00c2;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 4px;
    margin-left: 10px;
}

/* 검색 영역 */
.search-area {
    background-color: white;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.search-input:focus {
    border-color: #046CF5;
    outline: none;
}

.search-button {
    background-color: #046CF5;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    margin-left: 10px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.search-button:hover {
    background-color: #046CF5;
}

/* 통계 영역 */
.stats-area {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.stat-card {
    background-color: white;
    border-radius: 5px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    flex: 1;
    min-width: 150px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
    color: #046CF5;
    margin: 5px 0;
}

.stat-label {
    color: #666;
    font-size: 14px;
}

/* 콘텐츠 영역 */
.content-area {
    background-color: white;
    border-radius: 5px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.table-container {
    overflow-x: auto;
    margin-bottom: 20px;
}

/* 테이블 스타일 */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background-color: #f0f0f0;
    font-weight: bold;
    color: #333;
    position: sticky;
    top: 0;
    z-index: 10;
}

tr:hover {
    background-color: rgba(230, 240, 254);
    cursor: pointer;
}

tr:nth-child(even) {
    background-color: #fafafa;
}

tr:nth-child(even):hover {
    background-color: rgba(230, 240, 254);
}

.image-preview {
    width: 80px;
    height: 80px;
    object-fit: contain; /* 비율 유지하며 영역에 맞춤 */
    border-radius: 4px;
    border: 1px solid #eee;
    background-color: #f9f9f9;
}

.text-preview, .feedback-preview {
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 페이지네이션 */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    gap: 5px;
}

.pagination button {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background-color: white;
    cursor: pointer;
    border-radius: 4px;
    min-width: 40px;
    transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
    background-color: #f0f0f0;
}

.pagination button.active {
    background-color: #046CF5;
    color: white;
    border-color: #046CF5;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 모달 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    overflow-y: scroll;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    position: relative;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #000;
}

/* 상세 정보 스타일 */
.detail-header {
    display: flex;
    justify-content: start;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.detail-header h2 {
    font-size: 24px;
    color: #333;
}

.detail-info {
    margin-bottom: 15px;
    background-color: #f9f9f9;
    padding: 10px;
    border-radius: 5px;
}

/* 정보 영역 가로 정렬 */
.info-flex {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.info-flex p {
    margin: 0 20px 0 0;
    padding: 8px 0;
}

/* 검수 전 배지 */
.status-badge {
    background-color: #FFEDD5;
    color: #F97316;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    margin-left: auto;
}

/* 콘텐츠 행 구성 */
.content-row {
    display: flex;
    margin-bottom: 25px;
}

.detail-image-container{
    flex: 0.4;
    min-width: 0;
}

.detail-text-container {
    flex: 0.6;
    min-width: 0;
}

.detail-section-title {
    font-size: 18px;
    margin-bottom: 10px;
    color: #333;
}

.detail-image {
    max-width: 100%;
    max-height: 470px;
    width: auto;
    height: auto;
    object-fit: contain; /* 비율 유지 */
    border: 1px solid #eee;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: block;
}

.detail-text {
    background-color: #f9f9f9;
    padding: 10px;
    border-radius: 4px;
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
    min-height: 150px;
    overflow-y: auto;
    border: 1px solid #eee;
    font-size: 14px;
    line-height: 1.6;
}

/* 관리자 검수 텍스트 영역 */
.admin-review-text {
    width: 100%;
    min-height: 150px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    font-family: 'Pretendard', 'Noto Sans KR', sans-serif;
    margin-bottom: 5px;
}

.text-buttons {
    display: flex;
    gap: 10px;
}

.text-save-btn {
    background-color: #046CF5;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
}

.text-edit-btn {
    background-color: #046CF5;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
}

.text-reset-btn {
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
}

/* 피드백 영역 조정 */
.feedback-container {
    margin-top: 30px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.feedback-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.feedback-section {
    margin-bottom: 20px;
}

.feedback-section h4 {
    font-size: 16px;
    margin-bottom: 8px;
    color: #444;
}

.feedback-items {
    background-color: #f0f8ff;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #e0e8f0;
}

.feedback-item {
    margin-bottom: 10px;
    line-height: 1.5;
}

.feedback-item:last-child {
    margin-bottom: 0;
}

/* 마진 유틸리티 */
.mt-4 {
    margin-top: 20px;
}

/* 상태 및 메시지 스타일 */
.loading {
    text-align: center;
    padding: 30px;
    font-size: 16px;
    color: #666;
}

.no-results {
    text-align: center;
    padding: 50px 20px;
    color: #666;
    font-size: 16px;
}

.modal-close:hover {
    color: #000;
}

/* 모달 내비게이션 스타일 */
.modal-navigation {
    display: flex;
    justify-content: space-between;
    padding-top: 15px;
}

.nav-button {
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.nav-button:hover {
    background-color: #e0e0e0;
}

.nav-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 섹션 헤더 스타일 - 제목과 버튼 정렬 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.section-header h3 {
    margin: 0;
}

/* 검수 전 배지 (기본 스타일) */
.status-badge {
    background-color: #FFEDD5;
    color: #F97316;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    margin-left: auto;
}

/* 검수 완료 배지 */
.status-badge-reviewed {
    background-color: #DCFCE7;
    color: #22C55E;
}

/* 검수 수정 배지 */
.status-badge-editing {
    background-color: #E0F2FE;
    color: #0EA5E9;
}

/* 텍스트 차이 영역 스타일 */
.text-diff-container {
    background-color: #f9f9f9;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #eee;
    margin-bottom: 15px;
    max-height: 300px;
    overflow-y: auto;
    display: none; /* 처음에는 숨김 */
}

/* diff_match_patch에서 생성하는 기본 스타일 강화 */
.text-diff-container ins {
    background-color: #e6ffe6;
    text-decoration: none;
    padding: 2px 0;
    border-radius: 2px;
    display: inline-block;
}

.text-diff-container del {
    background-color: #ffe6e6;
    text-decoration: line-through;
    padding: 2px 0;
    border-radius: 2px;
    display: inline-block;
}

/* 비교 버튼 스타일 */
.compare-text-btn {
    background-color: #6c5ce7;
    color: white;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.compare-text-btn:hover {
    background-color: #5649c0;
}

/* 자동 비교 모드 스위치 스타일 */
.auto-compare-switch {
    display: flex;
    align-items: center;
    margin-left: 10px;
    font-size: 13px;
    color: #666;
    margin-right: 10px;
}

.auto-compare-switch input {
    margin-right: 5px;
}

/* 차이점 통계 스타일 */
.diff-stats {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: #555;
}

.diff-added {
    color: #22c55e;
}

.diff-deleted {
    color: #ef4444;
}

.diff-equal {
    color: #6b7280;
}

.no-diff-message {
    padding: 10px;
    color: #6b7280;
    text-align: center;
    font-style: italic;
}

/* 반응형 스타일 */
@media (max-width: 992px) {
    .stat-card {
        min-width: calc(50% - 15px);
    }
    
    .content-row {
        flex-direction: column;
    }
    
    .feedback-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .admin-header {
        padding: 12px 15px;
    }
    
    .admin-title h1 {
        font-size: 20px;
    }
    
    .search-area {
        padding: 10px;
    }
    
    .stats-area {
        gap: 10px;
    }
    
    .stat-card {
        padding: 12px;
        min-width: calc(50% - 10px);
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .content-area {
        padding: 15px;
    }
    
    th, td {
        padding: 8px 10px;
        font-size: 14px;
    }
    
    .image-preview {
        width: 40px;
        height: 40px;
    }
    
    .text-preview, .feedback-preview {
        max-width: 120px;
    }
    
    .modal-content {
        width: 95%;
        padding: 15px;
    }
    
    .detail-header h2 {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .stat-card {
        min-width: 100%;
    }
    
    .pagination button {
        padding: 5px 8px;
        min-width: 35px;
    }
}