/**
 * MoviePilot 弹窗详情样式
 */

/* 弹窗样式 - 上下左右居中 */
.moviepilot-modal {
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.moviepilot-modal.show {
    opacity: 1;
    visibility: visible;
    display: flex;
}

.moviepilot-modal-content {
    background-color: #fff;
    padding: 0;
    border-radius: 10px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.moviepilot-modal.show .moviepilot-modal-content {
    transform: translateY(0);
}

.moviepilot-modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 15px;
    z-index: 1001;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.moviepilot-modal-close:hover,
.moviepilot-modal-close:focus {
    color: #000;
    background-color: rgba(0,0,0,0.1);
}

/* 弹窗内容区域 */
.modal-media-content {
    padding: 30px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-media-header {
    display: flex;
    gap: 25px;
    margin-bottom: 25px;
}

.modal-media-poster {
    flex: 0 0 30%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.modal-media-poster img {
    width: 100%;
    height: auto;
    display: block;
}

.modal-media-poster .no-poster {
    width: 100%;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e9ecef;
    color: #6c757d;
    font-size: 18px;
    font-weight: 500;
}

.modal-media-details {
    flex: 1;
}

.modal-media-title {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 28px;
    font-weight: 700;
    color: #212529;
}

/* 新增的信息框样式 */
.modal-media-info-box {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 20px;
    font-size: 13px; /* 适当缩小字体 */
}

.modal-media-meta-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 15px; /* 添加间距 */
}

.modal-media-meta-line:last-child {
    margin-bottom: 0;
}

.modal-media-meta-item {
    color: #495057;
    flex: 1; /* 使项目均匀分布 */
    white-space: nowrap; /* 防止换行 */
    overflow: hidden;
    text-overflow: ellipsis; /* 超出部分显示省略号 */
}

.modal-media-overview {
    margin: 20px 0;
    line-height: 1.7;
    color: #495057;
}

.modal-media-overview h4 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 16px;
    color: #212529;
}

.modal-media-overview p {
    margin: 0;
    font-size: 14px;
}

.modal-media-cast {
    margin: 30px 0;
    color: #495057;
}

.modal-media-cast h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 20px;
    color: #212529;
}

.cast-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
}

.cast-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.cast-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 50%;
    background: #e9ecef;
}

.cast-name {
    font-weight: 600;
    color: #212529;
    text-align: center;
}

.cast-character {
    font-size: 14px;
    color: #6c757d;
    text-align: center;
}

.cast-loading {
    font-style: italic;
    color: #6c757d;
    text-align: center;
    padding: 20px;
}

/* 按钮区域样式 */
.modal-media-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

.modal-media-actions button {
    padding: 8px 16px; /* 缩小按钮内边距 */
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    font-size: 13px; /* 适当缩小字体 */
    transition: background-color 0.2s;
    flex: 1; /* 按钮平均分布 */
    text-align: center;
}

.modal-media-actions .favorite-btn {
    background: #007bff;
    color: white;
}

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

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

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

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

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

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

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

@media (max-width: 768px) {
    .moviepilot-modal-content {
        width: 95%;
        margin: 20px auto;
    }
    
    .modal-media-header {
        flex-direction: column;
    }
    
    .modal-media-poster {
        flex: none;
        width: 100%;
    }
    
    .modal-media-title {
        font-size: 22px;
    }
    
    .modal-media-content {
        padding: 20px;
    }
    
    /* 信息框在移动端的调整 */
    .modal-media-info-box {
        font-size: 12px;
    }
    
    .modal-media-meta-line {
        flex-direction: column;
        gap: 5px;
    }
    
    /* 移动端按钮调整 */
    .modal-media-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .modal-media-actions button {
        flex: 1 1 45%;
        margin-bottom: 10px;
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .modal-media-overview h4 {
        font-size: 14px;
    }
    
    .modal-media-overview p {
        font-size: 12px;
    }
}