/**
 * FilmDad 视频详情页样式
 * 版本: v1.2 - 修复移动端排序和分享功能
 */

/* 基础布局 */
.filmdad-video-single-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.video-breadcrumb {
    background: #f8f9fa;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.breadcrumb-content {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.breadcrumb-content a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-content a:hover {
    color: #2980b9;
}

.breadcrumb-content .separator {
    color: #6c757d;
}

.breadcrumb-content .current {
    color: #2c3e50;
    font-weight: 600;
}

.video-single-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
    align-items: start;
}

/* 视频播放器区域 */
.video-player-section {
    margin-bottom: 30px;
}

.video-player-container {
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

.video-player-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 宽高比 */
    height: 0;
}

.video-player-wrapper iframe,
.video-player-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-embed-player {
    width: 100%;
    height: auto;
    max-height: 600px;
    border-radius: 8px;
}

/* 视频信息区域 */
.video-info-section {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

.video-header {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f8f9fa;
}

.video-title {
    font-size: 1.8em;
    margin: 0 0 15px 0;
    color: #2c3e50;
    line-height: 1.3;
}

.video-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.video-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-badge {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: 500;
}

.video-sources {
    display: flex;
    align-items: center;
    gap: 8px;
}

.source-label {
    font-weight: 600;
    color: #495057;
}

.source-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8em;
    font-weight: 500;
}

.source-badge.youtube { background: #ff0000; color: white; }
.source-badge.vimeo { background: #1ab7ea; color: white; }
.source-badge.bilibili { background: #fb7299; color: white; }
.source-badge.local { background: #27ae60; color: white; }

.video-stats {
    display: flex;
    gap: 15px;
    color: #6c757d;
    font-size: 0.9em;
}

.video-description {
    line-height: 1.6;
    color: #495057;
    margin-bottom: 20px;
}

.video-description p {
    margin-bottom: 15px;
}

/* 视频操作按钮 */
.video-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.video-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    color: #495057;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
    font-weight: 500;
}

.video-action-btn:hover {
    background: #3498db;
    color: white;
    border-color: #3498db;
    transform: translateY(-1px);
}

.video-action-btn.external-link {
    background: #27ae60;
    color: white;
    border-color: #27ae60;
}

.video-action-btn.lightbox-btn {
    background: #e74c3c;
    color: white;
    border-color: #e74c3c;
}

/* 关联电影区域 */
.related-movie-section {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4em;
    margin: 0 0 20px 0;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.related-movie-card {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.related-movie-card:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.movie-poster {
    flex-shrink: 0;
    width: 120px;
    height: 180px;
    border-radius: 8px;
    overflow: hidden;
}

.movie-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-poster {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2em;
}

.movie-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.movie-info h3 {
    margin: 0 0 10px 0;
    font-size: 1.2em;
}

.movie-info h3 a {
    color: #2c3e50;
    text-decoration: none;
}

.movie-info h3 a:hover {
    color: #3498db;
}

.movie-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 0.9em;
    color: #6c757d;
}

.year, .rating {
    display: flex;
    align-items: center;
    gap: 5px;
}

.view-movie-btn {
    align-self: flex-start;
    background: #3498db;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.view-movie-btn:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

/* 相关视频区域 */
.related-videos-section {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

.related-videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.related-video-card {
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.related-video-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.related-video-card .video-thumbnail {
    position: relative;
    aspect-ratio: 16/9;
}

.related-video-card .video-play-overlay {
    background: rgba(0,0,0,0.5);
}

.related-video-card .video-info {
    padding: 15px;
}

.related-video-card .video-info h4 {
    margin: 0 0 8px 0;
    font-size: 0.95em;
    line-height: 1.3;
}

.related-video-card .video-info h4 a {
    color: #2c3e50;
    text-decoration: none;
}

.related-video-card .video-info h4 a:hover {
    color: #3498db;
}

.related-video-card .video-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
    color: #6c757d;
}

/* 侧边栏样式 */
.video-sidebar {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.sidebar-widget {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.widget-title {
    font-size: 1.2em;
    margin: 0 0 15px 0;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

/* 视频信息小部件 */
.info-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f8f9fa;
}

.info-label {
    font-weight: 600;
    color: #495057;
    font-size: 0.9em;
}

.info-value {
    color: #6c757d;
    font-size: 0.9em;
    text-align: right;
}

.info-value a {
    color: #3498db;
    text-decoration: none;
}

.info-value a:hover {
    text-decoration: underline;
}

.type-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 500;
}

.type-badge.local { background: #e3f2fd; color: #1976d2; }
.type-badge.external { background: #fff3e0; color: #f57c00; }

/* 分享小部件 */
.share-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85em;
    font-weight: 500;
}

.share-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.share-btn.copy-link:hover { background: #6c757d; color: white; border-color: #6c757d; }
.share-btn.facebook:hover { background: #1877f2; color: white; border-color: #1877f2; }
.share-btn.twitter:hover { background: #1da1f2; color: white; border-color: #1da1f2; }
.share-btn.linkedin:hover { background: #0077b5; color: white; border-color: #0077b5; }
.share-btn.pinterest:hover { background: #bd081c; color: white; border-color: #bd081c; }
.share-btn.reddit:hover { background: #ff4500; color: white; border-color: #ff4500; }
.share-btn.whatsapp:hover { background: #25d366; color: white; border-color: #25d366; }
.share-btn.telegram:hover { background: #0088cc; color: white; border-color: #0088cc; }
.share-btn.weibo:hover { background: #e6162d; color: white; border-color: #e6162d; }
.share-btn.qq:hover { background: #12b7f5; color: white; border-color: #12b7f5; }
.share-btn.douban:hover { background: #2e963d; color: white; border-color: #2e963d; }

/* 分类小部件 */
.categories-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-tag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 6px 12px;
    border-radius: 15px;
    text-decoration: none;
    font-size: 0.85em;
    transition: all 0.3s ease;
}

.category-tag:hover {
    background: #1976d2;
    color: white;
    transform: translateY(-1px);
}

/* 搜索电影小部件 */
.movie-search-widget .search-container {
    margin-bottom: 15px;
}

.movie-search-form .search-input-group {
    display: flex;
    gap: 8px;
}

.movie-search-form .search-field {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.9em;
}

.movie-search-form .search-submit {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.movie-search-form .search-submit:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

.search-suggestions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.suggestion-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50; /* 深色文字 */
    font-size: 0.9em;
}

.suggestion-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.suggestion-tag {
    background: #f8f9fa;
    color: #495057; /* 深色文字 */
    padding: 4px 12px;
    border-radius: 15px;
    text-decoration: none;
    font-size: 0.85em;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.suggestion-tag:hover {
    background: #3498db;
    color: white;
    border-color: #3498db;
    transform: translateY(-1px);
}

/* 灯箱样式 */
.video-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
}

.lightbox-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 900px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.lightbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #2c3e50;
    color: white;
}

.lightbox-title {
    margin: 0;
    font-size: 1.2em;
}

.lightbox-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease;
}

.lightbox-close:hover {
    color: #3498db;
}

.lightbox-body {
    padding: 0;
}

.lightbox-body .video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
}

.lightbox-body .video-container iframe,
.lightbox-body .video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.lightbox-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    text-align: center;
    border-top: 1px solid #e9ecef;
}

.view-details-btn {
    background: #3498db;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.view-details-btn:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

/* 移动端重新排序 */
@media (max-width: 768px) {
    .video-single-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* 主内容区域重新排序 */
    .video-main-content {
        order: 1;
        display: flex;
        flex-direction: column;
    }
    
    .video-sidebar {
        order: 2;
    }
    
    /* 主内容区域内部重新排序 */
    .video-player-section {
        order: 1;
    }
    
    .video-info-section {
        order: 2;
    }
    
    .related-movie-section {
        order: 5;
    }
    
    .related-videos-section {
        order: 4;
    }
    
    .video-comments-section {
        order: 6;
    }
    
    /* 侧边栏内部重新排序 */
    .video-sidebar {
        display: flex;
        flex-direction: column;
    }
    
    .video-info-widget {
        order: 3;
    }
    
    .share-widget {
        order: 6;
    }
    
    .categories-widget {
        order: 4;
    }
    
    /* 动态侧边栏 */
    .sidebar-widget:not(.video-info-widget):not(.share-widget):not(.categories-widget) {
        order: 5;
    }
    
    /* 移动端调整 */
    .video-title {
        font-size: 1.5em;
    }
    
    .video-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .related-movie-card {
        flex-direction: column;
        text-align: center;
    }
    
    .movie-poster {
        align-self: center;
    }
    
    .share-buttons {
        grid-template-columns: 1fr;
    }
    
    .lightbox-content {
        width: 95%;
        height: 80%;
    }
}

@media (max-width: 480px) {
    .filmdad-video-single-container {
        padding: 10px;
    }
    
    .video-info-section,
    .related-movie-section,
    .related-videos-section,
    .sidebar-widget {
        padding: 15px;
    }
    
    .video-actions {
        justify-content: center;
    }
    
    .video-action-btn {
        flex: 1;
        min-width: 120px;
        justify-content: center;
    }
    
    .related-videos-grid {
        grid-template-columns: 1fr;
    }
}

/* 无视频状态 */
.no-video {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.no-video-icon {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-video h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.no-video p {
    color: #6c757d;
    margin-bottom: 0;
}

/* 评论区域 */
.video-comments-section {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

/* 灯箱打开时的body样式 */
body.lightbox-open {
    overflow: hidden;
}

/* 移动端重新排序优化 */
@media (max-width: 768px) {
    .video-single-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* 主内容区域重新排序 */
    .video-main-content {
        order: 1;
        display: flex;
        flex-direction: column;
    }
    
    .video-sidebar {
        order: 2;
        display: flex;
        flex-direction: column;
        gap: 20px;
    }
    
    /* 主内容区域内部重新排序 */
    .video-player-section {
        order: 1;
    }
    
    .video-info-section {
        order: 2;
    }
    
    .related-movie-section {
        order: 3;
    }
    
    .related-videos-section {
        order: 4;
    }
    
    .video-comments-section {
        order: 5;
    }
    
    /* 侧边栏内部重新排序 */
    .video-info-widget {
        order: 1;
    }
    
    .categories-widget {
        order: 2;
    }
    
    .related-movie-section {
        order: 3;
    }
    
    .share-widget {
        order: 4;
    }
    
    /* 动态侧边栏 */
    .sidebar-widget:not(.video-info-widget):not(.share-widget):not(.categories-widget) {
        order: 5;
    }
}

@media (max-width: 480px) {
    .video-sidebar {
        gap: 15px;
    }
    
    .sidebar-widget {
        margin-bottom: 0;
    }
}

/* 微信分享按钮样式 */
.share-btn.wechat:hover { 
    background: #1aad19; 
    color: white; 
    border-color: #1aad19; 
}

/* 微信分享模态框样式 */
.wechat-share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wechat-share-modal > div {
    background: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    max-width: 320px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.wechat-share-modal h3 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 1.3em;
}

.wechat-share-modal p {
    color: #666;
    margin-bottom: 20px;
    font-size: 0.95em;
}

.qrcode-container {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.close-wechat {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
    width: 100%;
}

.close-wechat:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

/* 消息提示样式 */
.video-message, .share-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 6px;
    z-index: 10001;
    color: white;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: slideIn 0.3s ease;
}

.success-message {
    background: #27ae60;
}

.error-message {
    background: #e74c3c;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 微信分享模态框样式 */
.wechat-share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.wechat-modal-content {
    background: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    max-width: 320px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: scaleIn 0.3s ease;
}

.wechat-modal-content h3 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 1.3em;
}

.wechat-modal-content p {
    color: #666;
    margin-bottom: 20px;
    font-size: 0.95em;
}

.qrcode-container {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.qrcode-placeholder {
    color: #666;
    text-align: center;
}

.close-wechat {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
    width: 100%;
}

.close-wechat:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* 加载状态 */
.movie-videos-grid.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* 灯箱打开时的body样式 */
body.lightbox-open {
    overflow: hidden;
}