/**
 * YouTube API Player Styles
 * 
 * @package wp.plugin.svx
 * @version 1.0.0
 * @author SV Agency
 * @since 1.0.0
 * 
 * Styles for YouTube IFrame Player API containers
 * Ensures proper sizing and visibility
 * 
 * Last Updated: 2025-01-27
 */

/* YouTube API Player Container */
.svx-youtube-player {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 270px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

/* Ensure proper aspect ratio */
.svx-youtube-player::before {
    content: '';
    display: block;
    padding-top: 56.25%; /* 16:9 aspect ratio */
}

/* YouTube iframe inside API player */
.svx-youtube-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Loading state */
.svx-youtube-player:not(.loaded) {
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: Arial, sans-serif;
}

.svx-youtube-player:not(.loaded)::after {
    content: 'Loading YouTube video...';
    font-size: 14px;
}

/* Error state */
.svx-youtube-player.error {
    background: #333;
    color: #ff6b6b;
}

.svx-youtube-player.error::after {
    content: 'Failed to load YouTube video';
    font-size: 14px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .svx-youtube-player {
        min-height: 200px;
    }
}

@media (max-width: 480px) {
    .svx-youtube-player {
        min-height: 180px;
    }
}

/* Integration with existing video components */
.card-video-component .svx-youtube-player,
.video-container .svx-youtube-player,
.embed-container .svx-youtube-player {
    width: 100%;
    height: 100%;
}

/* Ensure proper sizing in different contexts */
.svx-card .svx-youtube-player {
    height: 270px;
}

.svx-video .svx-youtube-player {
    height: 100%;
    min-height: 300px;
}

/* Hide loading text when iframe is present - use class-based approach */
.svx-youtube-player.loaded::after {
    display: none;
}
