/* Popup thông báo - hiển thị tự động khi truy cập */

/* Khóa scroll nền khi popup đang mở */
body.announcement-popup-open {
    overflow: hidden;
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
}

.announcement-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none; /* Khi đóng: không chặn click, cho phép tương tác với nội dung bên dưới */
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
}

.announcement-popup-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto; /* Khi mở: nhận click bình thường */
}

/* Khi đóng: toàn bộ nội dung bên trong overlay cũng không được chặn click (con không kế thừa pointer-events) */
.announcement-popup-overlay:not(.show) * {
    pointer-events: none !important;
}

.announcement-popup {
    background-image: url("../images/popup/background_content_popup.webp");
    background-position: bottom center;
    background-size: cover;
    background-repeat: no-repeat;
    border-radius: 12px;
    overflow: hidden;
    width: min(900px, calc(100vw - 40px));
    min-width: 320px;
    max-width: 900px;
    max-height: 95vh;
    min-height: 560px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    margin: auto;
    box-sizing: border-box;
}

/* Header đỏ */
/* Header popup - màu brand ABC VIP (vibrant red) */
.announcement-popup-header {
    background: linear-gradient(180deg, #F6576A 0%, #C63741 100%);
    color: #fff;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.announcement-popup-title {
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.announcement-popup-close {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: opacity 0.2s;
}

.announcement-popup-close img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.announcement-popup-close:hover {
    opacity: 0.85;
}

/* Header mobile khi xem nội dung (back + title + close) - ẩn trên PC */
.announcement-popup-header-mobile-content {
    display: none;
}

.announcement-popup-header-mobile-content .announcement-popup-title {
    flex: 1;
    text-align: center;
}

.announcement-popup-back {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.announcement-popup-back:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Footer mobile - nút ĐÓNG (ẩn trên PC) */
.announcement-mobile-footer {
    display: none;
}

.announcement-btn-close-mobile {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(180deg, #F6576A 0%, #C63741 100%);
    border: none;
    border-radius: 0 0 12px 12px;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
}

/* Body: sidebar + content - min-height 0 để không tràn viewport */
.announcement-popup-body {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Sidebar trái */
.announcement-sidebar {
    width: 180px;
    min-width: 180px;
    background: #fff;
    border-right: 1px solid #eee;
    padding: 12px 0;
}

.announcement-sidebar-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    color: #b71c1c;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    transition: background 0.2s;
}

.announcement-sidebar-item:hover {
    background: #fff5f5;
}

.announcement-sidebar-item.active {
    background: linear-gradient(90deg, #8e0000 0%, #b71c1c 35%, #c62828 100%);
    border-left-color: transparent;
    color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2),
    -1px 0 2px rgba(0, 0, 0, 0.08);
}

.announcement-sidebar-item.active .arrow {
    color: #fff;
}

.announcement-sidebar-item .arrow {
    color: #999;
    font-size: 12px;
}

/* Nội dung chính - co giãn theo viewport, scroll bên trong (tránh tràn Desktop/iPad) */
.announcement-content {
    flex: 1 1 300px;
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    min-height: 0;
    max-height: 100%;
    min-width: 300px;
}

.announcement-content-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 100%;
    max-width: 100%;
}

.announcement-content-panel.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.announcement-banner {
    overflow: hidden;
}

.announcement-banner img {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    vertical-align: top;
}

.announcement-banner-inner {
    position: relative;
    z-index: 1;
}

.announcement-logos {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.logo-jj88 {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
}

.logo-divider {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 300;
}

.logo-abc {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.announcement-headline {
    font-size: 22px;
    font-weight: 800;
    color: #ffc107;
    text-transform: uppercase;
    margin: 0 0 6px 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.announcement-subline {
    font-size: 14px;
    font-weight: 700;
    color: #ffeb3b;
    text-transform: uppercase;
    margin: 0 0 4px 0;
}

.announcement-banner-icons {
    position: absolute;
    top: 16px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
}

.icon-lightning {
    background: rgba(255, 152, 0, 0.9);
    box-shadow: 0 0 12px rgba(255, 152, 0, 0.6);
}

.icon-shield {
    background: rgba(233, 30, 99, 0.9);
    box-shadow: 0 0 12px rgba(233, 30, 99, 0.5);
    font-weight: bold;
}

.usdt-coin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: linear-gradient(180deg, #ffd54f 0%, #ffa000 100%);
    color: #5d4037;
    font-size: 16px;
    font-weight: 800;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Nút CTA */
.announcement-cta {
    display: block;
    margin: 16px 24px;
    padding: 12px 24px;
    background: linear-gradient(180deg, #d32f2f 0%, #b71c1c 100%);
    border: 2px solid #ffc107;
    border-radius: 28px;
    color: #fff !important;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.announcement-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(198, 40, 40, 0.4);
    color: #fff;
}

.announcement-text {
    padding: 20px;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    overflow-wrap: break-word;
    word-wrap: break-word;
    width: 100%;
    box-sizing: border-box;
}
.text-info {
    text-decoration: none;
}

.announcement-text .greeting {
    margin-bottom: 12px;
    font-weight: 500;
}
.img_fan {
    width: 3%;
}

.announcement-text p {
    margin-bottom: 12px;
}

.announcement-text strong {
    color: #b71c1c;
}

/* Responsive - Tablet (iPad Pro 1024px): popup không tràn viewport */
@media (max-width: 1024px) {
    .announcement-popup {
        width: min(995px, calc(100vw - 40px));
        max-height: 92vh;
    }
}


@media (max-width: 768px) {
    .announcement-popup-overlay {
        padding: 10px;
        align-items: center;
    }
    .img_fan {
        width: 7%;
    }

    .announcement-popup {
        max-height: min(85vh, calc(100vh - 24px));
        min-height: 439px;
        height: auto;
        background-image: url("../images/popup/background_content_mb.webp");
        background-size: cover;
        background-position: center;
    }

    .announcement-popup-body {
        flex-direction: column;
        flex: 1;
        min-height: 0;
        overflow-y: auto;
    }

    /* Mobile: mặc định chỉ hiện danh sách (sidebar) + footer ĐÓNG */
    .announcement-content {
        display: none !important;
        height: auto;
        min-height: 0;
    }

    .announcement-popup.mobile-content-view .announcement-content {
        display: block !important;
        flex: 1;
        min-height: 0;
        min-width: 0;
        max-height: 100%;
        overflow-y: auto;
    }

    /* Mobile content view: bỏ absolute panels để tránh bị "cắt" nội dung */
    .announcement-popup.mobile-content-view .announcement-content-panel {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition: none;
        overflow: visible;
        max-height: none;
        max-width: 100%;
        display: none;
    }

    .announcement-popup.mobile-content-view .announcement-content-panel.active {
        display: block;
    }

    .announcement-popup.mobile-content-view .announcement-sidebar,
    .announcement-popup.mobile-content-view .announcement-mobile-footer {
        display: none !important;
    }

    .announcement-popup.mobile-content-view .announcement-popup-header:not(.announcement-popup-header-mobile-content) {
        display: none !important;
    }

    .announcement-popup.mobile-content-view .announcement-popup-header-mobile-content {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
    }

    .announcement-mobile-footer {
        display: block;
    }

    .announcement-popup.mobile-content-view .announcement-mobile-footer {
        display: none !important;
    }

    /* Sidebar mobile: danh sách dọc, item nền trắng + box-shadow, bo góc */
    .announcement-sidebar {
        width: 100%;
        min-width: 100%;
        border-right: none;
        border-bottom: none;
        padding: 16px;
        display: block;
        flex: 1;
        overflow-y: auto;
        background: repeating-linear-gradient(
                -45deg,
                #fafafa,
                #fafafa 8px,
                #f5f5f5 8px,
                #f5f5f5 16px
        );
    }

    .announcement-sidebar-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        flex: none;
        padding: 16px 18px;
        margin-bottom: 12px;
        border: none;
        border-radius: 14px;
        background: #fff;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        color: #b71c1c;
    }

    .announcement-sidebar-item:last-child {
        margin-bottom: 0;
    }

    .announcement-sidebar-item .arrow {
        display: inline;
        color: #b71c1c;
    }

    .announcement-sidebar-item.active {
        background: #fff;
        border: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        color: #b71c1c;
    }

    .announcement-headline {
        font-size: 18px;
    }

    .announcement-subline {
        font-size: 12px;
    }

    .announcement-banner-icons {
        position: static;
        margin-top: 12px;
    }
}