/**
 * Movie Data Integration Styles
 */

/* 媒体展示容器 */
.moviedata-media-showcase {
    display: block;
    margin: 20px 0;
}

/* 网格布局 */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

/* 媒体卡片 */
.media-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    background: #fff;
}

.media-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* 海报区域 */
.media-poster {
    position: relative;
    padding-top: 150%; /* 2:3 比例 */
    background: #f8f9fa;
}

.media-poster img,
.media-poster .no-poster {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-poster .no-poster {
    background: #e9ecef;
    color: #6c757d;
    font-size: 14px;
}

/* 海报角落信息 */
.poster-corner {
    position: absolute;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 3px 6px;
    font-size: 11px;
    z-index: 2;
    border-radius: 3px;
}

.top-left {
    top: 8px;
    left: 8px;
}

.top-right {
    top: 8px;
    right: 8px;
}

.bottom-left {
    bottom: 8px;
    left: 8px;
}

.bottom-right {
    bottom: 8px;
    right: 8px;
}

/* 星级评分 */
.star {
    color: #ddd;
    font-size: 12px;
}

.star.full {
    color: #ffc107;
}

.star.half {
    color: #ffc107;
}

/* 媒体信息 */
.media-info {
    padding: 12px;
}

.media-title {
    margin: 0 0 8px;
    font-size: 15px;
    line-height: 1.4;
    font-weight: 600;
    color: #212529;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 媒体操作按钮 */
.media-actions {
    display: flex;
    gap: 5px;
    margin-top: 10px;
}

.media-actions button {
    flex: 1;
    padding: 5px;
    font-size: 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
}

/* 为网格中的按钮应用与弹窗中相同的样式 */
.media-actions .favorite-btn {
    background: #007bff;
    color: white;
}

.media-actions .favorite-btn:hover {
    background: #0056b3;
}

.media-actions .download-btn {
    background: #28a745;
    color: white;
}

.media-actions .download-btn:hover {
    background: #1e7e34;
}

.media-actions .share-btn {
    background: #ffc107;
    color: #212529;
}

.media-actions .share-btn:hover {
    background: #e0a800;
}

.media-actions .play-btn {
    background: #dc3545;
    color: white;
}

.media-actions .play-btn:hover {
    background: #c82333;
}

/* 列表布局 */
.media-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.media-list-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s ease;
    cursor: pointer;
}

.media-list-item:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.media-list-poster {
    flex: 0 0 120px;
    position: relative;
    padding-top: 180px;
    background: #f8f9fa;
    border-radius: 5px;
    overflow: hidden;
}

.media-list-poster img,
.media-list-poster .no-poster {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-list-poster .no-poster {
    background: #e9ecef;
    color: #6c757d;
    font-size: 12px;
}

.media-list-info {
    flex: 1;
}

.media-list-info .media-title {
    margin: 0 0 10px;
    font-size: 18px;
    line-height: 1.3;
}

.media-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 14px;
}

.media-meta span {
    padding: 2px 8px;
    background: #e9ecef;
    border-radius: 3px;
    color: #495057;
}

.media-excerpt {
    margin-bottom: 15px;
    color: #6c757d;
    line-height: 1.5;
}

.media-genres {
    margin-bottom: 15px;
}

.media-genres .media-genre {
    display: inline-block;
    padding: 2px 8px;
    margin-right: 5px;
    margin-bottom: 5px;
    background: #007bff;
    color: white;
    font-size: 12px;
    border-radius: 3px;
}

/* 分页控件 */
.media-pagination-controls {
    margin-top: 30px;
    padding: 20px 0;
    border-top: 1px solid #ddd;
}

.pagination-options {
    margin-bottom: 15px;
}

.pagination-options label {
    margin-right: 15px;
    font-size: 14px;
}

.pagination-nav {
    text-align: center;
}

.pagination-nav a,
.pagination-nav span {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 2px;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-decoration: none;
    color: #007bff;
}

.pagination-nav a:hover {
    background: #e9ecef;
}

.pagination-nav .current {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.infinite-scroll-container {
    text-align: center;
    margin: 20px 0;
}

.load-more-button {
    padding: 10px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.load-more-button:hover {
    background: #0056b3;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .media-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }
    
    .media-list-item {
        flex-direction: column;
        gap: 15px;
    }
    
    .media-list-poster {
        flex: 0 0 auto;
        padding-top: 50%;
    }
    
    .media-title {
        font-size: 14px;
    }
    
    .media-list-info .media-title {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .media-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .media-info {
        padding: 8px;
    }
    
    .media-title {
        font-size: 13px;
    }
}