﻿/* ➜ Đặt tại: wwwroot/css/home/notification-sheet.css — hộp thông báo + chuông (notification-sheet.js) */

/* ---------- Chuông trên header (desktop) ---------- */
.hp-nav .hp-header-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    opacity: .92;
    font-size: 19px;
    cursor: pointer;
    padding: 0;
    transition: color .15s, opacity .15s, background .15s;
}
    /* Cùng màu các mục menu (trắng), rê chuột → vàng như "Trang chủ", "Giới thiệu"… */
    .hp-nav .hp-header-bell:hover, .hp-nav .hp-header-bell[aria-expanded="true"] {
        color: var(--hp-accent, #ffd23f);
        opacity: 1;
        background: rgba(255, 255, 255, .12);
    }

    .hp-nav .hp-header-bell .hp-header-badge {
        position: absolute;
        top: 1px;
        right: -3px;
        min-width: 18px;
        height: 18px;
        padding: 0 5px;
        border-radius: 9px;
        border: 2px solid #0b3a6e;
        background: #e53935;
        color: #fff;
        font-size: 11px;
        font-weight: 700;
        line-height: 14px;
        text-align: center;
        box-sizing: border-box;
    }

        .hp-nav .hp-header-bell .hp-header-badge[hidden] {
            display: none;
        }

/* ---------- Bottom-nav điện thoại: 5 mục chia đều ---------- */
.hp-bottom-nav {
    display: flex;
}

    .hp-bottom-nav > .hp-bottom-nav-item {
        flex: 1 1 0;
        min-width: 0;
        position: relative;
    }

.hp-bottom-nav-item .hp-bottom-nav-badge[hidden] {
    display: none !important;
}

/* ---------- Hộp thông báo ---------- */
.hp-notif, .hp-notif * {
    box-sizing: border-box;
}

    .hp-notif[hidden] {
        display: none;
    }

.hp-notif {
    --n-green: #1f7a34;
    --n-green-soft: #eef6f0;
    --n-line: #efefef;
    position: fixed;
    inset: 0;
    z-index: 2000;
    font-size: 14px;
    color: #333;
}

.hp-notif-backdrop {
    position: absolute;
    inset: 0;
    background: transparent;
}

.hp-notif-panel {
    position: absolute;
    top: 72px;
    right: max(16px, calc((100vw - 1320px) / 2 + 16px));
    width: 400px;
    max-width: calc(100vw - 32px);
    max-height: min(70vh, 620px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .22);
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity .18s, transform .18s;
    overflow: hidden;
}

.hp-notif.is-open .hp-notif-panel {
    opacity: 1;
    transform: none;
}

.hp-notif-handle {
    display: none;
}

.hp-notif-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 12px 12px 16px;
    border-bottom: 1px solid var(--n-line);
}

    .hp-notif-head h2 {
        flex: 1;
        margin: 0;
        font-size: 16px;
        font-weight: 700;
        color: #222;
    }

.hp-notif-markall {
    border: 0;
    background: none;
    color: var(--n-green);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
}

    .hp-notif-markall:hover:not(:disabled) {
        background: var(--n-green-soft);
    }

    .hp-notif-markall:disabled {
        color: #bbb;
        cursor: default;
    }

.hp-notif-close {
    border: 0;
    background: none;
    font-size: 24px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    padding: 0 6px;
}

.hp-notif-enable {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: #fff8e6;
    font-size: 13px;
    color: #6b4e00;
}

    .hp-notif-enable[hidden] {
        display: none;
    }

    .hp-notif-enable span {
        flex: 1;
    }

    .hp-notif-enable button {
        border: 0;
        border-radius: 16px;
        padding: 5px 14px;
        background: var(--n-green);
        color: #fff;
        font-weight: 600;
        cursor: pointer;
    }

.hp-notif-list {
    overflow-y: auto;
    overscroll-behavior: contain;
}

.hp-notif-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    border: 0;
    border-bottom: 1px solid var(--n-line);
    background: #fff;
    cursor: pointer;
    font: inherit;
    color: inherit;
}

    .hp-notif-item:last-child {
        border-bottom: 0;
    }

    .hp-notif-item:hover {
        background: #fafafa;
    }

    .hp-notif-item.is-unread {
        background: var(--n-green-soft);
    }

        .hp-notif-item.is-unread:hover {
            background: #e4f1e7;
        }

.hp-notif-item-icon {
    flex: 0 0 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f1f1;
    color: #888;
}

.hp-notif-item.is-unread .hp-notif-item-icon {
    background: var(--n-green);
    color: #fff;
}

.hp-notif-item-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hp-notif-item-title {
    font-weight: 600;
    color: #222;
    overflow-wrap: anywhere;
}

.hp-notif-item.is-unread .hp-notif-item-title {
    font-weight: 700;
}

.hp-notif-item-text {
    color: #555;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.hp-notif-item-time {
    color: #999;
    font-size: 12px;
}

.hp-notif-dot {
    flex: 0 0 8px;
    width: 8px;
    height: 8px;
    margin-top: 6px;
    border-radius: 50%;
    background: #e53935;
}

.hp-notif-empty {
    padding: 40px 16px;
    text-align: center;
    color: #888;
}

    .hp-notif-empty .fa {
        font-size: 32px;
        color: #d9d9d9;
        margin-bottom: 8px;
    }

    .hp-notif-empty p {
        margin: 0 0 10px;
    }

.hp-notif-retry {
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 8px;
    padding: 6px 14px;
    cursor: pointer;
}

.hp-notif-spin {
    display: inline-block;
    width: 26px;
    height: 26px;
    margin-bottom: 8px;
    border-radius: 50%;
    border: 3px solid #e5e5e5;
    border-top-color: var(--n-green);
    animation: hp-notif-spin .8s linear infinite;
}

@keyframes hp-notif-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------- Điện thoại: bảng trượt từ dưới lên ---------- */
@media (max-width: 767.98px) {
    .hp-notif .hp-notif-backdrop {
        background: rgba(0, 0, 0, .45);
        opacity: 0;
        transition: opacity .2s;
    }

    .hp-notif.is-open .hp-notif-backdrop {
        opacity: 1;
    }

    .hp-notif .hp-notif-panel {
        top: auto;
        right: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        max-width: none;
        max-height: 82vh;
        border-radius: 16px 16px 0 0;
        opacity: 1;
        transform: translateY(100%);
        transition: transform .22s ease;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .hp-notif.is-open .hp-notif-panel {
        transform: none;
    }

    .hp-notif-handle {
        display: block;
        width: 40px;
        height: 4px;
        border-radius: 2px;
        background: #d6d6d6;
        margin: 8px auto 0;
    }

    .hp-notif-head {
        padding-top: 8px;
    }

    body.hp-notif-lock {
        overflow: hidden;
    }
}
