@import '../../theme/font.css';

.header-notif-btn {
    position: relative;
}

.cart-badge.notif-badge {
    position: absolute;
    top: -4px;
    left: -4px;
    background: #ef4444;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    border: 1.5px solid var(--color-white, #ffffff);
    animation: notifPulse 2s infinite;
}

@keyframes notifPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.12);
    }

    100% {
        transform: scale(1);
    }
}

/* ─── Slide-Over Drawer & Backdrop ─── */
.customer-notif-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99998;
    background: rgba(15, 12, 29, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s;
}

.customer-notif-backdrop.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.customer-notif-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 460px;
    z-index: 99999;
    background: var(--bg-card, #ffffff);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border-left: 1px solid var(--border-color, rgba(138, 21, 81, 0.1));
}

[data-theme="dark"] .customer-notif-drawer {
    background: #181216;
    border-color: rgba(212, 175, 55, 0.15);
}

.customer-notif-drawer.show {
    transform: translateX(0);
}

/* ─── Drawer Header ─── */
.notif-drawer-header {
    padding: 22px 20px 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--border-color, rgba(138, 21, 81, 0.08));
    background: var(--bg-card, #ffffff);
}

[data-theme="dark"] .notif-drawer-header {
    background: #1e151a;
    border-color: rgba(255, 255, 255, 0.07);
}

.notif-header-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.notif-header-icon-box {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(138, 21, 81, 0.1) 0%, rgba(212, 175, 55, 0.15) 100%);
    color: var(--color-primary, #8a1551);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

[data-theme="dark"] .notif-header-icon-box {
    color: var(--color-gold, #d4af37);
    background: rgba(212, 175, 55, 0.15);
}

.notif-header-icon-box svg {
    width: 22px;
    height: 22px;
}

.notif-drawer-title {
    font-size: 16.5px;
    font-weight: 800;
    color: var(--color-charcoal, #1a1a1a);
    margin: 0;
}

[data-theme="dark"] .notif-drawer-title {
    color: #f3f4f6;
}

.notif-drawer-sub {
    font-size: 11.5px;
    color: #6b7280;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

[data-theme="dark"] .notif-drawer-sub {
    color: #9ca3af;
}

.notif-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.btn-mark-all-read {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(212, 175, 55, 0.12);
    color: #92400e;
    border: none;
    padding: 6px 10px;
    border-radius: 10px;
    font-size: 11.5px;
    font-weight: 750;
    cursor: pointer;
    transition: all 0.2s ease;
}

[data-theme="dark"] .btn-mark-all-read {
    background: rgba(212, 175, 55, 0.2);
    color: #fef08a;
}

.btn-mark-all-read:hover {
    background: var(--color-gold, #d4af37);
    color: #ffffff;
}

.btn-mark-all-read svg {
    width: 14px;
    height: 14px;
}

.notif-drawer-close-btn {
    background: transparent;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.2s ease;
}

.notif-drawer-close-btn:hover {
    background: rgba(138, 21, 81, 0.08);
    color: var(--color-primary, #8a1551);
}

.notif-drawer-close-btn svg {
    width: 18px;
    height: 18px;
}

/* ─── Filter Tabs (Scrollable) ─── */
.notif-tabs-scroll-wrap {
    padding: 12px 16px;
    background: var(--bg-main, #fbf7f9);
    border-bottom: 1px solid var(--border-color, rgba(138, 21, 81, 0.06));
    overflow-x: auto;
    scrollbar-width: none;
}

[data-theme="dark"] .notif-tabs-scroll-wrap {
    background: #130e12;
    border-color: rgba(255, 255, 255, 0.05);
}

.notif-tabs-scroll-wrap::-webkit-scrollbar {
    display: none;
}

.notif-filter-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    width: max-content;
}

.notif-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-color, #e5e7eb);
    padding: 7px 14px;
    border-radius: 24px;
    font-size: 12.5px;
    font-weight: 700;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
}

[data-theme="dark"] .notif-tab-btn {
    background: #1e151a;
    border-color: rgba(255, 255, 255, 0.1);
    color: #d1d5db;
}

.notif-tab-btn svg {
    width: 14px;
    height: 14px;
    color: #9ca3af;
}

.notif-tab-btn:hover {
    border-color: var(--color-gold, #d4af37);
    color: var(--color-primary, #8a1551);
}

.notif-tab-btn.active {
    background: linear-gradient(135deg, var(--color-primary, #8a1551) 0%, #630c39 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(138, 21, 81, 0.25);
}

.notif-tab-btn.active svg {
    color: #ffffff;
}

.tab-unread-pill {
    background: #ef4444;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.notif-tab-btn.active .tab-unread-pill {
    background: var(--color-gold, #d4af37);
    color: #1a1a1a;
}

/* ─── Drawer Body & Notification Cards Feed ─── */
.notif-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    -webkit-overflow-scrolling: touch;
}

.notification-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-color, rgba(138, 21, 81, 0.08));
    cursor: pointer;
    position: relative;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    -webkit-tap-highlight-color: transparent;
}

[data-theme="dark"] .notification-card {
    background: #1e151a;
    border-color: rgba(255, 255, 255, 0.07);
}

.notification-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
    border-color: rgba(212, 175, 55, 0.35);
}

.notification-card:active {
    transform: scale(0.985);
}

.notification-card.unread {
    background: linear-gradient(135deg, rgba(138, 21, 81, 0.035) 0%, rgba(212, 175, 55, 0.05) 100%);
    border-color: rgba(212, 175, 55, 0.35);
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.08);
}

[data-theme="dark"] .notification-card.unread {
    background: linear-gradient(135deg, rgba(138, 21, 81, 0.2) 0%, rgba(212, 175, 55, 0.12) 100%);
    border-color: rgba(212, 175, 55, 0.4);
}

.unread-indicator {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-gold, #d4af37);
    box-shadow: 0 0 8px var(--color-gold, #d4af37);
    animation: notifPulse 2s infinite;
}

/* Category Icon Box */
.notif-icon-box {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.notif-icon-box svg {
    width: 19px;
    height: 19px;
}

.notif-type-order {
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.notif-type-offer {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.notif-type-system {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.notif-type-all {
    background: rgba(138, 21, 81, 0.1);
    color: var(--color-primary, #8a1551);
    border: 1px solid rgba(138, 21, 81, 0.18);
}

/* Card Content */
.notif-content {
    flex: 1;
    min-width: 0;
}

.notif-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
    padding-left: 10px;
}

.notif-title {
    font-size: 13.5px;
    font-weight: 800;
    color: var(--color-charcoal, #1a1a1a);
    margin: 0;
    line-height: 1.4;
    word-break: break-word;
}

[data-theme="dark"] .notif-title {
    color: #f3f4f6;
}

.notif-time {
    font-size: 11px;
    color: #9ca3af;
    white-space: nowrap;
    font-weight: 600;
    flex-shrink: 0;
}

.notif-body {
    font-size: 12.5px;
    color: #4b5563;
    line-height: 1.5;
    margin: 0 0 6px 0;
    word-break: break-word;
}

[data-theme="dark"] .notif-body {
    color: #9ca3af;
}

.notif-order-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(212, 175, 55, 0.1);
    color: var(--color-gold, #d4af37);
    border: 1px solid rgba(212, 175, 55, 0.25);
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 800;
}

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

.notif-empty-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.1);
    color: var(--color-gold, #d4af37);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    border: 1px solid rgba(212, 175, 55, 0.25);
}

.notif-empty-icon svg {
    width: 28px;
    height: 28px;
}

.notif-empty-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--color-charcoal, #1a1a1a);
    margin-bottom: 6px;
}

[data-theme="dark"] .notif-empty-title {
    color: #f3f4f6;
}

.notif-empty-desc {
    font-size: 12.5px;
    color: #6b7280;
    max-width: 280px;
    line-height: 1.5;
}

/* ─── Mobile Responsiveness (Flawless UX on all phones) ─── */
@media (max-width: 580px) {
    .customer-notif-drawer {
        max-width: 100vw;
        border-left: none;
    }

    .notif-drawer-header {
        padding: 16px 14px 12px 14px;
        gap: 8px;
    }

    .notif-header-icon-box {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .notif-header-icon-box svg {
        width: 19px;
        height: 19px;
    }

    .notif-drawer-title {
        font-size: 15px;
    }

    .notif-drawer-sub {
        font-size: 10.5px;
    }

    .btn-mark-all-read {
        padding: 5px 8px;
        font-size: 10.5px;
        border-radius: 8px;
    }

    .notif-tabs-scroll-wrap {
        padding: 10px 12px;
    }

    .notif-tab-btn {
        padding: 6px 12px;
        font-size: 11.5px;
        gap: 5px;
    }

    .notif-drawer-body {
        padding: 12px 10px;
        gap: 8px;
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 12px));
    }

    .notification-card {
        padding: 12px;
        gap: 10px;
        border-radius: 14px;
    }

    .notif-icon-box {
        width: 34px;
        height: 34px;
        border-radius: 10px;
    }

    .notif-icon-box svg {
        width: 16px;
        height: 16px;
    }

    .notif-title {
        font-size: 12.5px;
    }

    .notif-time {
        font-size: 10px;
    }

    .notif-body {
        font-size: 11.5px;
        line-height: 1.45;
    }
}