/* ============================================================
   tender.css - 招標及詢價頁面獨立樣式
   ============================================================ */

/* ============================================================
   頁面容器
   ============================================================ */
   
/* ============================================================
   頂部 Header - LOGO 最左邊
   ============================================================ */
/* ============================================================
   側邊欄下拉選單樣式
   ============================================================ */

/* 側邊欄下拉選單容器 */
.sidebar-dropdown {
    position: relative;
}

/* 下拉觸發按鈕 */
.sidebar-dropdown .dropdown-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.sidebar-dropdown .dropdown-toggle .arrow {
    transition: transform 0.3s ease;
    font-size: 0.7rem;
    margin-left: auto;
}

.sidebar-dropdown .dropdown-toggle .arrow.open {
    transform: rotate(180deg);
}

/* 子選單 - 預設隱藏 */
.sidebar-submenu {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

/* 子選單 - 展開狀態 */
.sidebar-submenu.open {
    max-height: 300px;
    opacity: 1;
}

/* 子選單連結 */
.sidebar-submenu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 1.5rem 6px 3.5rem;
    color: #6f8aa3;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.2s;
}

.sidebar-submenu a:hover,
.sidebar-submenu a.active {
    color: #1a3c5e;
    background: #f5f8fc;
}

/* 側邊欄下拉選單 - 展開時添加背景 */
.sidebar-dropdown.open > .dropdown-toggle {
    background: #f5f8fc;
    color: #1a3c5e;
}

/* ============================================================
   導航下拉選單
   ============================================================ */
.nav-dropdown {
    position: relative;
}

.nav-dropdown .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
    border: 1px solid #e6edf5;
    padding: 8px 0;
    z-index: 100;
    overflow: hidden;
}

.nav-dropdown .dropdown-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 20px;
    width: 16px;
    height: 16px;
    background: white;
    transform: rotate(45deg);
    border-left: 1px solid #e6edf5;
    border-top: 1px solid #e6edf5;
}

.nav-dropdown:hover .dropdown-menu {
    display: block;
    animation: dropdownFadeIn 0.3s ease;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-dropdown .dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: #3b5e7c;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.nav-dropdown .dropdown-menu a i {
    font-size: 1.1rem;
    color: #6f8aa3;
    transition: all 0.3s;
    width: 24px;
    text-align: center;
}

.nav-dropdown .dropdown-menu a:hover {
    background: #f5f8fc;
    color: #1a3c5e;
    border-left-color: #1a3c5e;
    transform: translateX(4px);
}

.nav-dropdown .dropdown-menu a:hover i {
    color: #1a3c5e;
    transform: scale(1.2) rotate(-5deg);
}

.nav-dropdown .dropdown-menu a:nth-child(1):hover { border-left-color: #f59e0b; }
.nav-dropdown .dropdown-menu a:nth-child(1):hover i { color: #f59e0b; }
.nav-dropdown .dropdown-menu a:nth-child(2):hover { border-left-color: #3b82f6; }
.nav-dropdown .dropdown-menu a:nth-child(2):hover i { color: #3b82f6; }
.nav-dropdown .dropdown-menu a:nth-child(3):hover { border-left-color: #10b981; }
.nav-dropdown .dropdown-menu a:nth-child(3):hover i { color: #10b981; }
.nav-dropdown .dropdown-menu a:nth-child(4):hover { border-left-color: #8b5cf6; }
.nav-dropdown .dropdown-menu a:nth-child(4):hover i { color: #8b5cf6; }


.news-page .main-content {
    max-width: 1500px;
    margin: 0 auto;
    padding: 2rem;
    height: auto;
    min-height: 80vh;
}

.news-page .section-news {
    padding: 1rem 0;
}

.news-page .section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.news-page .section-title {
    font-size: 2rem;
    font-weight: 700;
    color: #0f263b;
}

.news-page .section-divider {
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #1a3c5e, #6f8aa3);
    margin: 0.5rem auto 1rem;
    border-radius: 4px;
}

/* ============================================================
   過濾器與更多連結
   ============================================================ */
.news-header-modern {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.news-title-section {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    width: 100%;
}

.filter-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-group .filter-btn {
    padding: 4px 16px;
    border: 2px solid #e9ecef;
    border-radius: 30px;
    background: transparent;
    color: #6c757d;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-group .filter-btn:hover {
    border-color: #1a3c5e;
    color: #1a3c5e;
    background: rgba(26, 60, 94, 0.04);
}

.filter-group .filter-btn.active {
    border-color: #1a3c5e;
    background: #1a3c5e;
    color: #fff;
}

.more-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #1a3c5e;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 4px 12px;
    border-radius: 30px;
    background: #e8f0fe;
    white-space: nowrap;
    margin-left: auto;
}

.more-link:hover {
    background: #d4e4f7;
    transform: translateX(3px);
}

/* ============================================================
   文件列表 - 每行一個文件 (articles 風格)
   ============================================================ */
.article-list-modern {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 文件項目 - 兩行佈局 */
.doc-item {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e8ecf1;
    padding: 16px 20px;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    gap: 8px;
}

.doc-item:hover {
    border-color: #1a3c5e;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

/* 第一行：文件類別 + 標題 */
.doc-row-top {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

/* 分類標籤 */
.category-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 40px;
    padding: 0.2rem 0.8rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
    flex-shrink: 0;
}

.category-badge.tender {
    background: #fef3c7;
    color: #92400e;
}

.category-badge.hr {
    background: #dbeafe;
    color: #1d4ed8;
}

.category-badge.news {
    background: #dbeafe;
    color: #1d4ed8;
}

.category-badge.announcement {
    background: #fef3c7;
    color: #92400e;
}

.category-badge.general {
    background: #e2e8f0;
    color: #475569;
}

/* 標題 */
.doc-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-width: 0;
}

/* 第二行：發佈日期 + 附件數量 + 了解更多 */
.doc-row-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.doc-meta-left {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.doc-date {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: #6f7d95;
}

.doc-date i {
    color: #94a3b8;
    font-size: 0.75rem;
}

.doc-attachment {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: #6f7d95;
}

.doc-attachment i {
    color: #94a3b8;
    font-size: 0.75rem;
}

/* 了解更多按鈕 */
.doc-read-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 16px;
    background: #1a3c5e;
    color: white;
    border-radius: 40px;
    font-size: 0.8rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    font-family: inherit;
    white-space: nowrap;
    flex-shrink: 0;
}

.doc-read-btn:hover {
    background: #2a5f8a;
    transform: translateX(2px);
}

.doc-read-btn i {
    font-size: 0.65rem;
    transition: transform 0.25s ease;
}

.doc-read-btn:hover i {
    transform: translateX(3px);
}

/* ============================================================
   載入中 & 空狀態
   ============================================================ */
.loading-spinner-modern {
    text-align: center;
    padding: 40px 0;
    color: #94a3b8;
}

.loading-spinner-modern i {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
}

.empty-message-modern {
    text-align: center;
    padding: 40px 0;
    color: #94a3b8;
}

.empty-message-modern i {
    font-size: 3rem;
    margin-bottom: 12px;
    display: block;
    opacity: 0.4;
}

/* ============================================================
   分頁
   ============================================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 16px;
    margin-top: 16px;
    border-top: 1px solid #e6edf5;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: 2px solid #e6edf5;
    border-radius: 10px;
    background: white;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

.page-btn:hover:not(:disabled) {
    border-color: #1a3c5e;
    color: #1a3c5e;
    background: #f5f8fc;
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    gap: 4px;
}

.page-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #6f8aa3;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.page-num:hover {
    background: #f5f8fc;
    color: #1a3c5e;
}

.page-num.active {
    background: #1a3c5e;
    color: white;
    border-color: #1a3c5e;
}

.page-num.dots {
    cursor: default;
}

.page-num.dots:hover {
    background: transparent;
    color: #6f8aa3;
}

/* ============================================================
   響應式設計
   ============================================================ */
@media (max-width: 768px) {
	
	.news-page .section-news {
		padding-bottom: 8rem;
	}
	
    .news-page .main-content {
        padding: 1rem;
    }

    .news-header-modern {
        flex-direction: column;
        align-items: flex-start;
    }

    .news-title-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .filter-group {
        width: 100%;
    }

    .filter-group .filter-btn {
        font-size: 0.65rem;
        padding: 3px 12px;
    }

    .more-link {
        margin-left: 0;
        font-size: 0.75rem;
        padding: 3px 10px;
    }

    .doc-item {
        padding: 14px 16px;
        border-radius: 10px;
    }

    .doc-row-top {
        gap: 10px;
    }

    .doc-title {
        font-size: 0.95rem;
    }

    .doc-row-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .doc-meta-left {
        gap: 12px;
    }

    .doc-read-btn {
        padding: 4px 14px;
        font-size: 0.75rem;
        width: 100%;
        justify-content: center;
    }

    .category-badge {
        font-size: 0.6rem;
        padding: 0.1rem 0.6rem;
    }

    .doc-date,
    .doc-attachment {
        font-size: 0.75rem;
    }

    .pagination {
        justify-content: center;
    }

    .page-btn span {
        display: none;
    }

    .page-btn {
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {
    .news-page .section-title {
        font-size: 1.5rem;
    }

    .filter-group .filter-btn {
        font-size: 0.55rem;
        padding: 2px 10px;
    }

    .doc-item {
        padding: 10px 12px;
        border-radius: 8px;
    }

    .doc-row-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .doc-title {
        font-size: 0.9rem;
        -webkit-line-clamp: 2;
    }

    .doc-meta-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .doc-read-btn {
        font-size: 0.7rem;
        padding: 4px 12px;
    }

    .page-num {
        min-width: 30px;
        height: 30px;
        font-size: 0.75rem;
    }

    .page-btn {
        font-size: 0.7rem;
        padding: 4px 10px;
    }

    .page-btn i {
        font-size: 0.6rem;
    }
}