/**
 * StreamBox Player Styles
 * 
 * Styling for video player components including iframe embeds
 * 
 * @package StreamBox
 * @since 1.0.0
 */

/* Player Container */
.streambox-player {
    position: relative;
    width: 100%;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

/* Embed Container */
.streambox-embed-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    background: #000;
}

.streambox-embed-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Embed Video (oEmbed) */
.streambox-embed-video {
    position: relative;
    width: 100%;
}

.streambox-oembed {
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.streambox-oembed iframe,
.streambox-oembed object,
.streambox-oembed embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Iframe Embed Container */
.streambox-embed-iframe-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    background: #000;
    border-radius: 8px;
}

.streambox-embed-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Player Error Messages */
.streambox-error,
.player-error {
    padding: 2rem;
    text-align: center;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #ef4444;
    font-size: 0.875rem;
}

.streambox-error p,
.player-error p {
    margin: 0;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .streambox-player,
    .streambox-embed-container,
    .streambox-embed-iframe-container {
        border-radius: 0;
    }
}

/* Loading State */
.streambox-player.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: streambox-spin 0.8s linear infinite;
}

@keyframes streambox-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Player Wrapper */
.player-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 2rem;
}

.player-wrapper video {
    width: 100%;
    height: auto;
    display: block;
}

/* Episode Player Specific */
.player-wrapper--episode .streambox-embed-container {
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Quality Badge (for episodes) */
.player-quality-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.75rem;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    backdrop-filter: blur(8px);
    z-index: 10;
}
