/* ============================================
   bidlist.php - 拍賣品列表頁面
   完整優化 CSS
   ============================================ */

/* ===== 全域變數 ===== */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --light-bg: #f8f9fa;
    --dark-bg: #2c3e50;
    --border-color: #dee2e6;
    --text-muted: #6c757d;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.16);
    --transition: all 0.3s ease;
}

/* ============================================
   頁面標題區
   ============================================ */
.page-header-area {
    position: relative;
    padding: 60px 0 40px;
    background-size: cover;
    background-position: center;
    color: #fff;
}

.page-header-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(44, 62, 80, 0.6);
    border-radius: 0 0 var(--radius) var(--radius);
}

.page-header-area .container {
    position: relative;
    z-index: 1;
}

.page-header-content .breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
    justify-content: center;
}

.page-header-content .breadcrumb li {
    color: rgba(255,255,255,0.8);
    font-size: 0.95rem;
}

.page-header-content .breadcrumb a {
    color: #fff;
    text-decoration: none;
    transition: var(--transition);
}

.page-header-content .breadcrumb a:hover {
    color: var(--warning-color);
    text-decoration: underline;
}

.page-header-content .breadcrumb-sep {
    color: rgba(255,255,255,0.4);
    padding: 0 10px;
}

/* ============================================
   拍賣品卡片
   ============================================ */
.auction-card {
    transition: var(--transition);
    height: 100%;
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    background: #fff;
}

.auction-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.auction-card .card-img-top {
    height: 220px;
    object-fit: cover;
    background: var(--light-bg);
    transition: var(--transition);
}

.auction-card:hover .card-img-top {
    transform: scale(1.03);
}

.auction-card .card-img-top-wrapper {
    overflow: hidden;
    position: relative;
}

.auction-card .card-img-top-wrapper .badge-status {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 14px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
}

.auction-card .card-img-top-wrapper .badge-status.active {
    background: var(--success-color);
    color: #fff;
}

.auction-card .card-img-top-wrapper .badge-status.ended {
    background: var(--text-muted);
    color: #fff;
}

.auction-card .card-img-top-wrapper .badge-status.hot {
    background: var(--danger-color);
    color: #fff;
    animation: pulse-badge 1.5s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.auction-card .card-body {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.auction-card .card-title {
    font-size: 0.95rem;
    font-weight: 600;
    min-height: 48px;
    margin-bottom: 10px;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.auction-card .card-title a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.auction-card .card-title a:hover {
    color: var(--secondary-color);
}

/* 價格 */
.auction-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--danger-color);
}

.auction-price .currency {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auction-price .original-price {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: line-through;
    font-weight: 400;
    margin-left: 6px;
}

/* 倒數計時 */
.auction-timer {
    font-size: 0.85rem;
    color: var(--secondary-color);
    font-weight: 500;
    padding: 4px 0;
}

.auction-timer .timer-icon {
    margin-right: 4px;
}

.auction-timer.urgent {
    color: var(--danger-color);
    animation: pulse-timer 1s ease-in-out infinite;
}

@keyframes pulse-timer {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 元資料 */
.auction-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.auction-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.auction-meta .meta-item i {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* 賣家名稱 */
.auction-meta .seller-name {
    color: var(--primary-color);
    font-weight: 500;
}

.auction-meta .seller-name:hover {
    color: var(--secondary-color);
}

/* 查看詳情按鈕 */
.auction-card .btn-detail {
    background: transparent;
    border: 2px solid var(--secondary-color);
    color: var(--secondary-color);
    border-radius: 50px;
    padding: 6px 20px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: var(--transition);
    width: 100%;
    margin-top: 10px;
}

.auction-card .btn-detail:hover {
    background: var(--secondary-color);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* ============================================
   側邊欄
   ============================================ */
.shop-sidebar-wrapper {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    margin-bottom: 20px;
}

.sidebar-item {
    margin-bottom: 24px;
}

.sidebar-item:last-child {
    margin-bottom: 0;
}

.sidebar-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 14px;
}

.sidebar-title a {
    color: var(--primary-color);
    text-decoration: none;
}

.sidebar-title a:hover {
    color: var(--secondary-color);
}

/* 側邊欄搜尋 */
.search-box .input-group {
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.search-box .form-control {
    border: 2px solid var(--border-color);
    border-right: none;
    padding: 10px 14px;
    font-size: 0.9rem;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    transition: var(--transition);
}

.search-box .form-control:focus {
    border-color: var(--secondary-color);
    box-shadow: none;
}

.search-box .btn-primary {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 10px 16px;
    background: var(--secondary-color);
    border: 2px solid var(--secondary-color);
}

.search-box .btn-primary:hover {
    background: #2980b9;
    border-color: #2980b9;
}

/* 側邊欄選單 */
.sidebar-body ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-body ul li {
    padding: 6px 0;
    border-bottom: 1px solid #f0f2f5;
}

.sidebar-body ul li:last-child {
    border-bottom: none;
}

.sidebar-body ul li a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.sidebar-body ul li a:hover {
    color: var(--secondary-color);
    padding-left: 4px;
}

.sidebar-body ul li a img {
    width: 16px;
    height: 16px;
}

.sidebar-body ul li a .badge-count {
    background: var(--secondary-color);
    color: #fff;
    font-size: 0.65rem;
    padding: 1px 8px;
    border-radius: 50px;
    margin-left: auto;
}

/* ============================================
   空狀態
   ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.empty-state i {
    font-size: 4rem;
    color: #dee2e6;
    margin-bottom: 16px;
}

.empty-state h4 {
    color: var(--primary-color);
    font-weight: 600;
}

.empty-state p {
    color: var(--text-muted);
    max-width: 400px;
    margin: 8px auto 0;
}

/* ============================================
   分頁
   ============================================ */
.pagination {
    gap: 4px;
}

.pagination .page-link {
    border: none;
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    color: var(--primary-color);
    font-weight: 500;
    transition: var(--transition);
    background: transparent;
}

.pagination .page-link:hover {
    background: var(--light-bg);
    color: var(--secondary-color);
}

.pagination .page-item.active .page-link {
    background: var(--secondary-color);
    color: #fff;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.pagination .page-item.disabled .page-link {
    color: var(--text-muted);
    opacity: 0.5;
}

.pagination .page-item .page-link i {
    font-size: 0.8rem;
}

/* ============================================
   結果統計
   ============================================ */
.result-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.result-stats h4 {
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
}

.result-stats h4 .highlight {
    color: var(--secondary-color);
}

.result-stats .badge-count {
    background: var(--light-bg);
    color: var(--text-muted);
    padding: 4px 14px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* ============================================
   響應式設計
   ============================================ */

/* 平板 */
@media (max-width: 992px) {
    .auction-card .card-img-top {
        height: 180px;
    }
    
    .auction-card .card-title {
        font-size: 0.9rem;
        min-height: 40px;
    }
    
    .auction-price {
        font-size: 1.1rem;
    }
}

/* 手機 */
@media (max-width: 768px) {
    .page-header-area {
        padding: 40px 0 30px;
    }
    
    .page-header-content .breadcrumb li {
        font-size: 0.85rem;
    }
    
    .auction-card .card-img-top {
        height: 200px;
    }
    
    .auction-card .card-title {
        font-size: 0.9rem;
        min-height: 42px;
    }
    
    .auction-price {
        font-size: 1.1rem;
    }
    
    .auction-meta {
        font-size: 0.75rem;
    }
    
    .result-stats {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .result-stats h4 {
        font-size: 1.1rem;
    }
    
    .shop-sidebar-wrapper {
        padding: 16px;
    }
    
    .pagination .page-link {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
}

/* 小手機 */
@media (max-width: 576px) {
    .page-header-area {
        padding: 30px 0 20px;
    }
    
    .page-header-content .breadcrumb li {
        font-size: 0.75rem;
    }
    
    .page-header-content .breadcrumb-sep {
        padding: 0 6px;
    }
    
    .auction-card .card-img-top {
        height: 160px;
    }
    
    .auction-card .card-body {
        padding: 12px 14px 14px;
    }
    
    .auction-card .card-title {
        font-size: 0.85rem;
        min-height: 36px;
    }
    
    .auction-price {
        font-size: 1rem;
    }
    
    .auction-timer {
        font-size: 0.75rem;
    }
    
    .auction-meta {
        font-size: 0.7rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    
    .auction-card .btn-detail {
        font-size: 0.75rem;
        padding: 5px 16px;
    }
    
    .result-stats h4 {
        font-size: 0.95rem;
    }
    
    .result-stats .badge-count {
        font-size: 0.75rem;
        padding: 2px 10px;
    }
    
    .shop-sidebar-wrapper {
        padding: 12px;
    }
    
    .sidebar-title {
        font-size: 0.95rem;
    }
    
    .sidebar-body ul li a {
        font-size: 0.8rem;
    }
    
    .search-box .form-control {
        font-size: 0.8rem;
        padding: 8px 12px;
    }
    
    .search-box .btn-primary {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    .pagination .page-link {
        padding: 4px 10px;
        font-size: 0.75rem;
    }
    
    .empty-state {
        padding: 40px 16px;
    }
    
    .empty-state i {
        font-size: 3rem;
    }
    
    .empty-state h4 {
        font-size: 1rem;
    }
    
    .empty-state p {
        font-size: 0.85rem;
    }
}

/* ============================================
   動畫與特效
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.auction-card {
    animation: fadeInUp 0.5s ease-out;
}

.auction-card:nth-child(1) { animation-delay: 0.05s; }
.auction-card:nth-child(2) { animation-delay: 0.10s; }
.auction-card:nth-child(3) { animation-delay: 0.15s; }
.auction-card:nth-child(4) { animation-delay: 0.20s; }
.auction-card:nth-child(5) { animation-delay: 0.25s; }
.auction-card:nth-child(6) { animation-delay: 0.30s; }

/* ============================================
   工具類
   ============================================ */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }

/* ============================================
   暗色主題支援 (可選)
   ============================================ */
@media (prefers-color-scheme: dark) {
    :root {
        --light-bg: #1a1a2e;
        --dark-bg: #0d0d1a;
        --border-color: #2d2d44;
        --text-muted: #8888aa;
        --primary-color: #e8e8f0;
    }
    
    .auction-card {
        background: #16213e;
    }
    
    .auction-card .card-title a {
        color: #e8e8f0;
    }
    
    .auction-card .card-title a:hover {
        color: var(--secondary-color);
    }
    
    .shop-sidebar-wrapper {
        background: #16213e;
    }
    
    .sidebar-title {
        color: #e8e8f0;
        border-bottom-color: var(--border-color);
    }
    
    .sidebar-body ul li a {
        color: var(--text-muted);
    }
    
    .sidebar-body ul li a:hover {
        color: var(--secondary-color);
    }
    
    .empty-state {
        background: #16213e;
    }
    
    .empty-state h4 {
        color: #e8e8f0;
    }
    
    .bid-info {
        background: #16213e;
        border-color: var(--border-color);
    }
    
    .product-review-tabs-content {
        background: #16213e;
    }
    
    .nav-tabs {
        background: #1a1a2e;
        border-bottom-color: var(--border-color);
    }
    
    .nav-tabs .nav-link {
        color: var(--text-muted);
    }
    
    .nav-tabs .nav-link.active {
        color: var(--secondary-color);
    }
    
    .qa-question {
        background: #1a1a2e;
    }
    
    .qa-answer {
        background: #0d2a1a;
    }
    
    #qaFormContainer {
        background: #1a1a2e;
        border-color: var(--border-color);
    }
    
    .question-textarea {
        background: #0d0d1a;
        color: #e8e8f0;
        border-color: var(--border-color);
    }
    
    .question-textarea:focus {
        border-color: var(--secondary-color);
    }
    
    .records-container .table th {
        background: #1a1a2e;
        color: #e8e8f0;
    }
    
    .records-container .table td {
        color: #c0c0d0;
    }
    
    .records-container .table tr:hover {
        background: #1a1a2e;
    }
    
    .left_contentpro {
        border-bottom-color: var(--border-color);
    }
    
    .left_contentprodesc .name a {
        color: #e8e8f0;
    }
    
    .left_contentprodesc .name a:hover {
        color: var(--secondary-color);
    }
    
    .pagination .page-link {
        color: #c0c0d0;
    }
    
    .pagination .page-link:hover {
        background: #1a1a2e;
        color: var(--secondary-color);
    }
}
