/* BIM Library 前端樣式 */

.bimlib-product-list {
    display: flex;
    gap: 30px;
    margin: 20px 0;
}

/* 篩選側邊欄 */
.bimlib-filter-sidebar {
    width: 250px;
    flex-shrink: 0;
    background: #f5f5f5;
    padding: 20px;
    border-radius: 5px;
}

.bimlib-filter-sidebar h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 18px;
}

.bimlib-category-item {
    margin-bottom: 15px;
}

.bimlib-subcategories {
    margin-left: 20px;
    margin-top: 10px;
}

.bimlib-subcategory {
    margin-bottom: 8px;
}

.bimlib-category-item label,
.bimlib-subcategory label {
    display: block;
    cursor: pointer;
}

.bimlib-category-item .count,
.bimlib-subcategory .count {
    color: #666;
    font-size: 12px;
    margin-left: 5px;
}

/* 主內容區域 */
.bimlib-products-main {
    flex: 1;
}

/* 工具欄 */
.bimlib-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.bimlib-title h2 {
    margin: 0;
    font-size: 24px;
}

.bimlib-sort {
    display: flex;
    align-items: center;
    gap: 15px;
}

.all-count {
    color: #666;
}

#bimlib-sort-select {
    padding: 8px 30px 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
}

/* 產品網格 */
.bimlib-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.bimlib-product-item {
    background: white;
    border: 1px solid #eee;
    border-radius: 5px;
    overflow: hidden;
    transition: box-shadow 0.3s;
}

.bimlib-product-item:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.product-image {
    text-align: center;
    background: #f9f9f9;
}

.product-image img {
    display: block;
    max-width: 100%;
    height: auto;
}

.product-info {
    padding: 15px;
}

.product-title {
    margin: 0 0 10px;
    font-size: 16px;
    line-height: 1.4;
}

.product-title a {
    color: #333;
    text-decoration: none;
}

.product-title a:hover {
    color: #007cba;
}

.product-publisher {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

.bimlib-download-btn {
    width: 100%;
    padding: 10px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.bimlib-download-btn:hover {
    background: #005a87;
}

/* 模態框 */
#bimlib-login-modal,
#bimlib-register-modal,
#bimlib-download-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.bimlib-modal-content {
    position: relative;
    background-color: #fefefe;
    margin: 5% auto;
    padding: 30px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 5px;
}

.bimlib-close {
    position: absolute;
    right: 20px;
    top: 10px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.bimlib-close:hover {
    color: black;
}

/* 分頁 */
.bimlib-pagination {
    text-align: center;
    margin: 30px 0;
}

.bimlib-pagination .page-numbers {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 4px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
}

.bimlib-pagination .page-numbers.current {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

.bimlib-pagination .page-numbers:hover {
    background: #f5f5f5;
}

/* 下載檔案列表 */
#bimlib-download-files {
    margin: 20px 0;
}

.download-file-item {
    padding: 10px;
    margin-bottom: 5px;
    background: #f5f5f5;
    border-radius: 4px;
}

.download-file-item a {
    color: #007cba;
    text-decoration: none;
}

.download-file-item a:hover {
    text-decoration: underline;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .bimlib-product-list {
        flex-direction: column;
    }
    
    .bimlib-filter-sidebar {
        width: 100%;
    }
    
    .bimlib-toolbar {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
}