/**
 * EMERGERA Enhanced Video Player Styles
 * Picture-in-Picture, Floating Mini Player, Keyboard Shortcuts
 */

/* ========================================
   ENHANCED CONTROLS
   ======================================== */

.enhanced-controls {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    gap: 8px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-container:hover .enhanced-controls {
    opacity: 1;
}

/* Picture-in-Picture Button */
.pip-button {
    position: relative;
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: white;
}

.pip-button:hover {
    background: rgba(139, 92, 246, 0.4);
    border-color: var(--purple);
    transform: scale(1.05);
}

.pip-button.active {
    background: linear-gradient(135deg, #8b5cf6, #06b6d4);
    border-color: transparent;
}

.pip-button svg {
    width: 24px;
    height: 24px;
}

.pip-tooltip {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.pip-button:hover .pip-tooltip {
    opacity: 1;
}

/* ========================================
   SPEED SELECTOR
   ======================================== */

.speed-selector {
    position: relative;
}

.speed-current {
    width: 50px;
    height: 44px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.speed-current:hover {
    background: rgba(139, 92, 246, 0.4);
    border-color: var(--purple);
}

.speed-options {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: rgba(10, 10, 15, 0.95);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 8px;
    padding: 8px;
    display: none;
    flex-direction: column;
    gap: 4px;
    min-width: 80px;
    backdrop-filter: blur(10px);
}

.speed-options.visible {
    display: flex;
}

.speed-option {
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: #b4b4b4;
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    text-align: center;
}

.speed-option:hover {
    background: rgba(139, 92, 246, 0.2);
    color: white;
}

.speed-option.active {
    background: linear-gradient(135deg, #8b5cf6, #06b6d4);
    color: white;
}

/* ========================================
   FLOATING MINI PLAYER
   ======================================== */

.mini-player {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 320px;
    background: #0a0a0f;
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(139, 92, 246, 0.2);
    z-index: 9999;
    overflow: hidden;
    transform: translateY(100%) scale(0.9);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.mini-player.visible {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.mini-player-video {
    aspect-ratio: 16/9;
    background: #000;
}

.mini-player-video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mini-player-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.6));
}

.mini-play-pause {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #8b5cf6, #06b6d4);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.mini-play-pause:hover {
    transform: scale(1.1);
}

.mini-play-pause svg {
    width: 18px;
    height: 18px;
    fill: white;
}

.mini-play-pause .pause-icon {
    display: none;
}

.mini-player.playing .mini-play-pause .play-icon {
    display: none;
}

.mini-player.playing .mini-play-pause .pause-icon {
    display: block;
}

.mini-progress {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.mini-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6, #06b6d4);
    border-radius: 2px;
    transition: width 0.1s linear;
    width: 0%;
}

.mini-expand,
.mini-close {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.2s ease;
}

.mini-expand:hover,
.mini-close:hover {
    background: rgba(139, 92, 246, 0.3);
}

.mini-expand svg,
.mini-close svg {
    width: 18px;
    height: 18px;
}

/* ========================================
   KEYBOARD SHORTCUTS HINT
   ======================================== */

.keyboard-shortcuts-hint {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(10, 10, 15, 0.95);
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 12px;
    padding: 16px 24px;
    display: flex;
    gap: 24px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 20;
}

.keyboard-shortcuts-hint.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.shortcut {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #b4b4b4;
    white-space: nowrap;
}

.shortcut kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(6, 182, 212, 0.3));
    border: 1px solid rgba(139, 92, 246, 0.5);
    border-radius: 4px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    color: white;
}

/* ========================================
   PLAYER NOTIFICATION
   ======================================== */

.player-notification {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(10, 10, 15, 0.95);
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 8px;
    padding: 12px 24px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 10000;
    backdrop-filter: blur(10px);
}

.player-notification.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ========================================
   CHAPTER MARKERS
   ======================================== */

.chapter-timeline {
    position: absolute;
    bottom: 48px;
    left: 0;
    right: 0;
    height: 4px;
    z-index: 5;
}

.chapter-marker {
    position: absolute;
    top: -6px;
    width: 8px;
    height: 16px;
    background: rgba(251, 191, 36, 0.8);
    border: none;
    border-radius: 2px;
    cursor: pointer;
    transform: translateX(-50%);
    transition: all 0.2s ease;
}

.chapter-marker:hover {
    background: #fbbf24;
    transform: translateX(-50%) scale(1.3);
}

.chapter-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.chapter-marker:hover .chapter-tooltip {
    opacity: 1;
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

@media (max-width: 768px) {
    .mini-player {
        bottom: 16px;
        right: 16px;
        left: 16px;
        width: auto;
    }

    .keyboard-shortcuts-hint {
        display: none !important;
    }

    .enhanced-controls {
        top: 8px;
        right: 8px;
    }
}

@media (max-width: 480px) {
    .mini-player {
        bottom: 0;
        right: 0;
        left: 0;
        border-radius: 12px 12px 0 0;
    }
}

/* ========================================
   REDUCED MOTION
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    .mini-player,
    .player-notification,
    .keyboard-shortcuts-hint,
    .pip-button,
    .speed-selector {
        transition: none;
    }

    .mini-player.visible {
        transform: translateY(0) scale(1);
    }
}
