/**
 * ?�放歷�?�??
 * ?�本: v20251120-20
 */

/* ?�放歷�?容器 */
.playback-history-container {
    padding: 20px;
    height: 100%;
    overflow-y: auto;
}

/* 歷�?標�??�??*/
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.history-header h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.history-header h3 i {
    margin-right: 8px;
    color: #4db8a8;
}

.btn-refresh {
    padding: 8px 16px;
    background: #4db8a8;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-refresh:hover {
    background: #3a9d8f;
    transform: translateY(-2px);
}

.btn-refresh i {
    margin-right: 5px;
}

/* 歷�??�表 */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 500px;
    /* ?��?高度 */
    overflow-y: auto;
    padding-right: 5px;
}

/* 歷�??��? */
.history-card {
    display: flex;
    gap: 15px;
    align-items: stretch;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: relative;
}

.history-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(77, 184, 168, 0.15);
    border-color: #4db8a8;
}

/* ?��?左�?（�?題、日?�、設?��?*/
.history-card-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ?��??��?（�??�、�??�、影?��?訊�?*/
.history-card-right {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
    min-width: 200px;
}

/* 歷程刪除按鈕（仿 media-delete-btn） */
.history-delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10;
    font-size: 14px;
    padding: 0;
}

.history-delete-btn:hover {
    background: #c0392b;
    transform: scale(1.1);
}

.history-card:hover .history-delete-btn {
    opacity: 1;
}

/* 縮�?網格（左?��?- ?��?顯示 */
.history-card .schedule-thumbnail-grid {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 90px;
    height: 90px;
    border-radius: 8px;
    overflow: hidden;
    display: grid;
    gap: 2px;
    flex-shrink: 0;
    background: #f5f5f5;
    z-index: auto !important;
}

/* 縮�?佔�?�?*/
.history-card .schedule-thumbnail-placeholder {
    position: relative !important;
    grid-column: auto !important;
    grid-row: auto !important;
    width: 90px;
    height: 90px;
    border-radius: 8px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 32px;
    flex-shrink: 0;
}

.history-card .schedule-thumbnail-grid.one {
    grid-template-columns: 1fr;
}

.history-card .schedule-thumbnail-grid.two {
    grid-template-columns: 1fr 1fr;
}

.history-card .schedule-thumbnail-grid.three {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.history-card .schedule-thumbnail-item {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.history-card .schedule-thumbnail-grid.three .schedule-thumbnail-item:first-child {
    grid-column: 1 / 3;
}

.history-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.history-title i {
    color: #4db8a8;
    font-size: 18px;
}

/* ?�?��?�?*/
.history-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-playing {
    background: #d4edda;
    color: #155724;
}

.status-paused {
    background: #fff3cd;
    color: #856404;
}

.status-completed {
    background: #d1ecf1;
    color: #0c5460;
}

.status-stopped {
    background: #f8d7da;
    color: #721c24;
}

.status-unknown {
    background: #e2e3e5;
    color: #383d41;
}

.history-info-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #666;
    white-space: nowrap;
}

.history-info-item i {
    color: #999;
    font-size: 13px;
    width: 14px;
}

/* ?��?底部 */
.history-card-footer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.history-log-id {
    font-size: 12px;
    color: #999;
    font-family: monospace;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 載入�?*/
.loading-placeholder {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.loading-placeholder i {
    font-size: 48px;
    color: #4db8a8;
    margin-bottom: 15px;
}

.loading-placeholder p {
    font-size: 16px;
    margin: 0;
}

/* 空�???*/
.empty-placeholder {
    text-align: center;
    padding: 80px 20px;
    color: #999;
}

.empty-placeholder i {
    font-size: 60px;
    color: #ddd;
    margin-bottom: 20px;
}

.empty-placeholder p {
    font-size: 16px;
    margin: 0;
}

/* ?�誤?�??*/
.error-placeholder {
    text-align: center;
    padding: 60px 20px;
    color: #dc3545;
}

.error-placeholder i {
    font-size: 48px;
    margin-bottom: 15px;
}

.error-placeholder p {
    font-size: 16px;
    margin: 0 0 8px 0;
    font-weight: 600;
}

.error-placeholder small {
    font-size: 14px;
    color: #999;
}

/* ?��?容器（獨立在 history-list 外�? */
.history-pagination-wrapper {
    margin-top: 15px;
}

/* ?��??�制 */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

/* ?��?容器 */
.history-cards-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pagination-btn {
    padding: 8px 16px;
    background: #4db8a8;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.pagination-btn:hover:not(:disabled) {
    background: #3a9d8f;
    transform: translateY(-2px);
}

.pagination-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.pagination-info {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* ?��?式設�?*/
@media (max-width: 768px) {
    .history-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .history-card {
        flex-direction: column;
    }

    .history-card-right {
        align-items: flex-start;
    }
}

