/* 프로젝트 관리 전용 스타일 */

/* 탭 네비게이션 스타일 */
.tab-navigation {
    display: flex;
    border-bottom: 2px solid var(--gray-200);
    background: var(--gray-50);
    padding: 0 20px;
}

.tab-btn {
    padding: 12px 24px;
    border: none;
    background: none;
    cursor: pointer;
    font-weight: 600;
    color: var(--gray-600);
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    font-size: 14px;
}

.tab-btn:hover {
    color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 700;
}

.tab-content {
    padding: 20px 0;
}

/* 프로젝트 컨테이너 */
.project-container {
    max-width: 1600px;
    margin: 0 auto;
}

/* 액션 바 */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.action-bar-left,
.action-bar-right {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* 버튼 스타일 */
.btn-primary {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(118, 75, 162, 0.4);
}

.btn-secondary {
    padding: 10px 20px;
    background: var(--gray-200);
    color: var(--gray-700);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-advanced {
    padding: 10px 20px;
    background: white;
    color: var(--gray-700);
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-advanced:hover {
    border-color: #667eea;
    color: #667eea;
}

/* CSV 내보내기 버튼 */
.btn-export {
    padding: 10px 20px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-export:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

/* 옵션 관리 버튼 */
.btn-manage-options {
    padding: 4px 10px;
    background: #e0e7ff;
    color: #4f46e5;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    margin-left: 8px;
    transition: all 0.2s;
}

.btn-manage-options:hover {
    background: #c7d2fe;
}

/* 검색 입력 */
#searchInput {
    padding: 10px 16px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 14px;
    width: 300px;
    transition: all 0.2s;
}

#searchInput:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 연도 선택 */
#yearSelect {
    padding: 10px 16px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    min-width: 150px;
}

/* 상세 검색 필터 */
.advanced-filters {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

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

.filter-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
}

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

.filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* 테이블 래퍼 */
.table-wrapper {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow-x: auto;
    margin-bottom: 24px;
}

/* 프로젝트 테이블 */
.project-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1840px;
    table-layout: fixed;
}

/* 테이블 컬럼 너비 지정 */
.project-table th:nth-child(1) { width: 100px; } /* 접수일 */
.project-table th:nth-child(2) { width: 140px; } /* 업체명 +10px */
.project-table th:nth-child(3) { width: 170px; } /* 행사명 +10px */
.project-table th:nth-child(4) { width: 130px; } /* 장소 +10px */
.project-table th:nth-child(5) { width: 130px; } /* 담당자 */
.project-table th:nth-child(6) { width: 130px; } /* 현장관리 */
.project-table th:nth-child(7) { width: 100px; } /* 사전교육 */
.project-table th:nth-child(8) { width: 100px; } /* 시작일 */
.project-table th:nth-child(9) { width: 100px; } /* 종료일 */
.project-table th:nth-child(10) { width: 90px; } /* 진행현황 */
.project-table th:nth-child(11) { width: 100px; } /* 인건비지급일 */
.project-table th:nth-child(12) { width: 90px; } /* 관리단계 */
.project-table th:nth-child(13) { width: 55px; } /* 시트 */
.project-table th:nth-child(14) { width: 55px; } /* 웍스 */
.project-table th:nth-child(15) { width: 55px; } /* 채팅 */
.project-table th:nth-child(16) { width: 120px; } /* 비고 */
.project-table th:nth-child(17) { width: 120px; } /* 작업 -30px */

.project-table th {
    background: #f8f9fa;
    padding: 12px 8px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

.project-table th:hover {
    background: #e9ecef;
}

.project-table td {
    padding: 12px 8px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 13px;
    color: var(--gray-700);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 행사명 컬럼 (3번째 컬럼) 특별 처리 */
.project-table td:nth-child(3) {
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 업체명 컬럼 (2번째 컬럼) 말줄임 */
.project-table td:nth-child(2) {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 장소 컬럼 (4번째 컬럼) 말줄임 */
.project-table td:nth-child(4) {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 담당자 컬럼 (5번째 컬럼) - 2명까지 한줄 표시 */
.project-table td:nth-child(5) {
    max-width: 130px;
    min-width: 130px;
    white-space: nowrap;
    overflow: hidden;
    padding: 8px;
    vertical-align: middle;
}

/* 현장관리 컬럼 (6번째 컬럼) - 2명까지 한줄 표시 */
.project-table td:nth-child(6) {
    max-width: 130px;
    min-width: 130px;
    white-space: nowrap;
    overflow: hidden;
    padding: 8px;
    vertical-align: middle;
}

/* 비고 컬럼 (16번째 컬럼) 말줄임 */
.project-table td:nth-child(16) {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-table tbody tr:hover {
    background: #f8f9fa;
}

/* 배지 스타일 */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    margin: 1px 2px;
    white-space: nowrap;
    line-height: 1.4;
}

/* +N 배지 스타일 */
.badge-more {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    margin: 1px 2px;
    background-color: #f0f0f0;
    color: #666;
    cursor: help;
    white-space: nowrap;
    line-height: 1.4;
}

.badge-more:hover {
    background-color: #e0e0e0;
}

/* URL 버튼 */
.url-btn {
    padding: 6px 12px;
    background: #e3f2fd;
    color: #1976d2;
    border: none;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
}

.url-btn:hover {
    background: #bbdefb;
}

/* 작업 버튼 */
.action-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
}

.action-buttons button {
    padding: 6px 10px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-view {
    background: #e3f2fd;
    color: #1976d2;
}

.btn-view:hover {
    background: #bbdefb;
}

.btn-edit {
    background: #fff3e0;
    color: #f57c00;
}

.btn-edit:hover {
    background: #ffe0b2;
}

.btn-delete {
    background: #ffebee;
    color: #d32f2f;
}

.btn-delete:hover {
    background: #ffcdd2;
}

/* 페이지네이션 */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.pagination-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--gray-600);
}

#itemsPerPage {
    padding: 6px 12px;
    border: 2px solid var(--gray-200);
    border-radius: 6px;
    font-size: 13px;
    background: white;
    cursor: pointer;
}

.pagination-buttons {
    display: flex;
    gap: 6px;
}

.pagination-buttons button {
    padding: 8px 12px;
    border: 2px solid var(--gray-200);
    background: white;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-buttons button:hover {
    border-color: #667eea;
    color: #667eea;
}

.pagination-buttons button.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

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

/* 모달 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: var(--gray-900);
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--gray-900);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 24px;
    border-top: 1px solid var(--gray-200);
}

/* 폼 스타일 */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 12px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
    padding: 8px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    max-height: 150px;
    overflow-y: auto;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.checkbox-group label:hover {
    background: var(--gray-100);
}

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

/* 정렬 아이콘 */
.project-table th span {
    font-size: 10px;
    margin-left: 4px;
}

/* 반응형 */
@media (max-width: 768px) {
    .action-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .action-bar-left,
    .action-bar-right {
        width: 100%;
        flex-direction: column;
    }
    
    #searchInput {
        width: 100%;
    }
    
    .filter-row {
        grid-template-columns: 1fr;
    }
    
    /* 테이블 가로 스크롤 활성화 */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .projects-table {
        min-width: 1200px;
    }
    
    .pagination-container {
        flex-direction: column;
        gap: 12px;
    }
}

/* 히스토리 스타일 */
.history-item {
    padding: 16px;
    border-left: 3px solid #667eea;
    background: #f8f9fa;
    margin-bottom: 12px;
    border-radius: 8px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.history-user {
    font-weight: 600;
    color: var(--gray-900);
}

.history-date {
    font-size: 13px;
    color: var(--gray-600);
}

.history-action {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-left: 8px;
}

.history-action.created {
    background: #c8e6c9;
    color: #2e7d32;
}

.history-action.updated {
    background: #fff3e0;
    color: #f57c00;
}

.history-changes {
    font-size: 13px;
    color: var(--gray-700);
    line-height: 1.6;
}

.history-change-item {
    padding: 4px 0;
}

.history-change-item strong {
    color: #667eea;
}

/* 텍스트 검색 입력 */
.filter-group input[type="text"] {
    padding: 8px 12px;
    border: 2px solid var(--gray-200);
    border-radius: 6px;
    font-size: 13px;
    width: 100%;
    transition: all 0.2s;
}

.filter-group input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}
