/* 자료실 메인 페이지 스타일 */
.data-wrapper {
    max-width: 1280px;
    margin: 0 auto;
    padding: 40px 20px 60px;
}

.data-container {
    background-color: #fff;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    padding: 30px;
    width: 100%;
}

/* 검색 영역 */
.data-search-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 30px;
}

.data-search {
    display: flex;
    align-items: center;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    padding: 8px 15px;
    width: 350px;
    transition: all 0.3s;
}

.data-search:focus-within {
    border-color: var(--main-color);
    box-shadow: 0 0 0 2px rgba(255, 127, 42, 0.1);
}

.search-category {
    border: none;
    margin-right: 10px;
    padding-right: 10px;
    border-right: 1px solid #e0e0e0;
    color: var(--text-sub1);
    outline: none;
    font-size: 14px;
    background-color: transparent;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    color: var(--text-main);
    background-color: transparent;
}

.search-button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-sub2);
    transition: color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-button:hover {
    color: var(--main-color);
}

/* 자료 그리드 */
.data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.data-card {
    background-color: #fff;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 220px;
    cursor: pointer;
}

.data-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* 파일 타입별 카드 스타일 */
.file-type-pdf {
    border-top: 3px solid #F44336;
}

.file-type-doc, .file-type-docx {
    border-top: 3px solid #2196F3;
}

.file-type-ppt, .file-type-pptx {
    border-top: 3px solid #FF9800;
}

.file-type-xls, .file-type-xlsx {
    border-top: 3px solid #4CAF50;
}

.file-type-zip, .file-type-rar {
    border-top: 3px solid #9C27B0;
}

.file-type-jpg, .file-type-jpeg, .file-type-png, .file-type-gif {
    border-top: 3px solid #03A9F4;
}

.file-type-none {
    border-top: 3px solid #9E9E9E;
}

/* 새 글 배지 */
.data-new-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #FF5722;
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 10px;
    z-index: 1;
}

/* 카드 구성 요소 */
.data-card-header {
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.data-card-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
    border-radius: 50%;
    flex-shrink: 0;
}

.data-card-icon i {
    font-size: 20px;
}

.file-icon-pdf::before {
    content: "PDF";
    color: #F44336;
}

.file-icon-hwp::before {
    content: "HWP";
    color: #F44336;
}

.file-icon-doc::before, .file-icon-docx::before {
    content: "DOC";
    color: #2196F3;
}

.file-icon-ppt::before, .file-icon-pptx::before {
    content: "PPT";
    color: #FF9800;
}

.file-icon-xls::before, .file-icon-xlsx::before {
    content: "XLS";
    color: #4CAF50;
}

.file-icon-zip::before, .file-icon-rar::before {
    content: "ZIP";
    color: #9C27B0;
}

.file-icon-jpg::before, .file-icon-jpeg::before,
.file-icon-png::before, .file-icon-gif::before {
    content: "IMG";
    color: #03A9F4;
}

.file-icon-default::before {
    content: "FILE";
    color: #757575;
}

.data-card-info {
    flex: 1;
    min-width: 0; /* 텍스트 오버플로우 처리를 위함 */
}

.data-card-title {
    margin: 0 0 5px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.data-card-meta {
    display: flex;
    font-size: 12px;
    color: var(--text-sub2);
    gap: 8px;
    flex-wrap: wrap;
}

.data-card-body {
    padding: 15px;
    flex: 1;
}

.data-card-description {
    margin: 0;
    font-size: 14px;
    color: var(--text-sub1);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-height: 1.5;
}

.data-card-footer {
    padding: 10px 15px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.data-file-preview {
    flex: 1;
    min-width: 0;
}

.data-file-item {
    font-size: 12px;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-sub1);
}

.data-file-name {
    font-weight: 500;
}

.data-file-size {
    color: var(--text-sub3);
    margin-left: 6px;
}

.data-more-files {
    font-size: 12px;
    color: var(--text-sub2);
    margin-top: 2px;
}

.data-card-actions {
    display: flex;
    gap: 10px;
}

.data-card-view-btn {
    padding: 6px 12px;
    background-color: var(--main-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s;
}

.data-card-view-btn:hover {
    background-color: var(--sub-color);
}

/* 다운로드 버튼 위에서는 기본 커서 유지 */
.data-card-download,
.data-card-view-btn {
    cursor: pointer;
}

/* 데이터 비어있을 때 */
.data-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 0;
    color: var(--text-sub2);
}

.data-empty svg {
    color: #e0e0e0;
    margin-bottom: 15px;
}

.data-empty p {
    margin: 0;
    font-size: 16px;
}

/* 페이지네이션 영역 */
.data-pagination-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.data-pagination {
    display: flex;
    gap: 5px;
}

.page-item {
    width: 36px;
    height: 36px;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    color: var(--text-sub1);
    text-decoration: none;
    transition: all 0.3s;
}

.page-link:hover {
    border-color: var(--main-color);
    color: var(--main-color);
}

.page-item.active .page-link {
    background-color: var(--main-color);
    border-color: var(--main-color);
    color: white;
}

.page-item.disabled .page-link {
    background-color: #f7f7f7;
    border-color: #e0e0e0;
    color: #ccc;
    cursor: not-allowed;
}

/* 업로드 버튼 */
.data-actions {
    position: absolute;
    right: 0;
}

.data-upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: var(--main-color);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
}

.data-upload-btn:hover {
    background-color: var(--sub-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 127, 42, 0.3);
}

/* 반응형 */
@media (max-width: 1024px) {
    .data-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .data-search {
        width: 300px;
    }
}

@media (max-width: 768px) {
    .data-container {
        padding: 20px 15px;
    }

    .data-grid {
        grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
    }

    .data-search-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .data-search {
        width: 100%;
    }

    .data-pagination-wrapper {
        flex-direction: column;
        gap: 20px;
    }

    .data-actions {
        position: static;
        margin-top: 20px;
        width: 100%;
    }

    .data-upload-btn {
        width: 100%;
    }
}