/**
 * Ghost Player Styles
 * Cinematheque OZ
 */

.ghost-player {
    position: relative;
    width: 100%;
    background: #000;
    overflow: hidden;
    font-family: 'Inter', -apple-system, sans-serif;
}

.ghost-player.fullscreen {
    position: fixed;
    inset: 0;
    z-index: 9999;
}

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

/* Loader */
.ghost-player-loader {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10;
}

.loader-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #dc2626;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.ghost-player-loader span {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

/* Big Play Button */
.ghost-player-big-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(220, 38, 38, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 5;
    transition: all 0.2s ease;
}

.ghost-player-big-play:hover {
    transform: translate(-50%, -50%) scale(1.1);
    background: #dc2626;
    box-shadow: 0 0 40px rgba(220, 38, 38, 0.5);
}

.ghost-player-big-play svg {
    width: 36px;
    height: 36px;
    fill: white;
    margin-left: 4px;
}

/* Controls */
.ghost-player-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0 16px 16px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 20;
}

.ghost-player-controls.visible,
.ghost-player:hover .ghost-player-controls {
    opacity: 1;
    visibility: visible;
}

/* Progress Bar */
.controls-progress {
    padding: 8px 0;
}

.progress-bar {
    position: relative;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    cursor: pointer;
    transition: height 0.15s ease;
}

.progress-bar:hover {
    height: 8px;
}

.progress-buffered {
    position: absolute;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.progress-played {
    position: absolute;
    height: 100%;
    background: #dc2626;
    border-radius: 2px;
}

.progress-handle {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    background: #dc2626;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.15s ease;
}

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

/* Bottom Controls */
.controls-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

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

/* Control Buttons */
.control-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    color: white;
    opacity: 0.9;
    transition: all 0.15s ease;
}

.control-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.control-btn svg {
    width: 24px;
    height: 24px;
}

/* Volume */
.volume-container {
    display: flex;
    align-items: center;
    gap: 4px;
}

.volume-slider {
    width: 0;
    opacity: 0;
    transition: all 0.2s ease;
    accent-color: #dc2626;
}

.volume-container:hover .volume-slider {
    width: 80px;
    opacity: 1;
}

/* Time Display */
.time-display {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    font-variant-numeric: tabular-nums;
}

.time-separator {
    opacity: 0.5;
}

/* Quality Selector */
.quality-selector {
    position: relative;
}

.quality-label {
    font-size: 12px;
    font-weight: 600;
    padding: 0 4px;
}

.quality-menu {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 8px;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 0;
    min-width: 100px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
}

.quality-menu.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.quality-option {
    display: block;
    width: 100%;
    padding: 8px 16px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
}

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

.quality-option.active {
    color: #dc2626;
}

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

/* Touch Friendly Adjustments */
@media (hover: none) {
    .ghost-player-controls {
        opacity: 1;
        visibility: visible;
    }

    .control-btn {
        width: 48px;
        height: 48px;
    }

    .ghost-player-big-play {
        width: 72px;
        height: 72px;
    }

    .volume-slider {
        width: 80px;
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .controls-progress {
        padding: 12px 0;
    }

    .time-display {
        font-size: 12px;
    }

    .control-btn svg {
        width: 20px;
        height: 20px;
    }
}
