/**
 * 1688buyer Unified Notification Center Styles
 * Standard parity with Shopee / Taobao / Lazada Notification UX
 */

/* Header Bell Button & Wrap */
.header-notification-wrap {
    position: relative;
    display: inline-flex;
    align-items: flex-start;
}

.notification-bell-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    color: var(--ink-secondary, #333333);
    font-family: inherit;
    font-size: 12px;
    line-height: 14px;
    text-decoration: none;
    transition: color 0.15s ease;
    outline: none;
    min-width: 44px;
}

.notification-bell-btn > span {
    font-size: 12px !important;
    line-height: 14px !important;
    height: 14px !important;
    color: inherit;
    display: block;
    white-space: nowrap;
    text-align: center;
}

.notification-bell-btn:hover,
.header-notification-wrap.open .notification-bell-btn {
    color: var(--primary-color, #ff5000);
}

.notification-bell-btn .bell-icon-svg {
    width: 24px;
    height: 24px;
    color: #666666;
    display: block;
    transition: color 0.15s ease, transform 0.2s ease;
}

.notification-bell-btn:hover .bell-icon-svg,
.header-notification-wrap.open .notification-bell-btn .bell-icon-svg {
    color: var(--primary-color, #ff5000);
}

.header-notification-wrap.has-new-alert .bell-icon-svg {
    animation: notif-bell-ring 1s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes notif-bell-ring {
    0%, 100% { transform: rotate(0); }
    15% { transform: rotate(14deg); }
    30% { transform: rotate(-12deg); }
    45% { transform: rotate(10deg); }
    60% { transform: rotate(-8deg); }
    75% { transform: rotate(4deg); }
}

/* Badge Counter - Harmonized with .cluster-cart-badge */
.cluster-notification-badge {
    position: absolute;
    top: -4px;
    right: -8px;
    background: var(--brand-orange, #ff5000);
    color: #ffffff;
    font-family: var(--font-accent, 'DM Sans', -apple-system, sans-serif);
    font-size: 11px;
    font-weight: 600;
    height: 16px;
    min-width: 16px;
    width: auto;
    padding: 0 4px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 1.5px solid #ffffff;
    box-shadow: 0 1px 3px rgba(255, 80, 0, 0.35);
    box-sizing: border-box;
    pointer-events: none;
    z-index: 10;
    white-space: nowrap;
    overflow: visible !important;
    text-overflow: clip !important;
}

/* Popover Dropdown */
.notification-dropdown-popover {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: -40px;
    width: 390px;
    background: #ffffff;
    border-radius: 6px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
    z-index: 1050;
    overflow: hidden;
    font-family: inherit;
}

.header-notification-wrap.open .notification-dropdown-popover {
    display: block;
    animation: notif-fade-in 0.18s ease-out;
}

@keyframes notif-fade-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Popover Header */
.notif-popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    background: #fafafa;
}

.notif-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #111827;
}

.notif-unread-pill {
    background: #ffefe6;
    color: #ff5000;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 12px;
}

.notif-mark-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: none;
    color: #6b7280;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.15s;
}

.notif-mark-all-btn:hover {
    color: #ff5000;
    background: rgba(255, 80, 0, 0.06);
}

/* Category Tabs */
.notif-tabs-bar {
    display: flex;
    background: #ffffff;
    border-bottom: 1px solid #f3f4f6;
    padding: 0 8px;
}

.notif-tab-item {
    flex: 1;
    background: transparent;
    border: none;
    padding: 10px 4px;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    text-align: center;
    position: relative;
    transition: color 0.15s;
    outline: none;
}

.notif-tab-item:hover {
    color: #111827;
}

.notif-tab-item.active {
    color: #ff5000;
    font-weight: 600;
}

.notif-tab-item.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 20%;
    right: 20%;
    height: 2px;
    background: #ff5000;
    border-radius: 2px 2px 0 0;
}

/* List Container */
.notif-list-container {
    max-height: 380px;
    min-height: 180px;
    overflow-y: auto;
    background: #ffffff;
}

.notif-list-container::-webkit-scrollbar {
    width: 5px;
}

.notif-list-container::-webkit-scrollbar-thumb {
    background: #e5e7eb;
    border-radius: 3px;
}

.notif-list-container::-webkit-scrollbar-thumb:hover {
    background: #d1d5db;
}

/* Notification Item */
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #f9fafb;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: background 0.12s;
    position: relative;
}

.notif-item:hover {
    background: #f9fafb;
}

.notif-item.unread {
    background: #fff9f5;
}

.notif-item.unread:hover {
    background: #fff3ec;
}

.notif-icon-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notif-icon-circle.cat-order {
    background: #fff2e8;
    color: #ff5000;
}

.notif-icon-circle.cat-finance,
.notif-icon-circle.cat-wallet {
    background: #f6ffed;
    color: #52c41a;
}

.notif-icon-circle.cat-logistics {
    background: #e6f7ff;
    color: #1890ff;
}

.notif-icon-circle.cat-chat {
    background: #f9f0ff;
    color: #722ed1;
}

.notif-icon-circle.cat-system {
    background: #f5f5f5;
    color: #595959;
}

.notif-content-wrap {
    flex: 1;
    min-width: 0;
}

.notif-item-title {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 3px;
    line-height: 1.35;
}

.notif-item.unread .notif-item-title {
    color: #111827;
    font-weight: 700;
}

.notif-item-summary {
    font-size: 12px;
    color: #4b5563;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

.notif-item-time {
    font-size: 11px;
    color: #9ca3af;
}

.notif-unread-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ff5000;
    flex-shrink: 0;
    margin-top: 6px;
}

/* Empty State */
.notif-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: #9ca3af;
}

.notif-empty-state svg {
    margin-bottom: 12px;
}

.notif-empty-state p {
    font-size: 13px;
    margin: 0;
}

/* Popover Footer */
.notif-popover-footer {
    padding: 10px 16px;
    border-top: 1px solid #f3f4f6;
    background: #fafafa;
    text-align: center;
}

.notif-view-all-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #ff5000;
    text-decoration: none;
    transition: opacity 0.15s;
}

.notif-view-all-link:hover {
    opacity: 0.85;
}

/* Full Page Inbox View */
.buyer-notif-page-wrap {
    max-width: 960px;
    margin: 20px auto;
    padding: 0 16px;
}

.buyer-notif-card {
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.buyer-notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #f3f4f6;
}

.buyer-notif-header h1 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: #111827;
}
