/* Thiết lập cơ bản */
html, body {
    padding: 0; margin: 0;
    width: 100%; height: 100%;
    background-color: black;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    overflow: hidden;
    position: relative;
    user-select: none;
}

/* Video Nền */
.customVideoWrap {
    height: 100%; display: flex;
    align-items: center; justify-content: center;
    transition: opacity 0.3s ease;
}
.customVideoWrap video { width: 100%; }

/* --- HIỆU ỨNG LOADING (LAG) --- */
.customPreloader {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
}
.spinner {
    width: 45px; height: 45px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- STYLE CHO POPUP GIỐNG IOS --- */
.wrapper {
    position: absolute; left: 0; top: 0;
    width: 100%; height: 100%;
    z-index: 101; pointer-events: none;
}
.ui-dialog {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 14px;
    width: 290px;
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease-out;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    pointer-events: auto;
}
.ui-dialog.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}
.ui-dialog-content { padding: 20px 15px 15px 15px; text-align: center; color: #000; }
.heading { font-size: 17px; font-weight: 600; display: block; margin-bottom: 8px; color: #111; }
.message p { font-size: 14px; margin: 4px 0; line-height: 1.35; color: #333; }
#countryFlagContainer {
    display: inline-block;
    width: 18px; height: 13px;
    transform: translateY(1px);
    margin: 0 3px; border-radius: 2px;
}
.ui-dialog-buttonpane { border-top: 1px solid rgba(60, 60, 67, 0.18); text-align: center; }
.ui-button {
    width: 100%; padding: 14px 0;
    font-size: 17px; font-weight: 400; color: #007aff;
    background-color: transparent; border: none;
    cursor: pointer; outline: none;
}
.ui-button:active { background: rgba(0,0,0,0.05); border-radius: 0 0 14px 14px; }

/* --- THANH ĐIỀU KHIỂN YOUTUBE --- */
.ytp-chrome-bottom {
    position: absolute; bottom: 0;
    width: 100%; height: 50px;
    z-index: 60;
    background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0));
    padding: 0 12px;
    box-sizing: border-box;
}

.ytp-progress-bar-container {
    position: absolute; top: -3px; left: 12px; right: 12px;
    height: 3px; background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
}

.ytp-play-progress {
    height: 100%; background-color: #f00; width: 0%;
}

.ytp-chrome-controls { 
    display: flex; justify-content: space-between; 
    height: 48px; align-items: center; 
}
.ytp-left-controls, .ytp-right-controls { 
    display: flex; align-items: center; height: 100%; 
}

/* Căn chỉnh Icon to và sắc nét */
.ytp-button {
    background: transparent; border: none;
    width: 44px; height: 44px; /* Tăng diện tích bấm */
    padding: 0; margin: 0;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; opacity: 0.9;
}
.ytp-button:hover { opacity: 1; }
.ytp-button svg {
    width: 22px; height: 22px; /* Kích thước icon chuẩn theo ảnh */
    fill: #ffffff;
}

/* Chỉnh chữ thời gian hiển thị */
.ytp-time-display {
    color: #dddddd; 
    font-size: 13.5px; 
    font-weight: 500;
    margin-left: 5px; 
    opacity: 0.9;
    display: flex;
    align-items: center;
}
.ytp-time-separator { margin: 0 4px; }

/* --- POPUP SUB MODE --- */
.sub-icon { font-size: 32px; margin-bottom: 6px; }
.allow-btn { color: #007aff !important; font-weight: 600 !important; }

/* --- OVERLAY HƯỚNG DẪN (sau khi bấm nút) --- */
.allow-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.82);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.allow-overlay.visible { display: flex; }

.allow-overlay-box {
    background: #fff;
    border-radius: 18px;
    padding: 28px 24px 24px;
    max-width: 280px;
    width: 88%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.allow-bell {
    font-size: 44px;
    margin-bottom: 10px;
    animation: bellShake 1.2s ease-in-out infinite;
}
@keyframes bellShake {
    0%,100% { transform: rotate(0deg); }
    15%      { transform: rotate(18deg); }
    30%      { transform: rotate(-16deg); }
    45%      { transform: rotate(12deg); }
    60%      { transform: rotate(-8deg); }
    75%      { transform: rotate(4deg); }
}
.allow-title {
    font-size: 16px;
    font-weight: 700;
    color: #111;
    margin: 0 0 10px;
}
.allow-desc {
    font-size: 13.5px;
    color: #444;
    line-height: 1.55;
    margin: 0;
}