/*
 * YouTube Video Player Styles
 * Bootstrap 4 compatible
 */

/* Aspect ratio container - uses padding-bottom trick */
.pytv-ratio {
    position: relative;
    width: 100%;
    height: 0;
    overflow: hidden;
    border-radius: .25rem;
    background: #000;
}

/* Facade fills the ratio container */
[data-pytv="facade"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    background: #000;
    overflow: hidden;
}

[data-pytv="facade"] img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Play button centering */
[data-pytv="play"] {
    width: auto !important;
    height: auto !important;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    border-radius: 50rem;
    transition: opacity .15s ease-in-out, background-color .15s ease-in-out;
    pointer-events: none;
}

/* Hover/focus states */
[data-pytv="facade"]:hover [data-pytv="play"] {
    opacity: .85;
}

[data-pytv="facade"]:focus [data-pytv="play"],
[data-pytv="facade"]:focus-within [data-pytv="play"] {
    outline: 0;
    box-shadow: 0 0 0 .2rem rgba(0, 123, 255, .25);
}

/* Error state */
[data-pytv="error"] {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .75);
    color: #fff;
    z-index: 3;
}

/* Progress bar */
[data-pytv="progress"] {
    display: none;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 4;
    background: rgba(255, 255, 255, .2);
}
[data-pytv="progress-bar"] {
    height: 100%;
    background: #dc3545;
    width: 0;
    transition: width .25s linear;
}

/* Thumbnail restore overlay */
[data-pytv="thumb-restore"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

/* YouTube iframe inside facade */
[data-pytv="facade"] iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Player container created by JS */
[data-pytv="facade"] > div[id^="pytv-player-"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Privacy notice */
.pytv-privacy {
    font-size: .75rem;
    color: #6c757d;
    margin-top: .5rem;
}

/* Carousel thumbnail strip */
.pytv-thumb-strip {
    margin-top: .5rem;
}
.pytv-thumb-strip img {
    cursor: pointer;
    opacity: .6;
    transition: opacity .15s;
    border: 2px solid transparent;
    border-radius: .25rem;
}
.pytv-thumb-strip img:hover,
.pytv-thumb-strip img.active {
    opacity: 1;
    border-color: #007bff;
}
