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

/* Aspect ratio container (.pytv-ratio) and the facade base box
   ([data-pytv="facade"]) now live in css/stylesheet.css. That file is in the
   <head> on every page, this one is appended at the end of the document and
   only when it is needed - so the facade keeps a visible area even if this
   file never arrives. Everything below is the full appearance. */

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

/* 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;
}

/* Gallery Video Thumbnails */
.pytv-gallery-thumb-inner {
    position: relative;
    display: block;
    width: 100%;
    cursor: pointer;
    overflow: hidden;
    border-radius: .25rem;
    border: 2px solid transparent;
    transition: border-color .15s ease-in-out;
    background: #000;
    aspect-ratio: 1 / 1;
}
.pytv-gallery-thumb-inner:hover,
.pytv-gallery-thumb-inner:focus,
.pytv-gallery-thumb-inner.active {
    border-color: #dc3545;
    outline: none;
}
.pytv-gallery-thumb-inner img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Red play icon (bottom-right, small circle) */
.pytv-gallery-play-icon {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 22px;
    height: 22px;
    background: rgba(220, 53, 69, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.pytv-gallery-play-icon svg { width: 12px; height: 12px; }

/* Inline player replacing main image */
.pytv-gallery-player { position: relative; width: 100%; }
.pytv-gallery-ratio {
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* 1:1 matching product images */
    height: 0;
    overflow: hidden;
    background: #000;
    border-radius: .25rem;
}
.pytv-gallery-ratio > [data-pytv="facade"] {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
}
