/**
 * Jezweb Embed Any Video - Frontend Styles
 *
 * @package Jezweb_Embed_Any_Video
 */

/* Base Video Wrapper */
.jeav-video-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    overflow: hidden;
    background-color: #000;
}

/* Aspect Ratio Containers using padding-bottom technique */
.jeav-video-wrapper.jeav-aspect-16-9 {
    padding-bottom: 56.25%; /* 9/16 = 0.5625 */
    height: 0;
}

.jeav-video-wrapper.jeav-aspect-4-3 {
    padding-bottom: 75%; /* 3/4 = 0.75 */
    height: 0;
}

.jeav-video-wrapper.jeav-aspect-21-9 {
    padding-bottom: 42.857%; /* 9/21 = 0.42857 */
    height: 0;
}

.jeav-video-wrapper.jeav-aspect-9-16 {
    padding-bottom: 177.778%; /* 16/9 = 1.77778 */
    height: 0;
}

.jeav-video-wrapper.jeav-aspect-1-1 {
    padding-bottom: 100%; /* 1/1 = 1 */
    height: 0;
}

/* Video and Iframe Positioning */
.jeav-video-wrapper iframe,
.jeav-video-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Original aspect ratio - no padding-bottom */
.jeav-video-wrapper:not([class*="jeav-aspect-"]) video,
.jeav-video-wrapper:not([class*="jeav-aspect-"]) iframe {
    position: relative;
    display: block;
}

.jeav-video-wrapper:not([class*="jeav-aspect-"]) video {
    max-width: 100%;
    height: auto;
}

/* Error Messages (admin only) */
.jeav-error {
    padding: 10px 15px;
    margin: 10px 0;
    background-color: #fef1f1;
    border: 1px solid #f5c6cb;
    border-left: 4px solid #dc3545;
    color: #721c24;
    font-size: 14px;
    border-radius: 4px;
}

/* Lazy Load Placeholder */
.jeav-video-wrapper.jeav-lazy-placeholder {
    background-color: #1a1a1a;
}

.jeav-video-wrapper.jeav-lazy-placeholder::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 48px;
    height: 48px;
    margin-top: -24px;
    margin-left: -24px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: jeav-spin 1s linear infinite;
}

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

/* Responsive Adjustments */
@media screen and (max-width: 600px) {
    /* Vertical videos get max-width on mobile for better UX */
    .jeav-video-wrapper.jeav-aspect-9-16 {
        max-width: 80%;
    }
}

/* Print Styles */
@media print {
    .jeav-video-wrapper {
        display: none;
    }
}
