/**
 * XGPlayer Recommendation System Styles
 */

/* Menu Button - Minimalist Modern Style */
.menu-btn {
    padding: 6px 12px;
    background: transparent;
    color: #e0e0e0;
    border: 1px solid #404040;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    margin-right: 12px;
    white-space: nowrap;
    font-weight: 500;
}

.menu-btn:hover {
    background: rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.5);
    color: #fff;
}

.menu-btn:active {
    background: rgba(102, 126, 234, 0.25);
    border-color: rgba(102, 126, 234, 0.7);
}

.menu-btn i {
    font-size: 12px;
}

/* Menu Bar Layout */
.xgplayer-video-container .episode-menu {
    justify-content: flex-start !important;
    gap: 8px;
}

/* Recommendation Modal - Minimalist Modern */
.recommendation-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
}

.recommendation-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    cursor: pointer;
    backdrop-filter: blur(2px);
}

.recommendation-modal-content {
    position: relative;
    background: linear-gradient(135deg, #2d2d2d 0%, #1e1e1e 100%);
    border: 1px solid #404040;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    z-index: 10001;
}

.recommendation-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.recommendation-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: #e0e0e0;
}

.recommendation-modal-actions {
    display: flex;
    gap: 8px;
}

.recommendation-modal-refresh,
.recommendation-modal-close {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.recommendation-modal-refresh:hover,
.recommendation-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.recommendation-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.recommendation-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #999;
    padding: 60px 20px;
    font-size: 14px;
}

.recommendation-loading i {
    font-size: 18px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.recommendation-empty {
    text-align: center;
    color: #999;
    padding: 60px 20px;
    font-size: 14px;
}

.recommendation-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

/* Recommendation Item Container */
.recommendation-item {
    position: relative;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.recommendation-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
}

/* Recommendation Item Image */
.recommendation-item-image {
    width: 100%;
    height: 90px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.4);
}

.recommendation-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.recommendation-item:hover .recommendation-item-image img {
    transform: scale(1.05);
}

/* Recommendation Item Content */
.recommendation-item-content {
    padding: 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.recommendation-item-title {
    margin: 0 0 6px 0;
    font-size: 12px;
    font-weight: 500;
    color: #e0e0e0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Recommendation Item Meta */
.recommendation-item-meta {
    display: flex;
    gap: 6px;
    font-size: 10px;
    color: #999;
    margin: 4px 0 auto 0;
}

.recommendation-item-views {
    display: flex;
    align-items: center;
    gap: 2px;
}

.recommendation-item-views i {
    font-size: 8px;
}

/* Recommendation Item Actions */
.recommendation-item-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

/* Action Buttons */
.recommendation-item-play,
.recommendation-item-collect {
    flex: 1;
    padding: 6px 4px;
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 4px;
    background: rgba(102, 126, 234, 0.15);
    color: #667eea;
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    transition: all 0.2s ease;
}

.recommendation-item-play:hover,
.recommendation-item-collect:hover {
    background: rgba(102, 126, 234, 0.3);
    border-color: rgba(102, 126, 234, 0.6);
    color: #fff;
}

/* Collected State */
.recommendation-item-collect.collected {
    background: rgba(102, 126, 234, 0.3);
    border-color: rgba(102, 126, 234, 0.6);
    color: #fff;
}

.recommendation-item-collect.collected:hover {
    background: rgba(102, 126, 234, 0.4);
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .recommend-item-actions {
        opacity: 1;
    }

    .recommend-item-title {
        font-size: 13px;
    }

    .recommend-item-meta {
        font-size: 11px;
    }
}


/* Recommendation Player Modal */
.recommendation-player-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
}

.recommendation-player-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    cursor: pointer;
    backdrop-filter: blur(3px);
}

.recommendation-player-content {
    position: relative;
    background: linear-gradient(135deg, #2d2d2d 0%, #1e1e1e 100%);
    border: 1px solid #404040;
    border-radius: 8px;
    width: 90%;
    max-width: 900px;
    height: 85vh;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    z-index: 10001;
}

.recommendation-player-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.recommendation-player-title-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.recommendation-player-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: #e0e0e0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recommendation-player-episode {
    font-size: 12px;
    color: #999;
    font-weight: normal;
}

.recommendation-player-close {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 20px;
    padding: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 4px;
    margin-left: 12px;
}

.recommendation-player-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.recommendation-player-body {
    flex: 1;
    overflow: hidden;
    padding: 16px;
    background: rgba(0, 0, 0, 0.3);
}

.recommendation-player-container {
    width: 100%;
    height: 100%;
    background: #000;
    border-radius: 4px;
    overflow: hidden;
}

.recommendation-player-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    gap: 12px;
    justify-content: center;
}

.recommendation-player-next,
.recommendation-player-link {
    padding: 8px 20px;
    background: rgba(102, 126, 234, 0.2);
    border: 1px solid rgba(102, 126, 234, 0.4);
    border-radius: 4px;
    color: #667eea;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.recommendation-player-next:hover:not(:disabled),
.recommendation-player-link:hover {
    background: rgba(102, 126, 234, 0.3);
    border-color: rgba(102, 126, 234, 0.6);
    color: #fff;
}

.recommendation-player-next:disabled {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.2);
    color: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Responsive Design for Player Modal */

/* 平板设备 (768px - 1024px) */
@media (max-width: 1024px) {
    .recommendation-player-content {
        width: 95%;
        max-width: 800px;
        height: 80vh;
        max-height: 80vh;
    }

    .recommendation-player-header h3 {
        font-size: 15px;
    }

    .recommendation-player-episode {
        font-size: 11px;
    }
}

/* 手机设备 (480px - 768px) */
@media (max-width: 768px) {
    .recommendation-player-content {
        width: 98%;
        max-width: 100%;
        height: 90vh;
        max-height: 90vh;
        border-radius: 4px;
    }

    .recommendation-player-header {
        padding: 12px 16px;
    }

    .recommendation-player-header h3 {
        font-size: 14px;
    }

    .recommendation-player-episode {
        font-size: 11px;
    }

    .recommendation-player-close {
        width: 28px;
        height: 28px;
        font-size: 18px;
    }

    .recommendation-player-body {
        padding: 12px;
    }

    .recommendation-player-footer {
        flex-direction: column;
        padding: 12px 16px;
        gap: 8px;
    }

    .recommendation-player-next,
    .recommendation-player-link {
        width: 100%;
        padding: 10px 16px;
        font-size: 12px;
    }
}

/* 小屏幕手机 (320px - 480px) */
@media (max-width: 480px) {
    .recommendation-player-content {
        width: 100%;
        height: 95vh;
        max-height: 95vh;
        border-radius: 0;
    }

    .recommendation-player-header {
        padding: 10px 12px;
    }

    .recommendation-player-header h3 {
        font-size: 13px;
    }

    .recommendation-player-episode {
        font-size: 10px;
    }

    .recommendation-player-close {
        width: 24px;
        height: 24px;
        font-size: 16px;
        margin-left: 8px;
    }

    .recommendation-player-body {
        padding: 8px;
    }

    .recommendation-player-footer {
        padding: 10px 12px;
        gap: 6px;
    }

    .recommendation-player-next,
    .recommendation-player-link {
        padding: 8px 12px;
        font-size: 11px;
    }
}


/* ✅ 权限提示样式 */
.recommendation-item.permission-denied {
    opacity: 0.7;
}

.recommendation-item.permission-denied:hover {
    opacity: 0.8;
}

.recommendation-item.permission-denied .recommendation-item-play {
    background: rgba(220, 53, 69, 0.2);
    border-color: rgba(220, 53, 69, 0.4);
    color: #dc3545;
    cursor: not-allowed;
}

.recommendation-item.permission-denied .recommendation-item-play:hover {
    background: rgba(220, 53, 69, 0.2);
    border-color: rgba(220, 53, 69, 0.4);
}

.recommendation-item.permission-denied .recommendation-item-play:disabled {
    opacity: 0.6;
}

/* 权限覆盖层 */
.permission-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    z-index: 10;
}

.permission-text {
    background: rgba(220, 53, 69, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
}

/* ✅ 广告提示样式 */
.recommendation-item.has-ads {
    position: relative;
}

.ads-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #ff9800;
    background: rgba(255, 152, 0, 0.15);
    border: 1px solid rgba(255, 152, 0, 0.3);
    padding: 4px 8px;
    border-radius: 3px;
    margin-top: 4px;
    white-space: nowrap;
}

.ads-badge i {
    font-size: 10px;
}

/* ✅ 锁图标覆盖层 */
.recommendation-item-lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 6px;
    z-index: 5;
    transition: all 0.2s ease;
}

.recommendation-item:hover .recommendation-item-lock-overlay {
    background: rgba(0, 0, 0, 0.7);
}

.recommendation-item-lock-icon {
    font-size: 24px;
    color: #ffd700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.recommendation-item-lock-text {
    text-align: center;
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;
}

.recommendation-item-lock-text p {
    margin: 0;
    font-size: 11px;
}

.recommendation-item-lock-text small {
    display: block;
    font-size: 9px;
    opacity: 0.8;
}

/* 禁用播放按钮样式 */
.recommendation-item-play:disabled {
    background: rgba(220, 53, 69, 0.15);
    border-color: rgba(220, 53, 69, 0.3);
    color: #dc3545;
    cursor: not-allowed;
    opacity: 0.6;
}

.recommendation-item-play:disabled:hover {
    background: rgba(220, 53, 69, 0.15);
    border-color: rgba(220, 53, 69, 0.3);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .permission-text {
        font-size: 11px;
        padding: 6px 10px;
    }

    .ads-badge {
        font-size: 10px;
        padding: 3px 6px;
    }

    .recommendation-item-lock-icon {
        font-size: 20px;
    }

    .recommendation-item-lock-text {
        font-size: 10px;
    }

    .recommendation-item-lock-text p {
        font-size: 10px;
    }

    .recommendation-item-lock-text small {
        font-size: 8px;
    }
}
