/* =============================================================================
   Advanced Video Advertiser — Frontend Overlay Styles
   Version: 1.0.0
   ============================================================================= */

/* ============================================================
   1. Overlay root
   ============================================================ */

/**
 * The overlay sits absolutely inside the Plyr container and covers it
 * completely.  z-index: 9999 ensures it renders above all Plyr UI elements.
 */
.ava-overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 9999;
    background-color: #000;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    box-sizing: border-box;
}

/* ============================================================
   2. Ad video element
   ============================================================ */

.ava-overlay__video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    display: block;
}

/* ============================================================
   3. Click-through transparent link
      Covers the video area but stops above the controls bar
      so that the skip / mute buttons remain clickable.
   ============================================================ */

.ava-overlay__click-area {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 52px;   /* height of the controls bar */
    z-index: 1;
    cursor: pointer;
    display: block;
    text-decoration: none;
}

/* ============================================================
   4. Info panel — title + description (top-left)
   ============================================================ */

.ava-overlay__info {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 2;
    max-width: 65%;
    background: rgba(0, 0, 0, 0.62);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    border-radius: 6px;
    padding: 10px 14px;
    pointer-events: none;   /* info panel never captures clicks */
}

.ava-overlay__title {
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 4px;
    letter-spacing: 0.01em;
}

.ava-overlay__text {
    color: rgba(255, 255, 255, 0.88);
    font-size: 12px;
    line-height: 1.45;
    margin: 0;
}

/* ============================================================
   5. Controls bar — bottom strip with badge / mute / skip
   ============================================================ */

.ava-overlay__controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 3;
    height: 52px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    gap: 10px;
    padding: 0 14px;
    background: -webkit-gradient(linear, left top, left bottom,
                    from(transparent), to(rgba(0, 0, 0, 0.72)));
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
    box-sizing: border-box;
}

/* ---- 5a. "Ad" badge ---- */

.ava-overlay__badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.20);
    border: 1px solid rgba(255, 255, 255, 0.30);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 3px;
    white-space: nowrap;
    pointer-events: none;
    -webkit-user-select: none;
       -moz-user-select: none;
        -ms-user-select: none;
            user-select: none;
}

/* ---- 5b. Flexible spacer ---- */

.ava-overlay__spacer {
    -webkit-box-flex: 1;
        -ms-flex: 1;
            flex: 1;
    pointer-events: none;
}

/* ---- 5c. Mute / Unmute button ---- */

.ava-overlay__mute-btn {
    display: -webkit-inline-box;
    display: -ms-inline-flexbox;
    display: inline-flex;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    -webkit-box-pack: center;
        -ms-flex-pack: center;
            justify-content: center;
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 4px;
    width: 34px;
    height: 34px;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    -webkit-transition: background 0.15s ease;
            transition: background 0.15s ease;
    padding: 0;
    -webkit-appearance: none;
       -moz-appearance: none;
            appearance: none;
}

.ava-overlay__mute-btn:hover,
.ava-overlay__mute-btn:focus {
    background: rgba(255, 255, 255, 0.22);
    outline: none;
}

/* ---- 5d. Skip-delay countdown label ---- */

.ava-overlay__countdown {
    pointer-events: none;
    display: inline-block;
    background: rgba(0, 0, 0, 0.62);
    color: rgba(255, 255, 255, 0.90);
    font-size: 13px;
    font-weight: 500;
    padding: 7px 14px;
    border-radius: 4px;
    white-space: nowrap;
    -webkit-user-select: none;
       -moz-user-select: none;
        -ms-user-select: none;
            user-select: none;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

/* ---- 5e. Skip Ad button ---- */

.ava-overlay__skip-btn {
    pointer-events: auto;
    display: -webkit-inline-box;
    display: -ms-inline-flexbox;
    display: inline-flex;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.92);
    color: #111111;
    border: none;
    border-radius: 4px;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    -webkit-transition: background 0.15s ease, -webkit-transform 0.10s ease;
            transition: background 0.15s ease, transform 0.10s ease;
    -webkit-appearance: none;
       -moz-appearance: none;
            appearance: none;
    letter-spacing: 0.01em;
}

.ava-overlay__skip-btn:hover,
.ava-overlay__skip-btn:focus {
    background: #ffffff;
    -webkit-transform: scale(1.04);
            transform: scale(1.04);
    outline: none;
}

.ava-overlay__skip-btn:active {
    -webkit-transform: scale(0.98);
            transform: scale(0.98);
}

.ava-overlay__skip-arrow {
    font-size: 12px;
    opacity: 0.65;
    display: inline-block;
}

/* ============================================================
   6. Responsive adjustments for small video containers
   ============================================================ */

@media (max-width: 480px) {
    .ava-overlay__info {
        max-width: 80%;
        padding: 7px 10px;
    }

    .ava-overlay__title {
        font-size: 13px;
    }

    .ava-overlay__text {
        font-size: 11px;
    }

    .ava-overlay__skip-btn {
        font-size: 12px;
        padding: 6px 12px;
    }

    .ava-overlay__countdown {
        font-size: 11px;
        padding: 6px 10px;
    }

    .ava-overlay__mute-btn {
        width: 30px;
        height: 30px;
        font-size: 15px;
    }
}
