/**
 * 列表側邊欄樣式 - list-sidebar.css
 * 包含自定義列表側邊欄和相關功能
 */

/* 自定義列表側邊欄 */
.custom-list-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.custom-list-sidebar.open {
    visibility: visible;
    opacity: 1;
}

.list-sidebar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.list-sidebar-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 400px;
    height: 100vh;
    background: white;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
}

.custom-list-sidebar.open .list-sidebar-content {
    transform: translateX(0);
}

.list-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
    flex-shrink: 0;
    /* display: flex;
    align-items: center;
    justify-content: space-between; */
}

.list-header #placeCount {
    font-size: .8rem;
}

.list-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.list-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.list-close-btn:hover {
    background: #e9ecef;
    color: #333;
}

.list-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* 列表項目樣式（在側邊欄中的變體） */
.list-content .place-item {
    border: 1px solid #eee;
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.list-content .place-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.list-content .place-item-content {
    flex: 1;
    min-width: 0;
}

.list-content .place-item-image {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.list-content .place-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.list-content .place-item-image .no-image {
    color: #999;
    font-size: 20px;
}

.list-content .place-name {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 14px;
    color: #333;
    line-height: 1.3;
}

.list-content .place-address {
    color: #666;
    font-size: 12px;
    margin-bottom: 6px;
    line-height: 1.3;
}

.list-content .place-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
}

.list-content .rating-stars {
    color: #ffc107;
    font-size: 12px;
}

.list-content .place-distance {
    position: absolute;
    top: -5px;
    right: 10px;
    background: #de4a9c;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    color: #fff;
}

/* 列表統計資訊 */
.list-stats {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
    font-size: 14px;
    color: #666;
    text-align: center;
}

.list-stats .total-count {
    font-weight: 600;
    color: #333;
}

/* 列表載入狀態 */
.list-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #666;
}

.list-loading .loading-spinner {
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 空狀態 */
.list-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #666;
    text-align: center;
}

.list-empty .empty-icon {
    font-size: 48px;
    color: #ccc;
    margin-bottom: 15px;
}

.list-empty .empty-message {
    font-size: 16px;
    margin-bottom: 10px;
    font-weight: 500;
}

.list-empty .empty-description {
    font-size: 14px;
    color: #999;
}

/* 列表分頁 */
.list-pagination {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.list-pagination button {
    padding: 6px 12px;
    border: 1px solid #dee2e6;
    background: white;
    color: #333;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.list-pagination button:hover {
    background: #e9ecef;
}

.list-pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.list-pagination .page-info {
    font-size: 12px;
    color: #666;
    margin: 0 10px;
}

#customListSidebar #place_count {
    font-size: .8rem;
}

/* 響應式設計 */
@media (max-width: 1100px) {
    .list-content {
        padding-bottom: 70px !important;
    }
}

@media (max-width: 768px) {
    /* 手機版側邊欄全寬 */
    .list-sidebar-content {
        width: 100vw;
    }

    .list-header {
        padding: 15px 20px;
        font-size: .8rem;
    }

    .list-header h3 {
        font-size: 16px;
    }

    .list-content {
        padding: 15px 20px;
    }

    .list-content .place-item {
        padding: 10px;
        gap: 8px;
    }

    .list-content .place-item-image {
        width: 50px;
        height: 50px;
    }

    .list-content .place-name {
        font-size: 13px;
    }

    .list-content .place-address {
        font-size: 11px;
    }

    .list-content .place-distance {
        position: static;
        align-self: flex-start;
        margin: 0 0 5px;
        font-size: 12px;
        width: fit-content;
    }

     .list-content {
        padding-bottom: 50px;
    }

    .list-stats {
        padding: 12px 20px;
        font-size: 13px;
    }

    .list-pagination {
        padding: 12px 20px;
    }

    .list-pagination button {
        padding: 5px 10px;
        font-size: 11px;
    }
}