/**
 * 직원목록 커스텀 출력/저장 모달 스타일
 * - 모달 오버레이 및 컨테이너
 * - 그룹별 체크박스 레이아웃
 * - 미리보기 테이블
 * - 반응형 디자인
 */

/* ===== 모달 오버레이 ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease-out;
}

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

/* ===== 모달 컨테이너 ===== */
.custom-export-modal-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 1600px;
    width: 98%;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
}

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

/* ===== 모달 헤더 ===== */
.custom-export-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px;
    border-bottom: 2px solid #e5e7eb;
    background: white;
    border-radius: 16px 16px 0 0;
    gap: 16px;
}

.custom-export-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
    display: flex;
    align-items: center;
    flex: 1;
}

/* 액션 버튼 영역 (제목과 같은 행) */
.custom-export-actions-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: auto;
    margin-left: 16px;
}

/* 인라인 버튼 크기 조정 (미니멀) */
.custom-export-actions-inline .custom-export-btn-icon {
    width: 36px;
    height: 36px;
    font-size: 1rem;
}

.custom-export-close-btn {
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: #6b7280;
}

.custom-export-close-btn:hover {
    background: #e5e7eb;
    color: #374151;
    transform: rotate(90deg);
}

/* ===== 모달 본문 ===== */
.custom-export-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

/* ===== 액션 버튼 영역 (아이콘만) ===== */
.custom-export-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-bottom: 16px;
}

.custom-export-btn-icon {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.custom-export-btn-icon.custom-export-btn-save {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.custom-export-btn-icon.custom-export-btn-save:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.custom-export-btn-icon.custom-export-btn-print {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.custom-export-btn-icon.custom-export-btn-print:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* ===== 컬럼 선택 영역 (컴팩트 4행) ===== */
.custom-export-selection-minimal {
    display: flex;
    flex-direction: column;
    gap: 4px; /* 6px → 4px 축소 */
    margin-bottom: 12px; /* 16px → 12px 축소 */
    padding: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.custom-export-row {
    display: flex;
    align-items: center;
    gap: 8px; /* 10px → 8px 축소 */
    padding: 6px 12px; /* 10px 16px → 6px 12px 축소 */
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: all 0.2s;
}

.custom-export-row:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
    border-color: #cbd5e1;
}

/* 그룹 체크박스 라벨 */
.custom-export-group-checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}

.custom-export-group-checkbox-label:hover {
    opacity: 0.8;
}

.custom-export-group-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #3b82f6;
    flex-shrink: 0;
}

/* indeterminate 상태 스타일링 (일부 선택) */
.custom-export-group-checkbox:indeterminate {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

.custom-export-row-title {
    font-size: 0.75rem; /* 0.85rem → 0.75rem 축소 */
    font-weight: 600;
    color: #6b7280;
    white-space: nowrap;
    min-width: 80px; /* 90px → 80px 축소 */
    display: flex;
    align-items: center;
    gap: 4px; /* 6px → 4px 축소 */
    margin: 0;
}

.custom-export-row-title i {
    font-size: 0.8rem; /* 0.9rem → 0.8rem 축소 */
}

.custom-export-row-items {
    display: flex;
    flex-wrap: wrap;
    gap: 6px; /* 8px → 6px 축소 */
    flex: 1;
}

.custom-export-checkbox-label {
    display: flex;
    align-items: center;
    gap: 4px; /* 5px → 4px 축소 */
    padding: 4px 8px; /* 6px 10px → 4px 8px 축소 */
    border-radius: 4px; /* 6px → 4px 축소 */
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.75rem; /* 0.85rem → 0.75rem 축소 */
    color: #4b5563;
    background: transparent;
    border: none;
}

.custom-export-checkbox-label:hover {
    background: transparent;
    color: #3b82f6;
}

.custom-export-checkbox-label.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: transparent;
}

.custom-export-checkbox-label input[type="checkbox"] {
    width: 13px; /* 14px → 13px 축소 */
    height: 13px; /* 14px → 13px 축소 */
    cursor: pointer;
    accent-color: #8b5cf6;
}

.custom-export-checkbox-label.disabled input[type="checkbox"] {
    cursor: not-allowed;
}

/* ===== 미리보기 영역 ===== */
.custom-export-preview {
    background: #f0f9ff;
    border: 2px solid #bfdbfe;
    border-radius: 8px;
    padding: 16px;
    max-height: 500px;
    display: flex;
    flex-direction: column;
}

.custom-export-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.custom-export-preview-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e40af;
    margin: 0;
    display: flex;
    align-items: center;
}

.custom-export-apply-btn {
    padding: 6px 16px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.custom-export-apply-btn:hover {
    background: #2563eb;
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}

.custom-export-apply-btn:active {
    transform: translateY(0);
}

.custom-export-preview-container {
    overflow-x: auto;
    overflow-y: auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    flex: 1;
    min-height: 200px;
    max-width: 100%;
}

/* ===== 미리보기 테이블 ===== */
.custom-export-table {
    width: auto;
    min-width: 100%;
    border-collapse: separate; /* separate로 변경 - 테두리 겹침 방지 */
    border-spacing: 0;
    font-size: 0.875rem;
    table-layout: auto;
    border: 0.3px solid #e5e7eb; /* 외곽선 */
}

.custom-export-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.custom-export-table thead th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    border-right: 0.3px solid rgba(255, 255, 255, 0.2); /* 얇은 테두리 */
    border-bottom: 0.3px solid rgba(255, 255, 255, 0.2); /* 얇은 테두리 */
    border-left: 0; /* 좌측 제거 */
    border-top: 0; /* 상단 제거 */
    min-width: 80px;
}

.custom-export-table thead th:first-child {
    border-left: 0.3px solid rgba(255, 255, 255, 0.2);
}

.custom-export-table thead tr:first-child th {
    border-top: 0.3px solid rgba(255, 255, 255, 0.2);
}

.custom-export-table tbody td {
    padding: 10px 16px;
    border-right: 0.3px solid #e5e7eb; /* 우측 테두리만 */
    border-bottom: 0.3px solid #e5e7eb; /* 하단 테두리만 */
    border-left: 0; /* 좌측 제거 */
    border-top: 0; /* 상단 제거 */
    color: #374151;
    white-space: nowrap;
    min-width: 80px;
}

.custom-export-table tbody td:first-child {
    border-left: 0.3px solid #e5e7eb;
}

.custom-export-table tbody tr:hover {
    background: #f9fafb;
}

/* ===== 반응형 디자인 ===== */
@media (max-width: 1024px) {
    .custom-export-modal-content {
        max-width: 95%;
    }
}

@media (max-width: 768px) {
    .custom-export-header {
        padding: 16px 20px;
    }
    
    .custom-export-title {
        font-size: 1.25rem;
    }
    
    .custom-export-body {
        padding: 16px 20px;
    }
    
    .custom-export-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .custom-export-row-title {
        min-width: auto;
    }
    
    .custom-export-row-items {
        width: 100%;
    }
}

/* ===== 스크롤바 커스터마이징 ===== */
.custom-export-body::-webkit-scrollbar {
    width: 8px;
}

.custom-export-body::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.custom-export-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.custom-export-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.custom-export-preview-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.custom-export-preview-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.custom-export-preview-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.custom-export-preview-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

