/* --- AOnePlayer for AIO Video - subtitles, chapters, the news ticker and sponsor logos.   Author: MD OMAR FARUK | www.faruk.bd | Copyright (c) 2026 --- */

/* ---------------------------------------------------------- the layers sit above the control bar
   --aone-bar-h is the bar's height (measured by aone-text.js); the bar shows while the player is not idle */

/* ---------------------------------------------------------- captions */
.aiop .aone-captions {
    position: absolute; left: 5%; right: 5%; bottom: 5%; z-index: 1;
    text-align: center; pointer-events: none; transition: bottom .2s;
    font: 550 var(--aone-cap-px, 18px)/1.35 "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
}
.aiop:not(.is-idle) .aone-captions { bottom: calc(var(--aone-bar-h, 66px) + 10px); }
.aiop.has-aone-ticker:not(.aone-ticker-top) .aone-captions { bottom: calc(5% + 34px); }
.aiop.has-aone-ticker:not(.aone-ticker-top):not(.is-idle) .aone-captions { bottom: calc(var(--aone-bar-h, 66px) + 44px); }
.aone-cue {
    display: inline; padding: .1em .45em; border-radius: 4px; color: #fff; background: rgba(8, 8, 8, .75);
    -webkit-box-decoration-break: clone; box-decoration-break: clone; text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
}
.aiop-btn.aone-ccbtn { position: relative; }
.aiop-btn.aone-ccbtn::after {
    content: ""; position: absolute; left: 25%; right: 25%; bottom: 6px; height: 3px; border-radius: 2px;
    background: var(--aiop-red); transform: scaleX(0); transition: transform .15s;
}
.aiop-btn.aone-ccbtn.on::after { transform: scaleX(1); }

/* ---------------------------------------------------------- chapters */
.aiop .aone-chaps { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.aiop .aone-chaps i { position: absolute; top: -1px; bottom: -1px; width: 3px; margin-left: -1px; background: rgba(0, 0, 0, .8); }
.aiop .aone-chapname {
    display: inline-flex; align-items: center; gap: 4px; min-width: 0; max-width: 240px; height: 32px; padding: 0 6px;
    border: 0; border-radius: 8px; background: none; color: #fff; font: 500 13px/1 "Roboto", system-ui, sans-serif;
    cursor: pointer; opacity: .92; white-space: nowrap;
}
.aiop .aone-chapname[hidden] { display: none; }
.aiop .aone-chapname:hover { background: rgba(255, 255, 255, .12); opacity: 1; }
.aiop .aone-chapname .dot { opacity: .8; }
.aiop .aone-chapname .t { overflow: hidden; text-overflow: ellipsis; }
.aiop .aone-chapname svg { width: 16px; height: 16px; flex: 0 0 16px; fill: #fff; }
.aiop.aone-small .aone-chapname { max-width: 120px; font-size: 12px; }
.aiop .aiop-scrub .tip .aone-tipchap {
    display: block; max-width: 220px; margin: 0 auto 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: #fff; font-size: 12.5px; font-weight: 650; text-shadow: 0 1px 3px #000;
}
.aiop .aiop-scrub .tip .aone-tipchap:empty { display: none; }
.aiop-menu .aone-mch .lbl { white-space: normal; }
.aiop-menu .aone-mch-at { display: inline-block; min-width: 46px; margin-right: 6px; color: #aaa; font-variant-numeric: tabular-nums; font-size: 12px; }

/* ---------------------------------------------------------- news ticker */
.aiop .aone-ticker {
    position: absolute; left: 0; right: 0; z-index: 1; display: flex; align-items: stretch; height: 34px;
    background: var(--aone-tk-bg, rgba(10, 10, 14, .86)); color: var(--aone-tk-color, #fff);
    font: 600 14.5px/1 "Roboto", system-ui, sans-serif; overflow: hidden; opacity: 0; transition: bottom .2s, opacity .3s;
}
.aiop .aone-ticker.on { opacity: .94; }
.aiop .aone-ticker.at-bottom { bottom: 0; }
.aiop:not(.is-idle) .aone-ticker.at-bottom { bottom: var(--aone-bar-h, 66px); }
.aiop .aone-ticker.at-top { top: 0; }
.aone-ticker-label {
    flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 0 22px 0 12px;
    background: var(--aone-tk-label, #e83636); color: #fff; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; font-size: 12.5px;
    clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}
.aone-ticker-label[hidden] { display: none; }
.aone-ticker-label i { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: aone-blink 1.4s infinite; }
.aone-ticker-track {
    position: relative; flex: 1 1 auto; overflow: hidden; display: flex; align-items: center;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent); mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
}
.aone-ticker-run { display: flex; white-space: nowrap; animation: aone-tick linear infinite; will-change: transform; }
.aone-ticker:hover .aone-ticker-run { animation-play-state: paused; }
.aone-tk-half { display: flex; align-items: center; flex: 0 0 auto; }
.aone-tk-item a { color: inherit; text-decoration: none; }
.aone-tk-item a:hover { text-decoration: underline; }
.aone-tk-sep { margin: 0 18px; font-size: 9px; opacity: .7; }
.aiop.aone-small .aone-ticker { height: 30px; font-size: 13px; }
.aiop.aone-small .aone-ticker-label { padding-left: 8px; padding-right: 16px; font-size: 11px; }
@keyframes aone-tick { from { transform: translateX(0); } to { transform: translateX(calc(-1 * var(--aone-tk-w, 600px))); } }
@keyframes aone-blink { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .aone-ticker-run { animation-duration: 90s !important; } }

/* ---------------------------------------------------------- sponsor logos */
.aiop .aone-spn-layer { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.aiop .aone-spn { position: absolute; opacity: 0; transform: translateY(6px); transition: opacity .45s, transform .45s, top .2s, bottom .2s; pointer-events: none; text-decoration: none; }
.aiop .aone-spn.on { opacity: 1; transform: none; pointer-events: auto; }
.aiop .aone-spn img { display: block; height: 48px; width: auto; max-width: 180px; border-radius: 8px; filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .4)); }
.aiop.aone-small .aone-spn img { height: 34px; max-width: 120px; }
.aiop .aone-spn.at-top-left { top: 14px; left: 14px; }
.aiop .aone-spn.at-top-right { top: 14px; right: 14px; }
.aiop.has-cards .aone-spn.at-top-right { top: 58px; }
.aiop .aone-spn.at-top-left.by-mark, .aiop .aone-spn.at-top-right.by-mark { top: calc(14% + 26px); }
.aiop .aone-spn.at-bottom-left { left: 14px; bottom: calc(var(--aone-bar-h, 66px) + 10px); }
.aiop .aone-spn.at-bottom-right { right: 14px; bottom: calc(var(--aone-bar-h, 66px) + 10px); }
.aiop .aone-spn.at-bottom-left.by-mark, .aiop .aone-spn.at-bottom-right.by-mark { bottom: calc(var(--aone-bar-h, 66px) + 14% + 18px); }
.aiop.has-aone-ticker:not(.aone-ticker-top) .aone-spn.at-bottom-left,
.aiop.has-aone-ticker:not(.aone-ticker-top) .aone-spn.at-bottom-right { bottom: calc(var(--aone-bar-h, 66px) + 44px); }
.aiop.aone-ticker-top .aone-spn.at-top-left, .aiop.aone-ticker-top .aone-spn.at-top-right { top: 48px; }

/* ---------------------------------------------------------- out of the way */
.aiop.is-break .aone-captions, .aiop.is-break .aone-ticker, .aiop.is-break .aone-spn-layer,
.aiop.is-lband .aone-ticker, .aiop.is-lband .aone-spn-layer,
.aiop.is-yt-pick .aone-ticker, .aiop.is-yt-pick .aone-spn-layer,
.aiop.is-mini .aone-ticker, .aiop.is-mini .aone-spn-layer, .aiop.is-mini .aone-chapname,
.aiop.is-frame-live .aone-captions { display: none !important; }

/* ---------------------------------------------------------- the Subtitles box of the upload and edit forms */
.aone-subsform .aone-subs-list { display: grid; gap: 8px; margin-bottom: 10px; }
.aone-subs-row {
    position: relative; display: flex; align-items: baseline; gap: 10px; padding: 10px 40px 10px 12px;
    border: 1px solid var(--line, #dfe3ea); border-radius: 10px; background: var(--bg, #fff);
}
.aone-subs-row b { font-size: 13.5px; }
.aone-subs-row small { font-size: 12px; color: var(--muted, #6b7280); }
.aone-subs-row.is-new { border-color: #16a34a; }
.aone-subs-row.is-gone b { text-decoration: line-through; opacity: .6; }
.aone-subs-add { display: grid; gap: 8px 10px; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; }
.aone-subs-add label span { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted, #6b7280); margin-bottom: 4px; }
.aone-subs-add label small { font-weight: 400; }
.aone-subs-add input[type="file"] { width: 100%; font-size: 12.5px; }
.aone-subs-said { margin-top: 8px; font-size: 12.5px; color: #15803d; min-height: 1em; }
.aone-subs-said.bad { color: #dc2626; }
@media (max-width: 720px) { .aone-subs-add { grid-template-columns: 1fr; } }
