/* static/temp/posts/css/video_player.css */

/* Modal Container */
.video-player-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-player-modal.active {
    display: flex;
    opacity: 1;
}

/* Content */
.video-player-content {
    width: 90%;
    max-width: 1000px;
    background: #1a1a1a;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.video-player-modal.active .video-player-content {
    transform: scale(1);
}

/* Header */
.video-player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.video-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #ff0000, #ff6b6b);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.video-info h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.video-subtitle {
    margin: 4px 0 0;
    font-size: 14px;
    color: #aaa;
}

/* Close Button */
.video-player-close {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.2s ease;
}

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

/* Video Container */
.video-player-container {
    position: relative;
    width: 100%;
    background: #000;
}

.video-player-container::before {
    content: '';
    display: block;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
}

#player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Loading */
.video-player-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10;
    color: white;
}

.video-player-loading.active {
    display: flex;
}

.loading-spinner {
    margin-bottom: 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #ff0000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.video-player-loading p {
    margin-top: 16px;
    font-size: 16px;
    color: #aaa;
}

/* Controls */
.video-player-controls {
    padding: 20px 24px;
    background: rgba(0, 0, 0, 0.7);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 20px;
}

.controls-left,
.controls-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.controls-center {
    flex: 1;
    min-width: 0;
}

/* Control Buttons */
.control-btn {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s ease;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.control-btn:active {
    transform: translateY(0);
}

/* Time Display */
.time-display {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #aaa;
    font-variant-numeric: tabular-nums;
    user-select: none;
}

.time-separator {
    color: #666;
}

/* Progress Bar */
.progress-container {
    padding: 10px 0;
    cursor: pointer;
}

.progress-bar {
    position: relative;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #ff0000;
    width: 0%;
    border-radius: 2px;
    transition: width 0.1s linear;
}

.progress-thumb {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.progress-bar:hover .progress-thumb {
    opacity: 1;
}

/* Fullscreen Mode */
.video-player-content.fullscreen {
    width: 100vw;
    height: 100vh;
    max-width: none;
    border-radius: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .video-player-content {
        width: 100%;
        height: 100%;
        border-radius: 0;
        max-width: none;
    }

    .video-player-header {
        padding: 16px;
    }

    .video-player-controls {
        padding: 16px;
        flex-wrap: wrap;
    }

    .controls-center {
        order: 3;
        flex: 0 0 100%;
        margin-top: 12px;
    }

    .control-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

/* Error State */
.video-error {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.95);
    color: white;
    text-align: center;
    padding: 40px;
    z-index: 20;
}

.video-error.active {
    display: flex;
}

.video-error-icon {
    font-size: 48px;
    color: #ff6b6b;
    margin-bottom: 20px;
}

.video-error h3 {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 600;
}

.video-error p {
    margin: 0 0 20px;
    font-size: 16px;
    color: #aaa;
    max-width: 400px;
    line-height: 1.5;
}

/* Hide default YouTube controls */
.video-player-container iframe {
    width: 100%;
    height: 100%;
}