/* ==============================================
   CUSTOM VIDEO PLAYER STYLES
   ============================================== */

/* Video thumbnail styling */
.video-thumbnail-container {
    transition: opacity 0.3s ease;
    position: relative;
}

.video-thumbnail-img,
.video-thumbnail-placeholder {
    transition: transform 0.5s ease;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Ensure video stays hidden until clicked */
.custom-video-player .video-player {
    display: none;
}

/* Show video when it's loaded and playing */
.custom-video-player.video-playing .video-player {
    display: block;
}

.custom-video-player.video-playing .video-thumbnail-container {
    display: none;
}

.custom-video-player.video-playing .video-play-overlay {
    display: none;
}

/* Video hover effects */
.custom-video-player:hover .video-play-overlay {
    background: rgba(0,0,0,0.4);
}

.custom-video-player:hover .play-button-circle {
    transform: scale(1.15);
}

.custom-video-player:hover .video-thumbnail-img,
.custom-video-player:hover .video-thumbnail-placeholder {
    transform: scale(1.05);
}

/* Expand button hover */
.video-expand-btn:hover,
.video-capture-btn:hover {
    background: rgba(0,0,0,0.9) !important;
    transform: scale(1.1);
}

/* Captured Frame Container */
.captured-frame-container {
    margin-top: 16px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    animation: slideInFromBottom 0.5s ease-out;
}

body.dark-theme .captured-frame-container,
body.dark-mode .captured-frame-container {
    background: #0f172a;
    border-color: #334155;
}

.captured-frame-container img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.captured-frame-container img:hover {
    transform: scale(1.02);
}

.captured-frame-container button {
    padding: 8px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.captured-frame-container button:hover {
    background: #5a67d8;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Video Modal */
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-modal.active {
    opacity: 1;
}

.video-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    backdrop-filter: blur(10px);
}

.video-modal-content {
    position: relative;
    width: 90%;
    max-width: 1400px;
    height: 90vh;
    margin: 5vh auto;
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 24px;
    z-index: 10001;
}

.video-modal-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: rgba(255,255,255,0.1);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    font-size: 20px;
    transition: all 0.3s ease;
    z-index: 10002;
}

.video-modal-close:hover {
    background: rgba(255,255,255,0.2);
    transform: rotate(90deg);
}

/* Video Player Section */
.video-modal-player-section {
    position: relative;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-video-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Custom Video Controls */
.video-custom-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
    padding: 60px 20px 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-modal-player-section:hover .video-custom-controls {
    opacity: 1;
}

.video-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
    cursor: pointer;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}

.video-progress-filled {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.1s linear;
    border-radius: 3px;
}

.video-progress-bar:hover .video-progress-filled {
    background: linear-gradient(135deg, #7c8ff0 0%, #8b5cb8 100%);
}

.video-controls-bottom {
    display: flex;
    align-items: center;
    gap: 12px;
}

.video-control-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    font-size: 16px;
    transition: all 0.3s ease;
}

.video-control-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.1);
}

.video-time-display {
    color: white;
    font-size: 14px;
    font-weight: 600;
    margin-left: auto;
    margin-right: 12px;
}

/* Info Section */
.video-modal-info-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    overflow-y: auto;
    max-height: 90vh;
}

body.dark-theme .video-modal-info-section,
body.dark-mode .video-modal-info-section {
    background: #1e293b;
    color: white;
}

.video-modal-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: #1e293b;
}

body.dark-theme .video-modal-header h3,
body.dark-mode .video-modal-header h3 {
    color: white;
}

.video-modal-header p {
    color: #64748b;
    line-height: 1.6;
    margin: 0 0 24px 0;
}

body.dark-theme .video-modal-header p,
body.dark-mode .video-modal-header p {
    color: #94a3b8;
}

/* Stats */
.video-modal-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 2px solid #e2e8f0;
}

body.dark-theme .video-modal-stats,
body.dark-mode .video-modal-stats {
    border-bottom-color: #334155;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
}

body.dark-theme .stat-item,
body.dark-mode .stat-item {
    background: #0f172a;
}

.stat-item i {
    color: #667eea;
    font-size: 18px;
}

.stat-item span {
    font-weight: 600;
    color: #1e293b;
}

body.dark-theme .stat-item span,
body.dark-mode .stat-item span {
    color: white;
}

/* Actions */
.video-modal-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.action-btn {
    flex: 1;
    padding: 12px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

body.dark-theme .action-btn,
body.dark-mode .action-btn {
    background: #0f172a;
    border-color: #334155;
    color: white;
}

.action-btn:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

body.dark-theme .action-btn:hover,
body.dark-mode .action-btn:hover {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

.like-btn i {
    color: #f43f5e;
}

.comment-btn i {
    color: #667eea;
}

.share-btn i {
    color: #10b981;
}

/* Comments Section */
.video-modal-comments {
    margin-top: 24px;
}

.video-modal-comments h4 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 16px 0;
    color: #1e293b;
}

body.dark-theme .video-modal-comments h4,
body.dark-mode .video-modal-comments h4 {
    color: white;
}

.comments-list {
    background: #f8fafc;
    border-radius: 8px;
    padding: 16px;
    min-height: 100px;
}

body.dark-theme .comments-list,
body.dark-mode .comments-list {
    background: #0f172a;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .video-modal-content {
        grid-template-columns: 1fr;
        width: 95%;
        height: 95vh;
        margin: 2.5vh auto;
    }
    
    .video-modal-info-section {
        max-height: 40vh;
    }
}

@media (max-width: 768px) {
    .video-modal-close {
        top: 10px;
        right: 10px;
        background: rgba(0,0,0,0.8);
    }
    
    .video-modal-stats {
        grid-template-columns: 1fr;
    }
    
    .video-modal-actions {
        flex-direction: column;
    }
    
    .video-control-btn {
        width: 36px;
        height: 36px;
    }
    
    .video-time-display {
        font-size: 12px;
    }
}

/* Loading animation for play overlay */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.video-play-overlay {
    animation: pulse 2s ease-in-out infinite;
}

.custom-video-player:hover .video-play-overlay {
    animation: none;
}
