/* 메인타이틀 섹션 */
.main_title_sec {
    min-height: 100vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    color: #ffffff !important;
    width: 100% !important;
    text-align: center !important;
    overflow: hidden !important;
}

.main_title_sec .bd-xl {
    padding: 0;
}

.main_title_sec .background-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.main_title_sec::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.6) 100%);
    z-index: 1;
}

.main_title_content {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    width: 100%;
    text-align: center;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0 auto;
}

.main_title_text {
    padding: 0 20px;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.main_title_text h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    text-align: center;
    width: 100%;
}

.main_title_text h1 .highlight {
    color: #00D1E9;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.main_title_text p {
    font-size: clamp(1.1rem, 2.2vw, 1.5rem);
    line-height: 1.6;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    text-align: center;
    width: 100%;
}

/* 작업현황 게시판 메인 스타일 */
.workboard-section { padding: 40px 0; background: #f9f9f9; margin-top: 80px; }

/* 기존 이미지 라벨 스타일 - 제거됨 (X 버튼과 겹치는 문제로) */

/* 작업현황 게시판 네비게이션 */
.workboard-nav { margin-bottom: 20px; }
.workboard-nav .bread { display: flex; align-items: center; gap: 8px; }
.workboard-nav .bread .home { display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; background: none !important; }
.workboard-nav .bread .home i { font-size: 14px; color: #666; display: block !important; width: auto !important; aspect-ratio: auto !important; background: none !important; }
.workboard-nav .bread i.fas.fa-chevron-right { font-size: 10px; color: #ccc; display: block !important; width: auto !important; aspect-ratio: auto !important; background: none !important; border-radius: 0 !important; }
.workboard-nav .bread .now { font-size: 14px; color: #3373c9; font-weight: 600; }

.workboard-container { background: #fff; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); padding: 32px; }
.workboard-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.workboard-actions { display: flex; gap: 10px; }
.upload-btn, .logout-btn, .login-btn { background: #3373c9; color: #fff; border: none; border-radius: 4px; padding: 8px 20px; font-size: 1rem; cursor: pointer; transition: background 0.2s; }
.upload-btn:hover, .logout-btn:hover, .login-btn:hover { background: #00b9d4; }
.logout-btn { background: #dc3545; }
.logout-btn:hover { background: #c82333; }
.login-btn { background: #28a745; }
.login-btn:hover { background: #218838; }

/* 갤러리 그리드 (브라우저 호환성 개선) - 12개 게시글 최적화 */
.gallery-grid {
    display: -ms-grid; /* IE 11 지원 */
    display: grid;
    -ms-grid-columns: (minmax(280px, 1fr))[auto-fit]; /* IE 11 지원 */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    -ms-grid-column-gap: 20px; /* IE 11 지원 */
    -ms-grid-row-gap: 20px; /* IE 11 지원 */
    padding: 20px;
}

/* IE 11 폴백 */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    .gallery-grid {
        display: -ms-flexbox;
        display: flex;
        -ms-flex-wrap: wrap;
        flex-wrap: wrap;
        margin: -10px;
    }
    
    .work-item {
        -ms-flex: 0 0 calc(33.333% - 20px);
        flex: 0 0 calc(33.333% - 20px);
        margin: 10px;
    }
}

/* 작업 아이템 (브라우저 호환성 개선) */
.work-item {
    background: #fff;
    border-radius: 12px;
    -webkit-border-radius: 12px; /* Safari 구버전 지원 */
    -moz-border-radius: 12px; /* Firefox 구버전 지원 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    -webkit-box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* Safari/Chrome 구버전 지원 */
    -moz-box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* Firefox 구버전 지원 */
    overflow: hidden;
    -webkit-transition: -webkit-transform 0.3s ease, -webkit-box-shadow 0.3s ease; /* Safari/Chrome */
    -moz-transition: -moz-transform 0.3s ease, -moz-box-shadow 0.3s ease; /* Firefox */
    -o-transition: -o-transform 0.3s ease, box-shadow 0.3s ease; /* Opera */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    /* IE 10+ 지원 */
    -ms-transition: -ms-transform 0.3s ease, box-shadow 0.3s ease;
}

.work-item:hover {
    -webkit-transform: translateY(-4px); /* Safari/Chrome */
    -moz-transform: translateY(-4px); /* Firefox */
    -ms-transform: translateY(-4px); /* IE 9+ */
    -o-transform: translateY(-4px); /* Opera */
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    -webkit-box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    -moz-box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* 이미지 컨테이너 */
.work-image-container {
    position: relative;
    height: 200px;
    overflow: hidden;
}

/* 대표 이미지 */
.main-image {
    width: 100%;
    height: 100%;
    position: relative;
}

.work-main-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    -o-object-fit: cover; /* Opera 지원 */
    -webkit-transition: -webkit-transform 0.3s ease;
    -moz-transition: -moz-transform 0.3s ease;
    -o-transition: -o-transform 0.3s ease;
    transition: transform 0.3s ease;
    background: #f5f5f5;
    /* IE 11 폴백 - object-fit 미지원 시 */
    font-family: 'object-fit: cover;';
}

.work-main-image:hover {
    -webkit-transform: scale(1.05);
    -moz-transform: scale(1.05);
    -ms-transform: scale(1.05);
    -o-transform: scale(1.05);
    transform: scale(1.05);
}

/* 이미지 로딩 및 오류 처리 */
.work-main-image[src*="img/work/01.jpg"] {
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
}

.work-main-image:not([src]) {
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
}

/* 추가 이미지들 (브라우저 호환성 개선) */
.sub-images {
    position: absolute;
    bottom: 8px;
    right: 8px;
    display: -webkit-box; /* Safari 구버전 */
    display: -moz-box; /* Firefox 구버전 */
    display: -ms-flexbox; /* IE 10 */
    display: -webkit-flex; /* Safari */
    display: flex;
    gap: 4px;
    /* IE 11 폴백 */
    -ms-flex-direction: row;
    -webkit-flex-direction: row;
    flex-direction: row;
}

/* IE 11에서 gap 미지원 시 폴백 */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    .sub-images .work-sub-image {
        margin-left: 4px;
    }
    .sub-images .work-sub-image:first-child {
        margin-left: 0;
    }
}

.work-sub-image {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    background: #f5f5f5;
}

/* 이미지 없음 */
.no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    color: #999;
    font-size: 14px;
    flex-direction: column;
    gap: 8px;
}

.no-image::before {
    content: "📷";
    font-size: 24px;
    opacity: 0.5;
}

/* 작업 정보 */
.work-info {
    padding: 16px;
}

.work-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.work-category {
    background: #007bff;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.work-date {
    color: #666;
    font-size: 12px;
}

.work-title {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
}

.work-author {
    margin: 0 0 8px 0;
    color: #666;
    font-size: 14px;
}

.work-content-preview {
    color: #555;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 8px;
}

.more-images {
    text-align: right;
    font-size: 12px;
    color: #007bff;
    font-weight: 500;
}

/* 페이지네이션 (브라우저 호환성 개선) */
.pagination {
    display: -webkit-box;
    display: -moz-box;
    display: -ms-flexbox;
    display: -webkit-flex;
    display: flex;
    -webkit-box-pack: center;
    -moz-box-pack: center;
    -ms-flex-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    padding: 20px;
}

.pagination-controls {
    display: -webkit-box;
    display: -moz-box;
    display: -ms-flexbox;
    display: -webkit-flex;
    display: flex;
    gap: 8px;
    -webkit-box-align: center;
    -moz-box-align: center;
    -ms-flex-align: center;
    -webkit-align-items: center;
    align-items: center;
}

/* IE 11에서 gap 미지원 시 폴백 */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    .pagination-controls .page-btn {
        margin-left: 8px;
    }
    .pagination-controls .page-btn:first-child {
        margin-left: 0;
    }
}

.page-btn {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    color: #333;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.page-btn:hover {
    background: #f8f9fa;
    border-color: #007bff;
}

.page-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* 업로드 폼 */
.upload-form { max-width: 600px; margin: 0 auto; background: #fff; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); padding: 32px; }
.form-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.cancel-btn { background: #eee; color: #333; border: none; border-radius: 4px; padding: 6px 16px; font-size: 1rem; cursor: pointer; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; color: #3373c9; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 4px; font-size: 1rem; }
.form-group textarea { min-height: 120px; }
.form-buttons { text-align: right; }
.submit-btn { background: #3373c9; color: #fff; border: none; border-radius: 4px; padding: 10px 28px; font-size: 1rem; cursor: pointer; }
.submit-btn:hover { background: #00b9d4; }

/* 이미지 업로드 */
.image-upload { margin-bottom: 10px; }
.upload-area { border: 2px dashed #ddd; border-radius: 8px; padding: 40px; text-align: center; cursor: pointer; transition: border-color 0.3s ease; background: #fafafa; }
.upload-area:hover { border-color: #007bff; background: #f0f8ff; }
.upload-area.dragover { border-color: #007bff; background: #e6f3ff; }
.upload-area i { font-size: 48px; color: #ccc; margin-bottom: 16px; display: block; }
.upload-area p { margin: 0 0 8px 0; color: #333; font-size: 16px; }
.upload-area span { color: #666; font-size: 14px; }

/* 이미지 미리보기 */
.image-preview { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.image-preview-item { position: relative; width: 100px; height: 100px; border-radius: 8px; overflow: hidden; border: 2px solid #ddd; }
.image-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.image-preview-item .delete-btn { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; background: rgba(255,0,0,0.8); color: white; border: none; border-radius: 50%; cursor: pointer; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.image-preview-item .delete-btn:hover { background: rgba(255,0,0,1); }

/* 작업 상세 보기 */
.work-detail { max-width: 800px; margin: 0 auto; background: #fff; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); padding: 32px; }
.detail-header { margin-bottom: 24px; }
.back-btn { background: #6c757d; color: #fff; border: none; border-radius: 4px; padding: 8px 16px; font-size: 1rem; cursor: pointer; }
.back-btn:hover { background: #5a6268; }

.work-header { margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid #eee; }
.work-header h2 { margin: 0 0 12px 0; font-size: 24px; color: #333; }
.work-meta { display: flex; gap: 16px; flex-wrap: wrap; }
.work-meta span { background: #f8f9fa; padding: 4px 8px; border-radius: 4px; font-size: 14px; color: #666; }

.work-body { margin-bottom: 24px; }
.work-body p { line-height: 1.6; color: #333; margin-bottom: 16px; }

/* 작업 이미지 */
.work-images { margin-top: 20px; }
.work-images img { max-width: 100%; height: auto; border-radius: 8px; margin-bottom: 10px; cursor: pointer; transition: transform 0.3s ease; }
.work-images img:hover { transform: scale(1.02); }

/* 작업 액션 */
.work-actions { display: flex; gap: 10px; margin-bottom: 32px; }
.edit-btn, .delete-btn { padding: 8px 16px; border: none; border-radius: 4px; cursor: pointer; font-size: 1rem; }
.edit-btn { background: #ffc107; color: #333; }
.edit-btn:hover { background: #e0a800; }
.delete-btn { background: #dc3545; color: #fff; }
.delete-btn:hover { background: #c82333; }

/* 댓글 섹션 */
.comments-section { border-top: 1px solid #eee; padding-top: 24px; }
.comments-section h3 { margin: 0 0 16px 0; color: #333; }

.comment-form { margin-bottom: 24px; }
.comment-input-group { display: flex; flex-direction: column; gap: 12px; }
.comment-input-group input, .comment-input-group textarea { padding: 10px; border: 1px solid #ddd; border-radius: 4px; font-size: 1rem; }
.comment-input-group textarea { min-height: 80px; resize: vertical; }
.comment-submit-btn { background: #007bff; color: #fff; border: none; border-radius: 4px; padding: 10px 20px; font-size: 1rem; cursor: pointer; align-self: flex-start; }
.comment-submit-btn:hover { background: #0056b3; }

.comments-list { }
.comment-item { background: #f8f9fa; border-radius: 8px; padding: 16px; margin-bottom: 12px; }
.comment-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.comment-author { font-weight: 600; color: #333; }
.comment-date { color: #666; font-size: 14px; }
.delete-comment-btn { background: #dc3545; color: #fff; border: none; border-radius: 4px; padding: 4px 8px; font-size: 12px; cursor: pointer; }
.delete-comment-btn:hover { background: #c82333; }
.comment-content { color: #333; line-height: 1.5; }

/* 이미지 모달 */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.image-modal img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

/* 로딩 상태 */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #666;
}

.loading::before {
    content: "";
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* IE 11 전용 스타일 */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    /* object-fit 폴백 */
    .work-main-image {
        width: 100%;
        height: 200px;
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
    }
    
    /* flexbox 폴백 */
    .workboard-header {
        display: block;
    }
    
    .workboard-actions {
        margin-top: 16px;
        text-align: center;
    }
    
    /* grid 폴백은 이미 위에서 처리됨 */
}

/* PC 큰 화면에서 중앙 정렬 강화 */
@media screen and (min-width: 1200px) {
    .main_title_content {
        max-width: 1400px;
        padding: 0 40px;
    }
    
    .main_title_text {
        max-width: 800px;
        margin: 0 auto;
    }
    
    .main_title_text h1 {
        font-size: clamp(3rem, 4vw, 5rem);
    }
    
    .main_title_text p {
        font-size: clamp(1.2rem, 1.8vw, 1.8rem);
        max-width: 700px;
    }
}

/* 메인타이틀 섹션 반응형 */
@media screen and (max-width: 768px) {
    .main_title_sec {
        background-attachment: scroll !important;
        min-height: 90vh !important;
    }
    
    .main_title_text h1 {
        font-size: clamp(2rem, 4vw, 3rem);
        margin-bottom: 20px;
    }
    
    .main_title_text p {
        font-size: clamp(1rem, 1.8vw, 1.3rem);
        max-width: 400px;
    }
    
    .main_title_content {
        gap: 40px;
        padding: 0 20px;
    }
}

/* 반응형 디자인 - 12개 게시글 최적화 */
@media (max-width: 1200px) {
    .gallery-grid { 
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); 
    }
}

@media (max-width: 768px) {
    .workboard-container { padding: 20px; }
    .gallery-grid { 
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); 
        padding: 10px; 
    }
    .workboard-header { flex-direction: column; gap: 16px; align-items: stretch; }
    .workboard-actions { justify-content: center; }
    .work-meta { flex-direction: column; gap: 8px; }
    .work-actions { flex-direction: column; }
    .comment-input-group { gap: 8px; }
}

@media (max-width: 600px) {
    .gallery-grid { 
        grid-template-columns: 1fr; 
    }
}

@media (max-width: 480px) {
    .workboard-section { padding: 20px 0; }
    .workboard-container { padding: 16px; }
    .upload-form, .work-detail { padding: 20px; }
    .work-header h2 { font-size: 20px; }
    .work-meta { font-size: 12px; }
}