/**
 * Kingbokep - Video Player Styles
 * Custom video player UI
 */

/* ========================================
   Video Container
======================================== */
.video-container {
    position: relative;
    width: 100%;
    height: 100%;
    background-color: #000;
    overflow: hidden;
}

.video-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #000;
}

.video-player.cover {
    object-fit: cover;
}

/* ========================================
   Play/Pause Overlay
======================================== */
.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.2s ease;
    cursor: pointer;
}

.video-container.paused .play-overlay {
    opacity: 1;
}

.play-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    transition: transform 0.2s ease;
}

.play-icon svg {
    width: 40px;
    height: 40px;
    color: white;
    margin-left: 5px; /* Optical centering for play icon */
}

.play-overlay:hover .play-icon {
    transform: scale(1.1);
}

/* ========================================
   Loading State
======================================== */
.video-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
}

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

/* ========================================
   Mute/Unmute Button
======================================== */
.volume-control {
    position: absolute;
    top: 60px;
    right: 15px;
    z-index: 20;
}

.volume-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.volume-btn:hover {
    background-color: rgba(0, 0, 0, 0.7);
    transform: scale(1.05);
}

.volume-btn svg {
    width: 22px;
    height: 22px;
}

.volume-btn.muted {
    color: var(--text-secondary);
}

/* ========================================
   Progress Bar
======================================== */
.video-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background-color: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    z-index: 15;
    transition: height 0.15s ease;
}

.video-progress:hover {
    height: 6px;
}

.video-progress:hover .progress-thumb {
    opacity: 1;
    transform: scale(1);
}

.progress-filled {
    height: 100%;
    background-color: var(--primary-color);
    position: relative;
    transition: width 0.1s linear;
}

.video-progress:hover .progress-filled {
    background-color: white;
}

.progress-thumb {
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    width: 12px;
    height: 12px;
    background-color: white;
    border-radius: 50%;
    opacity: 0;
    transition: all 0.15s ease;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
}

.progress-buffer {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.3);
    z-index: -1;
}

/* ========================================
   Time Display
======================================== */
.time-display {
    position: absolute;
    bottom: 15px;
    left: 15px;
    font-size: 0.75rem;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    z-index: 10;
    pointer-events: none;
}

.time-current {
    font-weight: 600;
}

.time-separator {
    margin: 0 3px;
    color: var(--text-secondary);
}

.time-duration {
    color: var(--text-secondary);
}

/* ========================================
   Quality Selector
======================================== */
.quality-selector {
    position: absolute;
    bottom: 70px;
    right: 15px;
    z-index: 20;
}

.quality-btn {
    padding: 6px 12px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    border: none;
    cursor: pointer;
}

.quality-menu {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 5px;
    background-color: rgba(0, 0, 0, 0.9);
    border-radius: 8px;
    overflow: hidden;
    display: none;
}

.quality-menu.active {
    display: block;
}

.quality-option {
    padding: 10px 20px;
    font-size: 0.875rem;
    color: white;
    cursor: pointer;
    white-space: nowrap;
}

.quality-option:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.quality-option.active {
    color: var(--primary-color);
}

.quality-option.active::before {
    content: '✓';
    margin-right: 8px;
}

/* ========================================
   Fullscreen Button
======================================== */
.fullscreen-btn {
    position: absolute;
    bottom: 70px;
    right: 60px;
    width: 36px;
    height: 36px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    border: none;
    cursor: pointer;
    z-index: 20;
    transition: all 0.2s ease;
}

.fullscreen-btn:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

.fullscreen-btn svg {
    width: 18px;
    height: 18px;
}

/* ========================================
   Double Tap to Seek
======================================== */
.seek-indicator {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.seek-indicator.left {
    left: 20px;
}

.seek-indicator.right {
    right: 20px;
}

.seek-indicator.active {
    opacity: 1;
    animation: seekPulse 0.3s ease;
}

.seek-indicator-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.seek-indicator svg {
    width: 40px;
    height: 40px;
    color: white;
}

.seek-indicator span {
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
}

@keyframes seekPulse {
    0% {
        transform: translateY(-50%) scale(0.8);
    }
    50% {
        transform: translateY(-50%) scale(1.1);
    }
    100% {
        transform: translateY(-50%) scale(1);
    }
}

/* ========================================
   Video Error State
======================================== */
.video-error {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--background-card);
    color: var(--text-secondary);
    text-align: center;
    padding: 20px;
}

.video-error svg {
    width: 60px;
    height: 60px;
    margin-bottom: 15px;
    color: var(--error-color);
}

.video-error h3 {
    font-size: 1rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.video-error p {
    font-size: 0.875rem;
    margin-bottom: 20px;
}

.video-error button {
    padding: 10px 25px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
}

/* ========================================
   Thumbnail Preview
======================================== */
.thumbnail-preview {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.thumbnail-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-preview.hidden {
    display: none;
}

/* ========================================
   Swipe Hint
======================================== */
.swipe-hint {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: white;
    opacity: 0;
    animation: swipeHint 2s ease-in-out infinite;
    pointer-events: none;
}

.swipe-hint svg {
    width: 30px;
    height: 30px;
    animation: bounce 1s ease-in-out infinite;
}

.swipe-hint span {
    font-size: 0.75rem;
}

@keyframes swipeHint {
    0%, 100% { opacity: 0; }
    50% { opacity: 0.7; }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ========================================
   Pip Mode (Picture in Picture)
======================================== */
.pip-btn {
    position: absolute;
    bottom: 70px;
    right: 100px;
    width: 36px;
    height: 36px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    border: none;
    cursor: pointer;
    z-index: 20;
}

.pip-btn:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

.pip-btn svg {
    width: 18px;
    height: 18px;
}

/* ========================================
   Gradient Overlays
======================================== */
.gradient-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, transparent 100%);
    pointer-events: none;
    z-index: 5;
}

.gradient-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
    pointer-events: none;
    z-index: 5;
}
