/* Premium Video Player Styles */
:root {
    --cvp-primary: #ffffff;
    --cvp-bg: #000;
    --cvp-radius: 16px;
    --cvp-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.cvp-player-container {
    position: relative;
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    border-radius: var(--cvp-radius);
    overflow: hidden;
    background: var(--cvp-bg);
    line-height: 0;
    aspect-ratio: 16 / 9;
    /* Ensure consistent aspect ratio for cropping */
}

.cvp-player-container.is-shorts {
    aspect-ratio: 9 / 16;
    max-width: 400px !important;
    /* Limit width for vertical videos */
    margin: 0 auto;
}

.cvp-player-container.has-shadow {
    box-shadow: var(--cvp-shadow);
}

.cvp-youtube-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    cursor: pointer;
    background: transparent;
}

/* YouTube Cropping Logic to hide Title, Share, and Related Videos */
.cvp-player-container iframe {
    pointer-events: none;
    position: absolute;
    top: -8%;
    /* Reduced from -12% to prevent cutting content */
    left: 0;
    width: 100%;
    height: 116%;
    /* Reduced from 124% */
    transform: scale(1.02);
    /* Minimal scale to hide edges */
}

.cvp-player-container.is-shorts iframe {
    top: -4%;
    /* Reduced for vertical videos */
    height: 108%;
    transform: scale(1.01);
}

.cvp-player-container.is-playing iframe {
    pointer-events: auto;
}

/* Plyr Customization */
.plyr {
    width: 100% !important;
    max-width: 100% !important;
}

.plyr--full-ui {
    --plyr-color-main: var(--cvp-primary);
    --plyr-video-control-background-hover: rgba(255, 255, 255, 0.2);
    --plyr-control-radius: 8px;
}

.plyr__control--overlaid {
    background: rgba(255, 255, 255, 0.2);
    padding: 25px;
}

.plyr__control--overlaid svg {
    width: 30px;
    height: 30px;
    fill: #fff;
}

.plyr--video .plyr__controls {
    padding: 30px 20px 15px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.5) 50%, rgba(0, 0, 0, 0) 100%);
    border-bottom-left-radius: var(--cvp-radius);
    border-bottom-right-radius: var(--cvp-radius);
    z-index: 20;
    /* Ensure controls are above the iframe */
}

.plyr__progress__container {
    margin-bottom: 5px;
}

.plyr__volume {
    max-width: 100px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .plyr__controls {
        padding: 15px 10px 10px;
    }
}

/* Remove borders and outlines from controls */
.plyr__control,
.plyr__control--overlaid,
.plyr__controls button {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background-image: none !important;
    color: #fff !important;
}

.plyr__control svg {
    fill: #fff !important;
}

.plyr__control:focus,
.plyr__control:active,
.plyr--full-ui input[type=range]:focus {
    outline: 0 !important;
    box-shadow: none !important;
}

/* Progress bar and volume slider color */
.plyr--full-ui input[type=range] {
    color: #fff !important;
}

/* Settings Menu (Glassmorphism Dark) */
.plyr__menu__container {
    background: rgba(30, 30, 30, 0.8) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5) !important;
}

.plyr__menu__container [role="menu"] {
    color: #ffffff !important;
}

.plyr__menu__container .plyr__control {
    color: #ffffff !important;
}

.plyr__menu__container .plyr__control:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

.plyr__menu__container .plyr__control[aria-checked="true"]::before {
    background: #ffffff !important;
}

.plyr__menu__container .plyr__control--back {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}