/* AWS IVS Player Styling */

.ivs-player-container {
    position: relative;
    width: 100%;
    margin: 0 auto;
}

.ivs-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    overflow: hidden;
}

.ivs-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
    transition: opacity 0.3s ease;
}

.ivs-video.needs-interaction {
    cursor: pointer;
}

.ivs-video.needs-interaction::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    pointer-events: none;
}

.ivs-video.is-playing {
    opacity: 1;
}

.ivs-wrapper:not(.active-video) .ivs-video {
    opacity: 0.5;
}

.ivs-player-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: auto;
}

.video-wrapper.ivs-wrapper:hover .ivs-player-controls,
.ivs-wrapper:hover .ivs-player-controls {
    opacity: 1;
    pointer-events: auto;
}

.ivs-play-btn,
.ivs-audio-btn,
.ivs-fullscreen-btn {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.ivs-play-btn:hover,
.ivs-audio-btn:hover,
.ivs-fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.ivs-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, 
        rgba(0, 0, 0, 0.4) 0%,
        rgba(0, 0, 0, 0) 20%,
        rgba(0, 0, 0, 0) 80%,
        rgba(0, 0, 0, 0.4) 100%
    );
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ivs-wrapper:hover::before {
    opacity: 1;
}

.ivs-wrapper.active-video::before {
    opacity: 0;
}

/* Global IVS Controls */
.global-ivs-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 10px;
    background: rgba(0, 0, 0, 0.8);
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: opacity 0.3s ease;
}

.global-ivs-controls:hover {
    opacity: 1;
}

.global-ivs-controls button {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.global-ivs-controls button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.global-ivs-controls .autoplay-icon {
    transition: opacity 0.3s ease;
}

.global-ivs-controls .autoplay-icon[data-enabled="false"] {
    opacity: 0.5;
}

/* Standalone video styles */
.standalone-ivs-video {
    max-width: 100%;
    margin: 0 auto;
}

/* Error state */
.ivs-video.error {
    position: relative;
}

.ivs-video.error::after {
    content: 'Error loading video';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    background: rgba(0, 0, 0, 0.7);
    padding: 1rem;
    border-radius: 4px;
    font-size: 14px;
}

/* Loading state */
.ivs-video:not([data-ivs-ready="true"]) {
    position: relative;
}

.ivs-video:not([data-ivs-ready="true"])::after {
    content: 'Loading...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    background: rgba(0, 0, 0, 0.7);
    padding: 1rem;
    border-radius: 4px;
    font-size: 14px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .ivs-player-controls {
        bottom: 0.5rem;
        left: 0.5rem;
        gap: 0.5rem;
    }

    .ivs-play-btn,
    .ivs-audio-btn,
    .ivs-fullscreen-btn {
        width: 40px;
        height: 40px;
    }

    .global-ivs-controls {
        bottom: 10px;
        right: 10px;
        padding: 8px;
    }

    .global-ivs-controls button {
        width: 32px;
        height: 32px;
    }
}

.jj-aws-ivs-recording-player {
    width: 100%;
    height: auto;
    display: block;
    background: #000;
}

/* Video container needs relative positioning for play button */
.jj-aws-ivs-recording-player-container {
    position: relative;
    width: 100%;
    height: auto;
}

/* Play button styles */
.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #fff;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.play-button:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translate(-50%, -50%) scale(1.1);
}

.play-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5);
}

/* Video states */
.jj-aws-ivs-recording-player.needs-interaction {
    cursor: pointer;
}

.jj-aws-ivs-recording-player.is-playing {
    cursor: default;
}

/* Hide play button when video is playing */
.jj-aws-ivs-recording-player.is-playing ~ .play-button {
    display: none;
}

/* Loading state */
.jj-aws-ivs-recording-player:not([data-ivs-ready="true"]) {
    opacity: 0.7;
}

/* Error state */
.jj-aws-ivs-recording-player.error {
    background: #333;
}

.jj-aws-ivs-recording-player.error::after {
    content: '⚠️';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    color: #fff;
} 