/* ═══════════════════════════════════════════════════════════════════════════
   PulseBook Notification Center — Styles
   Follows existing design system: purple primary (#7b35cc), Inter font,
   12px radius, 56px button height, Bootstrap 5 compatible.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Bell icon ────────────────────────────────────────────────────────── */
.pb-notif-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #5a6577;
    font-size: 1.25rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.pb-notif-bell:hover,
.pb-notif-bell:focus {
    background: rgba(123, 53, 204, 0.08);
    color: #7b35cc;
    outline: none;
}
.pb-notif-bell:focus-visible {
    box-shadow: 0 0 0 2px rgba(123, 53, 204, 0.3);
}

.pb-notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    pointer-events: none;
}

/* Pulse animation for critical */
@keyframes pb-bell-pulse {
    0%, 100% { transform: rotate(0deg); }
    10% { transform: rotate(14deg); }
    20% { transform: rotate(-14deg); }
    30% { transform: rotate(10deg); }
    40% { transform: rotate(-6deg); }
    50% { transform: rotate(0deg); }
}
.pb-notif-bell--pulse i {
    animation: pb-bell-pulse 2s ease-in-out infinite;
    color: #dc2626;
}

/* ── Dropdown panel ───────────────────────────────────────────────────── */
.pb-notif-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 400px;
    max-height: 520px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04);
    z-index: 1050;
    display: none;
    flex-direction: column;
    overflow: hidden;
}
.pb-notif-dropdown--open {
    display: flex;
}

.pb-notif-dropdown__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
}
.pb-notif-dropdown__title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
}
.pb-notif-dropdown__title i { color: #7b35cc; margin-right: 0.4rem; }
.pb-notif-dropdown__action {
    border: none;
    background: none;
    color: #7b35cc;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: background 0.15s;
}
.pb-notif-dropdown__action:hover { background: rgba(123, 53, 204, 0.08); }

.pb-notif-dropdown__list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
    max-height: 380px;
}

.pb-notif-dropdown__footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid #f1f5f9;
    text-align: center;
}
.pb-notif-dropdown__view-all {
    border: none;
    background: none;
    color: #7b35cc;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.15s;
}
.pb-notif-dropdown__view-all:hover { color: #6f2dbc; }
.pb-notif-dropdown__view-all i { margin-left: 0.3rem; }

/* Mobile responsive */
@media (max-width: 480px) {
    .pb-notif-dropdown {
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        max-height: 100%;
        border-radius: 0;
    }
}

/* ── Notification card ────────────────────────────────────────────────── */
.pb-notif-card {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    transition: background 0.15s;
    cursor: default;
    border-left: 3px solid transparent;
}
.pb-notif-card:hover { background: #f8fafc; }
.pb-notif-card--unread {
    background: #f0f4ff;
    border-left-color: #3b82f6;
}
.pb-notif-card--unread:hover { background: #e8eeff; }
.pb-notif-card--critical {
    border-left-color: #dc2626;
    background: #fef2f2;
}
.pb-notif-card--critical:hover { background: #fee2e2; }

.pb-notif-card__icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.pb-notif-card__content { flex: 1; min-width: 0; }
.pb-notif-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}
.pb-notif-card__title {
    font-size: 0.88rem;
    font-weight: 600;
    color: #1e293b;
    text-decoration: none;
    line-height: 1.35;
    word-break: break-word;
}
.pb-notif-card__title:hover { color: #7b35cc; }
.pb-notif-card__body {
    font-size: 0.82rem;
    color: #64748b;
    margin: 0.2rem 0 0;
    line-height: 1.45;
    word-break: break-word;
}
.pb-notif-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.4rem;
    gap: 0.5rem;
}
.pb-notif-card__time {
    font-size: 0.75rem;
    color: #94a3b8;
    white-space: nowrap;
}
.pb-notif-card__time i { margin-right: 0.2rem; }

/* Actions row */
.pb-notif-card__actions {
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.15s;
}
.pb-notif-card:hover .pb-notif-card__actions { opacity: 1; }

.pb-notif-action {
    border: none;
    background: none;
    color: #94a3b8;
    font-size: 0.78rem;
    padding: 0.25rem 0.4rem;
    border-radius: 6px;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
}
.pb-notif-action:hover { color: #7b35cc; background: rgba(123, 53, 204, 0.08); }
.pb-notif-action--danger:hover { color: #dc2626; background: rgba(220, 38, 38, 0.08); }

/* Priority badges */
.pb-notif-priority {
    flex-shrink: 0;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.pb-notif-priority--critical { background: #fee2e2; color: #dc2626; }
.pb-notif-priority--high { background: #fff7ed; color: #ea580c; }
.pb-notif-priority--normal { background: #f1f5f9; color: #64748b; }
.pb-notif-priority--low { background: #f1f5f9; color: #94a3b8; }

/* Priority dots for filter sidebar */
.pb-notif-priority-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.pb-notif-priority-dot--critical { background: #dc2626; }
.pb-notif-priority-dot--high { background: #ea580c; }
.pb-notif-priority-dot--normal { background: #3b82f6; }
.pb-notif-priority-dot--low { background: #94a3b8; }

/* ── Snooze menu ──────────────────────────────────────────────────────── */
.pb-notif-snooze-wrap { position: relative; display: inline-block; }
.pb-notif-snooze-menu {
    display: none;
    position: absolute;
    bottom: 100%;
    right: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: 0.25rem 0;
    z-index: 10;
    min-width: 140px;
}
.pb-notif-snooze-menu--open { display: block; }
.pb-notif-snooze-menu button {
    display: block;
    width: 100%;
    border: none;
    background: none;
    text-align: left;
    padding: 0.45rem 0.9rem;
    font-size: 0.82rem;
    color: #334155;
    cursor: pointer;
    transition: background 0.1s;
}
.pb-notif-snooze-menu button:hover { background: #f1f5f9; color: #7b35cc; }

/* ── Skeleton loading ─────────────────────────────────────────────────── */
.pb-notif-skeleton {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
}
.pb-notif-skeleton__icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: pb-shimmer 1.5s ease-in-out infinite;
}
.pb-notif-skeleton__lines { flex: 1; }
.pb-notif-skeleton__line {
    height: 10px;
    border-radius: 4px;
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: pb-shimmer 1.5s ease-in-out infinite;
    margin-bottom: 0.5rem;
}
.pb-notif-skeleton__line--short { width: 60%; }
@keyframes pb-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Empty state ──────────────────────────────────────────────────────── */
.pb-notif-empty {
    text-align: center;
    padding: 2.5rem 1rem;
}
.pb-notif-empty__icon {
    font-size: 2.5rem;
    color: #cbd5e1;
    margin-bottom: 0.75rem;
}
.pb-notif-empty__title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #475569;
    margin: 0 0 0.25rem;
}
.pb-notif-empty__sub {
    font-size: 0.82rem;
    color: #94a3b8;
    margin: 0;
}

/* ── Notification Center page ─────────────────────────────────────────── */
.pb-notif-center__header {
    margin-bottom: 1.5rem;
}
.pb-notif-center__title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}
.pb-notif-center__title i { color: #7b35cc; margin-right: 0.4rem; }

.pb-notif-center__body {
    display: flex;
    gap: 1.5rem;
}

.pb-notif-center__sidebar {
    flex: 0 0 220px;
    position: sticky;
    top: 1rem;
    align-self: flex-start;
}

.pb-notif-center__main { flex: 1; min-width: 0; }

.pb-notif-filter-group {
    margin-bottom: 1.25rem;
}
.pb-notif-filter-group__label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    margin: 0 0 0.4rem;
    padding: 0 0.6rem;
}

.pb-notif-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    border: none;
    background: none;
    padding: 0.5rem 0.6rem;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #475569;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, color 0.15s;
}
.pb-notif-filter:hover { background: #f1f5f9; color: #1e293b; }
.pb-notif-filter.active {
    background: rgba(123, 53, 204, 0.08);
    color: #7b35cc;
    font-weight: 600;
}
.pb-notif-filter__count {
    margin-left: auto;
    font-size: 0.72rem;
    font-weight: 700;
    background: #3b82f6;
    color: #fff;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    min-width: 18px;
    text-align: center;
}

/* Date group headers */
.pb-notif-group__label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    padding: 0.75rem 1.25rem 0.25rem;
    margin: 0;
}

/* Mobile: collapse sidebar */
@media (max-width: 767.98px) {
    .pb-notif-center__body { flex-direction: column; }
    .pb-notif-center__sidebar {
        flex: none;
        position: static;
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    .pb-notif-filter-group {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
        margin-bottom: 0.5rem;
    }
    .pb-notif-filter-group__label { width: 100%; }
    .pb-notif-filter { width: auto; }
}

/* ── Preferences table ────────────────────────────────────────────────── */
.pb-notif-prefs__body { margin-top: 1.5rem; }
.pb-notif-prefs__table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.pb-notif-prefs__table th {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    padding: 0.6rem 0.8rem;
    border-bottom: 2px solid #e2e8f0;
}
.pb-notif-prefs__table td {
    padding: 0.7rem 0.8rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.pb-notif-prefs__table tr:hover td { background: #f8fafc; }

/* Toggle switch */
.pb-toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}
.pb-toggle input { opacity: 0; width: 0; height: 0; }
.pb-toggle__slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #cbd5e1;
    border-radius: 999px;
    transition: background 0.2s;
}
.pb-toggle__slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    left: 3px;
    bottom: 3px;
    transition: transform 0.2s;
}
.pb-toggle input:checked + .pb-toggle__slider { background: #7b35cc; }
.pb-toggle input:checked + .pb-toggle__slider::before { transform: translateX(18px); }
.pb-toggle input:focus-visible + .pb-toggle__slider { box-shadow: 0 0 0 2px rgba(123, 53, 204, 0.3); }

/* ── Broadcast composer ───────────────────────────────────────────────── */
.pb-broadcast__card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 1.25rem;
}
.pb-broadcast__section-title {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #7b35cc;
    margin: 0 0 1rem;
}
.pb-broadcast__preview {
    border: 1px dashed #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem;
    background: #fafbfc;
}

.pb-bcast-recent-item {
    padding: 0.6rem 0;
    border-bottom: 1px solid #f1f5f9;
}
.pb-bcast-recent-item:last-child { border-bottom: none; }

.pb-bcast-status {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.pb-bcast-status--draft { background: #f1f5f9; color: #64748b; }
.pb-bcast-status--scheduled { background: #dbeafe; color: #2563eb; }
.pb-bcast-status--sending { background: #fef3c7; color: #d97706; }
.pb-bcast-status--sent { background: #d1fae5; color: #059669; }
.pb-bcast-status--failed { background: #fee2e2; color: #dc2626; }
.pb-bcast-status--cancelled { background: #f1f5f9; color: #94a3b8; }

/* ── Dark mode support ────────────────────────────────────────────────── */
.layout-dark .pb-notif-dropdown { background: #1e293b; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4); }
.layout-dark .pb-notif-dropdown__header { border-color: #334155; }
.layout-dark .pb-notif-dropdown__title { color: #f1f5f9; }
.layout-dark .pb-notif-dropdown__footer { border-color: #334155; }
.layout-dark .pb-notif-card:hover { background: #334155; }
.layout-dark .pb-notif-card--unread { background: #1e3a5f; border-left-color: #60a5fa; }
.layout-dark .pb-notif-card--unread:hover { background: #1e3a6f; }
.layout-dark .pb-notif-card__title { color: #f1f5f9; }
.layout-dark .pb-notif-card__body { color: #94a3b8; }
.layout-dark .pb-notif-card__time { color: #64748b; }
.layout-dark .pb-notif-filter.active { background: rgba(123, 53, 204, 0.15); }
.layout-dark .pb-notif-filter:hover { background: #334155; }
.layout-dark .pb-notif-prefs__table td { border-color: #334155; }
.layout-dark .pb-notif-prefs__table th { border-color: #475569; }
.layout-dark .pb-broadcast__card { background: #1e293b; border-color: #334155; }
.layout-dark .pb-notif-empty__title { color: #cbd5e1; }
.layout-dark .pb-notif-group__label { color: #64748b; }
.layout-dark .pb-notif-snooze-menu { background: #1e293b; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); }
.layout-dark .pb-notif-snooze-menu button { color: #cbd5e1; }
.layout-dark .pb-notif-snooze-menu button:hover { background: #334155; }
