/* Popup Thông Báo Mới - Auto hiển thị khi vào trang */

/* Khóa scroll trang khi popup mở */
html.popup-open,
body.popup-open {
    overflow: hidden;
}

.notification-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    padding: 16px;
    box-sizing: border-box;
}

.notification-popup-overlay.show {
    display: flex;
}
.img-fan {
    width: 3%;
}

.notification-popup {
    width: 100%;
    max-width: 900px;
    max-height: 95vh;
    min-height: 560px;
    border-radius: 12px;
    overflow: hidden;
    background-image: url('../images/popup/background_popup.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #1a1a1a;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.notification-popup-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 20px;
    position: relative;
    flex-shrink: 0;
}

.notification-popup-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.notification-popup-close {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    line-height: 0;
}

.notification-popup-close img {
    width: 28px;
    height: 28px;
    display: block;
}

.notification-popup-body {
    display: flex;
    flex: 1;
    min-height: 0;
}

.notification-popup-sidebar {
    width: 200px;
    flex-shrink: 0;
    background: #252525;
    padding: 8px 0;
}

.sidebar-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    color: #9a9a9a;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
}

.sidebar-item:hover,
.sidebar-item.active {
    background: linear-gradient(90deg, #ec6612, #f50000);
    color: #fff;
}

.sidebar-arrow {
    font-size: 18px;
    font-weight: 300;
}

.notification-popup-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    min-height: 420px;
    position: relative;
}

.popup-content-item {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.popup-content-item.active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    z-index: 1;
}

.popup-banner {
    margin-bottom: 20px;
    overflow: hidden;
}

.popup-banner img {
    width: 100%;
    height: auto;
}

.popup-banner .popup-banner-mb {
    display: none;
}

.popup-banner .popup-banner-pc {
    display: block;
}

.popup-text-content {
    color: #e0e0e0;
    font-size: 14px;
    line-height: 1.6;
}

.popup-text-content p {
    margin: 0 0 12px;
}

.popup-text-content p:last-child {
    margin-bottom: 0;
}

.text-orange-popup {
    color: #ec6612;
    font-weight: 700;
}

.popup-text-content a.text-orange-popup {
    text-decoration: underline;
}

.popup-text-content a.text-orange-popup:hover {
    color: #ff8c42;
}

/* Mobile detail header - ẩn mặc định */
.notification-popup-mobile-detail-header {
    display: none;
}

/* Nút ĐÓNG - ẩn trên desktop */
.popup-dong-btn {
    display: none;
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .notification-popup {
        background-image: url('../images/popup/background_popup-mb.webp');
    }

    .notification-popup-header {
        background: transparent;
    }

    .notification-popup-overlay {
        padding: 8px;
        align-items: center;
        justify-content: center;
    }

    .notification-popup {
        max-height: calc(100vh - 48px);
        min-height: auto;
        height: 462px;
    }

    .notification-popup.mobile-detail-view {
        height: auto;
        min-height: 462px;
    }
    .img-fan {
        width: 6%;
    }

    .notification-popup-body {
        flex-direction: column;
    }

    .notification-popup-mobile-list {
        display: flex;
        flex-direction: column;
        flex: 1;
        padding: 0 16px 16px;
        min-height: 0;
    }

    .notification-popup-sidebar {
        width: 100%;
        flex-direction: column;
        display: flex;
        padding: 8px 0;
        flex-shrink: 0;
        background: transparent;
    }

    .sidebar-item {
        flex: none;
        justify-content: space-between;
        padding: 14px 16px;
        font-size: 14px;
        margin-bottom: 12px;
        background: #FFEAD8;
        color: #E4300A;
        border-radius: 12px;
    }

    .sidebar-item:hover,
    .sidebar-item.active {
        background: #FFEAD8;
        color: #E4300A;
    }

    .sidebar-item .sidebar-arrow {
        display: block;
        color: #E4300A;
    }

    .popup-dong-btn {
        display: block;
        width: 100%;
        padding: 14px;
        margin-top: auto;
        margin-bottom: 0;
        font-size: 14px;
        font-weight: 700;
        text-transform: uppercase;
        color: #E4300A;
        background: #FFEAD8;
        border: none;
        border-radius: 12px;
        cursor: pointer;
        flex-shrink: 0;
    }

    .notification-popup-content {
        display: none;
        padding: 16px;
    }

    .notification-popup.mobile-detail-view .notification-popup-header {
        display: none;
    }

    .notification-popup.mobile-detail-view .notification-popup-mobile-detail-header {
        display: grid;
        grid-template-columns: 44px 1fr 44px;
        align-items: center;
        gap: 8px;
        padding: 16px 12px;
        background: transparent;
        flex-shrink: 0;
    }

    .notification-popup.mobile-detail-view .popup-back-btn {
        justify-self: start;
    }

    .notification-popup.mobile-detail-view #popupMobileDetailTitle {
        justify-self: center;
        text-align: center;
        margin: 0;
    }

    .notification-popup.mobile-detail-view .notification-popup-mobile-detail-header .notification-popup-close {
        position: static;
        transform: none;
        justify-self: end;
    }

    .notification-popup.mobile-detail-view .notification-popup-mobile-list {
        display: none;
    }

    .notification-popup.mobile-detail-view .notification-popup-content {
        display: block;
        flex: 1;
        overflow-y: auto;
    }

    .notification-popup.mobile-detail-view .popup-content-item.active {
        position: relative;
        top: 0;
        left: 0;
        right: auto;
    }

    .popup-back-btn {
        background: transparent;
        border: none;
        color: #fff;
        font-size: 28px;
        cursor: pointer;
        padding: 0;
        line-height: 1;
    }

    .popup-back-btn span {
        display: block;
    }

    #popupMobileDetailTitle {
        font-size: 14px;
    }

    .popup-banner .popup-banner-pc {
        display: none !important;
    }

    .popup-banner .popup-banner-mb {
        display: block !important;
    }

    .popup-text-content {
        font-size: 13px;
    }
}

/* Desktop: ẩn mobile-detail-header, banner PC hiển thị / banner MB ẩn, sidebar nền xám */
@media (min-width: 769px) {
    .notification-popup-mobile-list {
        width: 200px;
        flex-shrink: 0;
        background: #252525;
    }

    .notification-popup-mobile-list .popup-dong-btn {
        display: none;
    }

    .notification-popup-sidebar {
        background: #252525;
    }

    .popup-banner .popup-banner-pc {
        display: block !important;
    }

    .popup-banner .popup-banner-mb {
        display: none !important;
    }
}
