/**
 * video-preview-modal.css
 * Complete styles for the unified video preview modal
 * Place in assets/css/video-preview-modal.css
 */

/* Modal Overlay - Hidden by default */
.video-preview-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Show modal when active */
.video-preview-modal-overlay.active {
    display: flex;
}

/* Modal Container */
.video-preview-modal {
    background: #1a1a2e;
    border-radius: 12px;
    max-width: 1000px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    position: relative;
}

/* Close Button */
.video-preview-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s;
}

.video-preview-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.video-preview-close svg {
    width: 20px;
    height: 20px;
}

/* Video Container */
.video-preview-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    position: relative;
    background: #000;
    overflow: hidden; // for zoom features
}

/* Loading State */
.video-preview-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #fff;
    z-index: 5;
}

.video-preview-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #00d4aa;
    border-radius: 50%;
    animation: vpm-spin 0.8s linear infinite;
}

@keyframes vpm-spin {
    to { transform: rotate(360deg); }
}

/* Error State */
.video-preview-error {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #ef4444;
    z-index: 5;
}

.video-preview-error svg {
    width: 48px;
    height: 48px;
}

/* Video Player */
.video-preview-player {
    width: 100%;
    flex: 1;
    min-height: 200px;
    max-height: 70vh;
    background: #000;
    outline: none;
    object-fit: contain;
    display: block;
	transition: transform 0.2s ease-out;  /* Smooth zoom transitions */
}

.video-preview-zoom-indicator {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-preview-container.has-zoom .video-preview-zoom-indicator {
    opacity: 1;
}

.video-preview-zoom-indicator svg {
    width: 14px;
    height: 14px;
}

/* Timeline */
.video-preview-timeline {
    position: relative;
    height: 24px;
    background: #2a2a3e;
    cursor: pointer;
    margin: 0 16px;
    border-radius: 4px;
    overflow: hidden;
}

.video-preview-timeline-track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background: #3a3a4e;
    transform: translateY(-50%);
    border-radius: 2px;
}

.video-preview-timeline-progress {
    position: absolute;
    top: 50%;
    left: 0;
    height: 4px;
    background: #00d4aa;
    transform: translateY(-50%);
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s linear;
}

.video-preview-timeline-cursor {
    position: absolute;
    top: 50%;
    width: 12px;
    height: 12px;
    background: #00d4aa;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    left: 0%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: left 0.1s linear;
}

/* Bookmark Ticks on Timeline */
.video-preview-bookmarks {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.video-preview-bookmark-tick {
    position: absolute;
    top: 2px;
    bottom: 2px;
    width: 3px;
    background: #fbbf24;
    border-radius: 2px;
    cursor: pointer;
    pointer-events: auto;
    transition: transform 0.2s, background 0.2s;
}

.video-preview-bookmark-tick:hover {
    transform: scaleY(1.2);
    background: #f59e0b;
}

/* Actions Bar */
.video-preview-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #16162a;
    gap: 16px;
    flex-wrap: wrap;
}

.video-preview-actions-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    min-width: 0;
}

.video-preview-actions-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Title */
.video-preview-title {
    font-weight: 600;
    color: #fff;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

/* PRO Badge */
.video-preview-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.video-preview-badge-pro {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
}

/* Time Display */
.video-preview-time {
    color: #888;
    font-size: 0.85rem;
    font-family: monospace;
}

/* Buttons */
.video-preview-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.video-preview-btn svg {
    width: 16px;
    height: 16px;
}

.video-preview-btn-bookmark {
    background: transparent;
    color: #fbbf24;
    border: 1px solid #fbbf24;
}

.video-preview-btn-bookmark:hover {
    background: rgba(251, 191, 36, 0.1);
}

.video-preview-btn-primary {
    background: #00d4aa;
    color: #000;
}

.video-preview-btn-primary:hover {
    background: #00b894;
}

.video-preview-btn-secondary {
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.video-preview-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Disabled state */
.video-preview-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.video-preview-btn:disabled:hover {
    background: transparent;
}

/* Bookmark Count Badge */
.video-preview-bookmark-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #fbbf24;
    color: #000;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 10px;
}

/* Whiteboard Button (uses existing btn styles) */
#whiteboardBtn {
    background: #3b82f6;
    color: #fff;
    border: none;
}

#whiteboardBtn:hover {
    background: #2563eb;
}

#whiteboardBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Toast Notifications */
.video-preview-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1a1a2e;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 10001;
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
}

.video-preview-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.video-preview-toast.success {
    border-left: 4px solid #22c55e;
}

.video-preview-toast.error {
    border-left: 4px solid #ef4444;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .video-preview-modal-overlay {
        padding: 10px;
    }
    
    .video-preview-modal {
        max-height: 95vh;
        border-radius: 8px;
    }
    
    .video-preview-actions {
        flex-direction: column;
        gap: 12px;
        padding: 12px;
    }
    
    .video-preview-actions-left,
    .video-preview-actions-right {
        width: 100%;
        justify-content: center;
    }
    
    .video-preview-title {
        max-width: 200px;
        font-size: 0.9rem;
    }
    
    .video-preview-btn span {
        display: none;
    }
    
    .video-preview-btn {
        padding: 8px;
    }
    
    .video-preview-timeline {
        margin: 0 12px;
    }
}

@media (max-width: 480px) {
    .video-preview-actions-right {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .video-preview-title {
        max-width: 150px;
    }
}

/* Wrapper clips zoomed video content */
.video-preview-video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #000;
}

.video-preview-video-wrapper .video-preview-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.15s ease-out;
}