/* ===== VideoAPI player box - dark + amber accent ===== */

.videoapi-player-box {
    position: relative;
}

.videoapi-player-box .videoapi-player-inner {
    transition: opacity .2s ease;
}

.videoapi-player-box .videoapi-player-inner iframe {
    width: 100%;
    height: 100%;
}

/* Loading spinner */
.videoapi-loading .videoapi-player-frame:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 42px;
    height: 42px;
    margin: -21px 0 0 -21px;
    border: 3px solid rgba(255, 255, 255, .12);
    border-top-color: #f5b50a;
    border-radius: 50%;
    animation: videoapi-spin .8s linear infinite;
    z-index: 5;
}

@keyframes videoapi-spin {
    to { transform: rotate(360deg); }
}

/* ===== Thanh chon server ===== */
.videoapi-controls {
    margin-top: 10px;
}

.videoapi-servers-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #151c26;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 8px;
}

.videoapi-sv-label {
    color: #9aa4b2;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    margin-right: 4px;
}

.videoapi-sv-btn {
    display: inline-block;
    padding: 7px 18px;
    font-size: 13px;
    font-weight: 700;
    color: #c6cdd8;
    background: #1d2733;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 6px;
    cursor: pointer;
    transition: all .2s ease;
    text-decoration: none !important;
}

.videoapi-sv-btn:hover {
    color: #f5b50a;
    border-color: rgba(245, 181, 10, .6);
    background: #1d2733;
}

.videoapi-sv-btn.active {
    color: #1a1300;
    background: #f5b50a;
    border-color: #f5b50a;
    box-shadow: 0 2px 10px rgba(245, 181, 10, .3);
}

/* Chu thich duoi thanh server */
.videoapi-hint {
    margin-top: 7px;
    padding-left: 2px;
    color: #77808e;
    font-size: 12px;
    font-style: italic;
    line-height: 1.5;
}

.videoapi-hint:before {
    content: 'i';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 6px;
    border: 1px solid rgba(245, 181, 10, .5);
    border-radius: 50%;
    color: #f5b50a;
    font-size: 10px;
    font-style: normal;
    font-weight: 700;
    line-height: 13px;
    text-align: center;
    vertical-align: -1px;
}

/* Server bi loi -> mo di, gach ngang */
.videoapi-sv-btn.dead {
    opacity: .45;
    text-decoration: line-through !important;
}

.videoapi-sv-btn.dead:hover {
    background: #1d2733;
    border-color: rgba(255, 255, 255, .1);
    color: #c6cdd8;
}

/* ===== List tap ===== */
.videoapi-eps-wrap {
    margin-top: 8px;
}

ul.videoapi-eps,
#videoapi-list-server ul.videoapi-list-episode {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

ul.videoapi-eps.hidden,
#videoapi-list-server .hidden {
    display: none;
}

.videoapi-episode {
    margin: 0;
}

/* Server chi co 1 tap -> an nut tap (phong truong hop ajax.php cu con cached/opcache) */
ul.videoapi-eps > li:only-child {
    display: none;
}

ul.videoapi-eps:has(> li:only-child) {
    display: none;
}

.videoapi-btn {
    display: inline-block;
    min-width: 36px;
    padding: 6px 13px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: #c6cdd8;
    background: #1d2733;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 6px;
    cursor: pointer;
    transition: all .2s ease;
}

.videoapi-btn:hover {
    color: #f5b50a;
    border-color: rgba(245, 181, 10, .6);
}

.videoapi-btn.active {
    color: #1a1300;
    background: #f5b50a;
    border-color: #f5b50a;
}

/* ===== Legacy markup (LoadPlayer::index / [videoapi]) ===== */
#videoapi-list-server {
    margin: 10px 0;
}

#videoapi-list-server .videoapi-server {
    margin-bottom: 10px;
}

#videoapi-list-server .videoapi-server-name {
    color: #9aa4b2;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    margin: 0 0 6px;
}

#videoapi-list-server .clear {
    clear: both;
}

/* ===== Player error ===== */
.player-error {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 120px;
    background: #10151c;
    text-align: center;
}

.player-error p {
    color: #e89a9a;
    font-size: 15px;
    margin: 0;
    padding: 10px;
}
