/* 자료실 목록 스타일 */
.library-container {
    margin-bottom: 30px;
}

.search-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-form select,
.search-form input,
.search-form button {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.search-form select {
    min-width: 80px;
}

.search-form input {
    min-width: 200px;
}

.search-form button {
    background: #007bff;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-form button:hover {
    background: #0056b3;
}

.library-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.library-table th,
.library-table td {
    padding: 12px;
    /* text-align: left; */
    border-bottom: 1px solid #ddd;
}

.library-table th {
    background: #f8f9fa;
    font-weight: 600;
}

.library-table tr:hover {
    background: #f5f5f5;
}

/* 파일크기, 조회수 컬럼 우측정렬 */
.library-table th:nth-child(4),
.library-table th:nth-child(5),
.library-table td:nth-child(4),
.library-table td:nth-child(5) {
    text-align: right;
}

.file-title {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.file-title:hover {
    text-decoration: underline;
}

.file-size {
    color: #333;
    font-size: 14px;
    font-weight: 500;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #333;
}

.pagination .current {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.category-filter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    gap: 20px;
}

.filter-left {
    display: flex;
    align-items: center;
}

.filter-center {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: center;
}

.filter-right {
    display: flex;
    align-items: center;
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

.category-group {
    display: flex;
    gap: 10px;
    margin-right: 30px;
}

.category-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
}

.category-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.category-btn:hover {
    background: #f8f9fa;
    border-color: #007bff;
}

.category-btn.active:hover {
    background: #0056b3;
}

.category-badge {
    background: #e9ecef;
    color: #495057;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
}



/* 페이징 디자인 개선 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    text-decoration: none;
    color: #333;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background: #f8f9fa;
    border-color: #007bff;
    color: #007bff;
    transform: translateY(-1px);
}

.pagination .current {
    background: #007bff;
    color: white;
    border-color: #007bff;
    font-weight: 600;
}

.pagination .nav-btn {
    font-size: 18px;
    font-weight: bold;
    background: #f8f9fa;
    border-color: #ccc;
}

.pagination .nav-btn:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* 모바일 대응 반응형 스타일 */
@media (max-width: 768px) {
    .category-filter {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
        padding: 15px;
    }
    
    .filter-left,
    .filter-center,
    .filter-right {
        width: 100%;
        justify-content: center;
    }
    
    .category-group {
        flex-wrap: wrap;
        justify-content: center;
        margin-right: 0;
        gap: 8px;
    }
    
    .category-btn {
        font-size: 13px;
        padding: 6px 12px;
    }
    
    .search-form {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }
    
    .search-form select,
    .search-form input,
    .search-form button {
        width: 100%;
        max-width: 250px;
        margin: 0 auto;
    }
    
    .search-form input {
        min-width: auto;
    }
}

@media (max-width: 600px) {
    /* 테이블을 카드 형태로 변경 */
    .library-table,
    .library-table thead,
    .library-table tbody,
    .library-table th,
    .library-table td,
    .library-table tr {
        display: block;
    }
    
    .library-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .library-table tr {
        border: 1px solid #ddd;
        border-radius: 8px;
        margin-bottom: 15px;
        padding: 15px;
        background: white;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .library-table td {
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding: 8px 0 8px 30%;
        text-align: left !important;
    }
    
    .library-table td:last-child {
        border-bottom: none;
    }
    
    .library-table td:before {
        content: attr(data-label) ": ";
        position: absolute;
        left: 0;
        width: 25%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: 600;
        color: #333;
    }
    
    /* 페이징 모바일 최적화 */
    .pagination {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .pagination a,
    .pagination span {
        min-width: 35px;
        height: 35px;
        font-size: 13px;
        padding: 0 8px;
    }
    
    .pagination .nav-btn {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .library-container {
        padding: 0 10px;
    }
    
    .category-filter {
        padding: 10px;
    }
    
    .category-group {
        gap: 5px;
    }
    
    .category-btn {
        font-size: 12px;
        padding: 5px 10px;
    }
    
    .library-table tr {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .library-table td {
        padding: 6px 0 6px 35%;
    }
    
    .library-table td:before {
        width: 30%;
        font-size: 13px;
    }
    
    .pagination a,
    .pagination span {
        min-width: 32px;
        height: 32px;
        font-size: 12px;
        padding: 0 6px;
    }
    
    .filter-right {
        font-size: 14px;
    }
}
