/* From list.skin.php */
/* 📚 Research Board List Styles (Navy/Blue Theme) */
.research-board-wrap {
    background: #ffffff;
    border-top: 3px solid #1e3a8a; /* Navy Top Border */
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    margin-bottom: 40px;
}

.research-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
}

.research-table th {
    background-color: #f8fafc;
    color: #1e293b;
    font-weight: 700;
    font-size: 1rem;
    padding: 16px 10px;
    border-bottom: 1px solid #cbd5e1;
}

.research-table td {
    padding: 18px 10px;
    color: #475569;
    font-size: 1rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.research-table tbody tr {
    transition: background-color 0.2s ease;
}

.research-table tbody tr:hover {
    background-color: #f0fdf4; /* Very subtle blue/green tint on hover */
}

/* Notice Row Style */
.research-table tr.is-notice td {
    background-color: #eff6ff; /* Light blue for notice */
    font-weight: 600;
}
.notice-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #fee2e2;
    color: #ef4444;
    border: 1px solid #fecaca;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.title-cell {
    text-align: left !important;
}

.post-title-link {
    color: #1e293b;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
    display: inline-block;
    max-width: 90%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.post-title-link:hover {
    color: #2563eb;
    text-decoration: underline;
}

/* Badges & Icons */
.comment-badge {
    /* 숫자만 — 테두리도 바탕도 없다. 알약 꼴이면 카테고리 표와
       구분이 안 된다(색까지 같았다). */
    display: inline-block;
    margin-left: 6px;
    color: #ef4444;
    font-size: 0.75rem;
    font-weight: 700;
    vertical-align: middle;
}

.file-icon-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #64748b;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    border: 1px solid #e2e8f0;
}
.file-icon-badge i { color: #3b82f6; margin-right: 4px; }

/* Edit Button */
.btn-premium-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    font-size: 0.75rem;
    border-radius: 4px;
    background: #fff;
    border: 1px solid #cbd5e1;
    color: #64748b;
    margin-right: 8px;
    text-decoration: none;
    transition: all 0.2s;
    vertical-align: middle;
}
.btn-premium-edit:hover {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #3b82f6;
}

/* Pagination & Actions */
.board-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

/* 자료 등록 단추 자리 — 인라인에서 옮겨 왔다 (§10).
   인라인이 있던 힘을 그대로 두려고 이름을 세 번 겹쳐 (0,3,0) 으로 맞춘다. */
.board-actions-write.board-actions-write.board-actions-write {
    min-width: 120px;
    text-align: right;
}

.premium-pagination {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
}
.premium-pagination.mobile-only {
    display: none;
}
.premium-pagination a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #fff;
    border: 1px solid #cbd5e1;
    color: #475569;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}
.premium-pagination a:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}
.premium-pagination a.active {
    background: #1e3a8a;
    border-color: #1e3a8a;
    color: #fff;
}

/* Search Form */
.premium-search {
    display: flex;
    justify-content: center;
}
.premium-search form {
    display: flex;
    border: 2px solid #1e3a8a;
    background: #fff;
}
.premium-search select {
    border: none;
    background: #f8fafc;
    padding: 8px 15px;
    color: #1e293b;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    border-right: 1px solid #e2e8f0;
}
.premium-search input {
    border: none;
    padding: 8px 15px;
    width: 250px;
    outline: none;
    font-size: 0.95rem;
}
.premium-search button {
    background: #1e3a8a;
    color: #fff;
    border: none;
    padding: 8px 20px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.premium-search button:hover {
    background: #1e40af;
}

/* Write Button */
.btn-primary-action {
    background: #1e3a8a;
    color: #fff;
    padding: 10px 24px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    border: none;
}
.btn-primary-action:hover {
    background: #1e40af;
    color: #fff;
}

@media (max-width: 768px) {
    /* 1. 테이블 컬럼 필터링 (번호, 파일개수, 등록일, 조회수 숨김 -> 자료명과 등록자만 노출) */
    .research-table col:nth-child(1),
    .research-table col:nth-child(3),
    .research-table col:nth-child(5),
    .research-table col:nth-child(6) {
        display: none !important;
    }
    /* 등록자 컬럼의 너비를 모바일 가로폭에서 강제 확보 및 줄바꿈 방지 */
    .research-table col:nth-child(4) {
        width: 75px !important;
    }
    .research-table th:nth-child(4),
    .research-table td:nth-child(4) {
        white-space: nowrap !important;
    }
    .research-table th:nth-child(1),
    .research-table td:nth-child(1),
    .research-table th:nth-child(3),
    .research-table td:nth-child(3),
    .research-table th:nth-child(5),
    .research-table td:nth-child(5),
    .research-table th:nth-child(6),
    .research-table td:nth-child(6) {
        display: none !important;
    }
    
    /* 2. 남은 테이블 셀 스타일 최적화 */
    .research-table th, .research-table td {
        padding: 12px 6px !important;
        font-size: 0.88rem !important;
    }
    .post-title-link {
        font-size: 0.9rem !important;
        max-width: 100% !important;
        white-space: normal !important; /* 모바일에서 제목 긴 경우 줄바꿈 허용 */
        word-break: break-all !important;
    }
    .title-cell {
        padding-left: 4px !important;
    }

    /* 3. 하단 검색 폼 및 액션 영역 레이아웃 최적화 */
    .board-actions {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 20px !important;
        margin-top: 20px !important;
    }
    
    /* 검색창 100% 확보 및 미려한 디자인 */
    .premium-search {
        order: 2 !important;
        width: 100% !important;
    }
    .premium-search form {
        width: 100% !important;
        display: flex !important;
        border-radius: 6px !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }
    .premium-search select {
        padding: 8px 5px 8px 10px !important;
        font-size: 0.85rem !important;
    }
    .premium-search input {
        flex: 1 !important;
        width: auto !important;
        min-width: 0 !important;
        padding: 8px 10px !important;
        font-size: 0.85rem !important;
    }
    .premium-search button {
        padding: 8px 15px !important;
        font-size: 0.85rem !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }

    /* 페이징 버튼 모바일용 최적화 */
    .premium-pagination.pc-only {
        display: none;
    }
    .premium-pagination.mobile-only {
        display: flex !important;
        gap: 5px;
        order: 1 !important;
        justify-content: center !important;
    }
    .premium-pagination.mobile-only a {
        width: 32px;
        height: 32px;
        border-radius: 8px;
        font-size: 0.85rem;
    }

    /* 자료 등록 버튼 수평 가운데 정렬 */
    .board-actions > .board-actions-write {
        order: 3 !important;
        text-align: center !important;
        width: 100% !important;
    }
    .btn-primary-action {
        width: 100% !important;
        max-width: 100% !important;
        justify-content: center !important;
        border-radius: 6px !important;
        padding: 10px 20px !important;
        font-size: 0.9rem !important;
        box-sizing: border-box !important;
    }
}

/* From view.skin.php */
/* 📚 Research View Styles (Navy/Blue Theme) */
.view-wrapper {
    width: 100%;
    margin: 0 auto;
    background: #ffffff;
    border-top: 4px solid #1e3a8a;
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.05);
}

.view-header-area {
    padding: 40px 40px 30px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.view-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.35;
    margin-bottom: 25px;
    word-break: keep-all;
}

.view-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    font-size: 1rem;
    color: #475569;
}

.meta-item { display: flex; align-items: center; gap: 8px; }
.meta-item i { color: #94a3b8; }
.meta-divider { color: #cbd5e1; }

.view-body {
    padding: 0 40px 60px;
}

/* Featured Download Box at Top */
.top-download-box {
    margin: 40px 0;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.tdb-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1e3a8a;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.tdb-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}
.tdb-item {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    padding: 15px 20px;
    text-decoration: none;
    color: #1e293b;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.tdb-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59,130,246,0.15);
    transform: translateY(-2px);
}
.tdb-icon {
    font-size: 2rem;
    color: #ef4444; /* PDF Red */
    margin-right: 15px;
}
.tdb-info {
    flex: 1;
    overflow: hidden;
}
.tdb-name {
    font-weight: 600;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}
.tdb-meta {
    font-size: 0.85rem;
    color: #64748b;
    display: flex;
    justify-content: space-between;
}

.view-content-html {
    margin-top: 30px;
}




/* External Link */
.external-link-banner {
    display: flex; align-items: center; justify-content: space-between;
    background: #f8fafc; border-left: 4px solid #1e3a8a;
    padding: 20px 25px; margin: 40px 0; text-decoration: none; color: #1e293b; transition: all 0.2s;
    border-radius: 0 12px 12px 0;
}
.external-link-banner:hover { background: #f1f5f9; }
.external-link-info strong { display: block; font-size: 1.1rem; color: #1e3a8a; margin-bottom: 4px; }
.external-link-info span { color: #64748b; font-size: 0.95rem; }

/* Action Buttons */
.view-actions {
    background: #f8fafc;
    padding: 25px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #e2e8f0;
}
.btn-modern {
    padding: 12px 24px; font-weight: 600; font-size: 0.95rem;
    text-decoration: none; transition: all 0.2s ease; border: none; cursor: pointer;
    display: inline-flex; align-items: center; gap: 8px; border-radius: 6px;
}
.btn-list { background: #fff; color: #475569; border: 1px solid #cbd5e1; }
.btn-list:hover { background: #f1f5f9; color: #1e293b; }
.btn-primary-action { background: #1e3a8a; color: white; }
.btn-primary-action:hover { background: #1e40af; }
.btn-danger-action { background: #fff; color: #ef4444; border: 1px solid #fecaca; }
.btn-danger-action:hover { background: #fef2f2; }

@media (max-width: 768px) {
    .view-header-area { padding: 30px 20px; }
    .view-title { font-size: 1.8rem; }
    .view-body { padding: 0 20px 40px; }
    .tdb-list { grid-template-columns: 1fr; }
    .view-actions { padding: 25px 20px; flex-direction: column; gap: 15px; }
    .view-actions .action-group { width: 100%; display: flex; justify-content: space-between; }
    .prev-next-area { padding: 15px 15px !important; }
}

/* From write.skin.php */
/* 📚 Research Write Form Styles (Navy/Blue Theme) */
.write-wrapper {
    width: 100%;
    margin: 0 auto;
    background: #ffffff;
    border-top: 4px solid #1e3a8a;
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.05);
    padding: 40px;
}
.write-group {
    margin-bottom: 28px;
}
.write-label {
    display: block;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 10px;
    font-size: 1.05rem;
}
.write-input {
    width: 100%;
    padding: 16px 20px;
    background-color: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 1rem;
    color: #334155;
    transition: all 0.3s ease;
}
.write-input:focus {
    outline: none;
    background-color: #ffffff;
    border-color: #1e3a8a;
    box-shadow: 0 0 0 4px rgba(30, 58, 138, 0.1);
}
.write-input::placeholder {
    color: #94a3b8;
}

/* Callout Boxes */
.feature-box {
    padding: 24px;
    border-radius: 8px;
    margin-bottom: 28px;
    transition: transform 0.2s ease;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}
.feature-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}
.feature-title {
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: #1e3a8a;
}

/* Custom Checkboxes */
.custom-checkbox-wrap {
    display: flex;
    gap: 24px;
    margin-top: 14px;
}
.custom-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    color: #475569;
    user-select: none;
}
.custom-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #1e3a8a;
    cursor: pointer;
}

/* File Upload Area */
.file-upload-area {
    background: #eff6ff;
    border: 2px dashed #93c5fd;
    border-radius: 8px;
    padding: 40px 30px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}
.file-upload-area:hover {
    border-color: #3b82f6;
    background: #dbeafe;
}
.file-upload-area input[type="file"] {
    display: block;
    margin: 0 auto;
    font-size: 1rem;
    color: #64748b;
}

/* Buttons */
.btn-submit {
    background: #1e3a8a;
    color: white;
    padding: 16px 48px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-submit:hover {
    background: #1e40af;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30,58,138,0.3);
}
.btn-cancel {
    background: #f1f5f9;
    color: #475569;
    padding: 16px 40px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid #cbd5e1;
}
.btn-cancel:hover {
    background: #e2e8f0;
    color: #1e293b;
}

@media (max-width: 768px) {
    .write-wrapper { padding: 25px 20px; }
    .custom-checkbox-wrap { flex-direction: column; gap: 12px; }
}

@media (max-width: 768px) {
    .section-padding { padding-bottom: 100px !important; }
}
