/* ===================================================================
 * Notification Bell Dropdown + Badge
 * Component: rep-notif-bell, rep-notif-dropdown
 * =================================================================== */

/* — Bell wrapper (relative anchor for dropdown) — */
.rep-notif-bell {
    position: relative;
}

/* — Badge — */
.rep-notif-bell__badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--rep-color-danger-base, #ef4444);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    pointer-events: none;
}

/* — Dropdown Panel — */
.rep-notif-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 380px;
    max-height: 480px;
    border-radius: var(--rep-radius-xl, 12px);
    border: 1px solid var(--rep-border-default, #1f2937);
    background: var(--rep-bg-surface, #111827);
    box-shadow: 0 12px 40px rgba(0, 0, 0, .4);
    overflow: hidden;
    z-index: 1000;
    flex-direction: column;
}

.rep-notif-dropdown[aria-hidden="false"] {
    display: flex;
}

/* — Dropdown Header — */
.rep-notif-dropdown__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--rep-border-default, #1f2937);
}

.rep-notif-dropdown__title {
    font-size: 15px;
    font-weight: 700;
    color: var(--rep-text-primary, #f9fafb);
    margin: 0;
}

.rep-notif-dropdown__mark-all {
    background: none;
    border: none;
    color: var(--rep-color-primary-base, #5c5cff);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}
.rep-notif-dropdown__mark-all:hover {
    text-decoration: underline;
}

/* — Dropdown List — */
.rep-notif-dropdown__list {
    flex: 1;
    overflow-y: auto;
    max-height: 360px;
}

/* — Notification Item — */
.rep-notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 20px;
    cursor: pointer;
    transition: background-color .15s;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--rep-border-default, #1f2937);
}
.rep-notif-item:last-child {
    border-bottom: none;
}
.rep-notif-item:hover {
    background: color-mix(in srgb, var(--rep-bg-surface, #111827) 80%, #fff);
}
.rep-notif-item--unread {
    background: color-mix(in srgb, var(--rep-color-primary-base, #5c5cff) 8%, transparent);
}

/* — Icon Circle — */
.rep-notif-item__icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rep-notif-item__icon .material-symbols-outlined {
    font-size: 18px;
}

/* Color variants */
.rep-notif-item__icon--primary {
    background: color-mix(in srgb, var(--rep-color-primary-base, #5c5cff) 20%, transparent);
    color: var(--rep-color-primary-base, #5c5cff);
}
.rep-notif-item__icon--success {
    background: color-mix(in srgb, var(--rep-color-success-base, #10b981) 20%, transparent);
    color: var(--rep-color-success-base, #10b981);
}
.rep-notif-item__icon--warning {
    background: color-mix(in srgb, var(--rep-color-warning-base, #f59e0b) 20%, transparent);
    color: var(--rep-color-warning-base, #f59e0b);
}
.rep-notif-item__icon--danger {
    background: color-mix(in srgb, var(--rep-color-danger-base, #ef4444) 20%, transparent);
    color: var(--rep-color-danger-base, #ef4444);
}
.rep-notif-item__icon--info {
    background: color-mix(in srgb, var(--rep-color-info-base, #3b82f6) 20%, transparent);
    color: var(--rep-color-info-base, #3b82f6);
}

/* — Item Content — */
.rep-notif-item__body {
    flex: 1;
    min-width: 0;
}
.rep-notif-item__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--rep-text-primary, #f9fafb);
    margin: 0 0 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.rep-notif-item__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--rep-color-primary-base, #5c5cff);
    flex-shrink: 0;
}
.rep-notif-item__message {
    font-size: 12px;
    color: var(--rep-text-secondary, #9ca3af);
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.rep-notif-item__time {
    font-size: 11px;
    color: var(--rep-text-muted, #6b7280);
    margin-top: 4px;
}

/* — Empty State — */
.rep-notif-dropdown__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--rep-text-secondary, #9ca3af);
}
.rep-notif-dropdown__empty .material-symbols-outlined {
    font-size: 36px;
    margin-bottom: 8px;
    opacity: .5;
}
.rep-notif-dropdown__empty p {
    font-size: 13px;
    margin: 0;
}

/* — Footer Link — */
.rep-notif-dropdown__footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 12px;
    border-top: 1px solid var(--rep-border-default, #1f2937);
    font-size: 13px;
    font-weight: 600;
    color: var(--rep-color-primary-base, #5c5cff);
    text-decoration: none;
    transition: background-color .15s;
}
.rep-notif-dropdown__footer:hover {
    background: color-mix(in srgb, var(--rep-color-primary-base, #5c5cff) 8%, transparent);
}
.rep-notif-dropdown__footer .material-symbols-outlined {
    font-size: 16px;
}

/* — Priority indicators in dropdown — */
.rep-notif-item--important {
    border-left: 3px solid var(--rep-color-warning-base, #f59e0b);
}
.rep-notif-item--critical {
    border-left: 3px solid var(--rep-color-danger-base, #ef4444);
    background: color-mix(in srgb, var(--rep-color-danger-base, #ef4444) 6%, transparent);
}

/* ===================================================================
 * Toast Notifications (priority: important)
 * Container: rep-toast-container
 * =================================================================== */
.rep-toast-container {
    position: fixed;
    top: 72px;
    right: 20px;
    z-index: 9000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    max-width: 400px;
}

.rep-toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--rep-radius-lg, 10px);
    background: var(--rep-bg-surface, #111827);
    border: 1px solid var(--rep-border-default, #1f2937);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
    pointer-events: auto;
    opacity: 0;
    transform: translateX(40px);
    transition: opacity .3s ease, transform .3s ease;
}
.rep-toast--visible {
    opacity: 1;
    transform: translateX(0);
}
.rep-toast--exit {
    opacity: 0;
    transform: translateX(40px);
}

/* Toast color accents */
.rep-toast--primary  { border-left: 3px solid var(--rep-color-primary-base, #5c5cff); }
.rep-toast--success  { border-left: 3px solid var(--rep-color-success-base, #10b981); }
.rep-toast--warning  { border-left: 3px solid var(--rep-color-warning-base, #f59e0b); }
.rep-toast--danger   { border-left: 3px solid var(--rep-color-danger-base, #ef4444); }
.rep-toast--info     { border-left: 3px solid var(--rep-color-info-base, #3b82f6); }

.rep-toast__icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--rep-color-primary-base, #5c5cff) 15%, transparent);
    color: var(--rep-color-primary-base, #5c5cff);
}
.rep-toast--warning .rep-toast__icon {
    background: color-mix(in srgb, var(--rep-color-warning-base, #f59e0b) 15%, transparent);
    color: var(--rep-color-warning-base, #f59e0b);
}
.rep-toast--danger .rep-toast__icon {
    background: color-mix(in srgb, var(--rep-color-danger-base, #ef4444) 15%, transparent);
    color: var(--rep-color-danger-base, #ef4444);
}
.rep-toast--success .rep-toast__icon {
    background: color-mix(in srgb, var(--rep-color-success-base, #10b981) 15%, transparent);
    color: var(--rep-color-success-base, #10b981);
}
.rep-toast--info .rep-toast__icon {
    background: color-mix(in srgb, var(--rep-color-info-base, #3b82f6) 15%, transparent);
    color: var(--rep-color-info-base, #3b82f6);
}

.rep-toast__icon .material-symbols-outlined { font-size: 18px; }

.rep-toast__body {
    flex: 1;
    min-width: 0;
}
.rep-toast__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--rep-text-primary, #f9fafb);
    margin: 0 0 2px;
}
.rep-toast__message {
    font-size: 12px;
    color: var(--rep-text-secondary, #9ca3af);
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.rep-toast__close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--rep-text-muted, #6b7280);
    cursor: pointer;
    padding: 2px;
    line-height: 1;
}
.rep-toast__close:hover {
    color: var(--rep-text-primary, #f9fafb);
}
.rep-toast__close .material-symbols-outlined { font-size: 18px; }

/* ===================================================================
 * Critical Alert Overlay (priority: critical)
 * =================================================================== */
.rep-critical-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .6);
    backdrop-filter: blur(4px);
}

.rep-critical-overlay__card {
    width: 420px;
    max-width: calc(100vw - 40px);
    padding: 32px;
    border-radius: var(--rep-radius-xl, 12px);
    background: var(--rep-bg-surface, #111827);
    border: 1px solid var(--rep-color-danger-base, #ef4444);
    box-shadow: 0 0 40px rgba(239, 68, 68, .2);
    text-align: center;
}

.rep-critical-overlay__icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--rep-color-danger-base, #ef4444) 15%, transparent);
    color: var(--rep-color-danger-base, #ef4444);
}
.rep-critical-overlay__icon .material-symbols-outlined {
    font-size: 28px;
}

.rep-critical-overlay__title {
    font-size: 18px;
    font-weight: 700;
    color: var(--rep-text-primary, #f9fafb);
    margin: 0 0 8px;
}

.rep-critical-overlay__message {
    font-size: 14px;
    color: var(--rep-text-secondary, #9ca3af);
    line-height: 1.5;
    margin: 0 0 24px;
}

.rep-critical-overlay__actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.rep-critical-overlay__btn {
    padding: 10px 20px;
    border-radius: var(--rep-radius-md, 8px);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: opacity .15s;
}
.rep-critical-overlay__btn:hover { opacity: .85; }

.rep-critical-overlay__btn--primary {
    background: var(--rep-color-danger-base, #ef4444);
    color: #fff;
}
.rep-critical-overlay__btn--dismiss {
    background: transparent;
    border: 1px solid var(--rep-border-default, #1f2937);
    color: var(--rep-text-secondary, #9ca3af);
}

/* ===================================================================
 * Contextual Inline Alerts (in-page notification banners)
 * Container: rep-ctx-alerts
 * =================================================================== */
.rep-ctx-alerts {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: var(--rep-space-6, 24px);
}

.rep-ctx-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--rep-radius-lg, 10px);
    border: 1px solid var(--rep-border-default, #1f2937);
    background: var(--rep-bg-surface, #111827);
    transition: opacity .3s ease;
}

/* Color variants — left border accent */
.rep-ctx-alert--primary  { border-left: 3px solid var(--rep-color-primary-base, #5c5cff); }
.rep-ctx-alert--success  { border-left: 3px solid var(--rep-color-success-base, #10b981); }
.rep-ctx-alert--warning  { border-left: 3px solid var(--rep-color-warning-base, #f59e0b); background: color-mix(in srgb, var(--rep-color-warning-base, #f59e0b) 5%, var(--rep-bg-surface, #111827)); }
.rep-ctx-alert--danger   { border-left: 3px solid var(--rep-color-danger-base, #ef4444); background: color-mix(in srgb, var(--rep-color-danger-base, #ef4444) 5%, var(--rep-bg-surface, #111827)); }
.rep-ctx-alert--info     { border-left: 3px solid var(--rep-color-info-base, #3b82f6); }

/* Critical pulse */
.rep-ctx-alert--critical {
    border-left-width: 4px;
    animation: rep-ctx-pulse 2s ease-in-out 2;
}
@keyframes rep-ctx-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .85; }
}

/* Icon */
.rep-ctx-alert__icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rep-ctx-alert__icon .material-symbols-outlined { font-size: 18px; }

.rep-ctx-alert--primary .rep-ctx-alert__icon  { background: color-mix(in srgb, var(--rep-color-primary-base, #5c5cff) 15%, transparent); color: var(--rep-color-primary-base, #5c5cff); }
.rep-ctx-alert--success .rep-ctx-alert__icon  { background: color-mix(in srgb, var(--rep-color-success-base, #10b981) 15%, transparent); color: var(--rep-color-success-base, #10b981); }
.rep-ctx-alert--warning .rep-ctx-alert__icon  { background: color-mix(in srgb, var(--rep-color-warning-base, #f59e0b) 15%, transparent); color: var(--rep-color-warning-base, #f59e0b); }
.rep-ctx-alert--danger .rep-ctx-alert__icon   { background: color-mix(in srgb, var(--rep-color-danger-base, #ef4444) 15%, transparent); color: var(--rep-color-danger-base, #ef4444); }
.rep-ctx-alert--info .rep-ctx-alert__icon     { background: color-mix(in srgb, var(--rep-color-info-base, #3b82f6) 15%, transparent); color: var(--rep-color-info-base, #3b82f6); }

/* Body */
.rep-ctx-alert__body {
    flex: 1;
    min-width: 0;
}
.rep-ctx-alert__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--rep-text-primary, #f9fafb);
    margin: 0 0 2px;
}
.rep-ctx-alert__message {
    font-size: 12px;
    color: var(--rep-text-secondary, #9ca3af);
    margin: 0;
    line-height: 1.4;
}

/* Action link */
.rep-ctx-alert__action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--rep-color-primary-base, #5c5cff);
    text-decoration: none;
    white-space: nowrap;
    align-self: center;
}
.rep-ctx-alert__action:hover { text-decoration: underline; }
.rep-ctx-alert__action .material-symbols-outlined { font-size: 16px; }

/* Dismiss */
.rep-ctx-alert__dismiss {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--rep-text-muted, #6b7280);
    cursor: pointer;
    padding: 2px;
    line-height: 1;
    align-self: center;
}
.rep-ctx-alert__dismiss:hover { color: var(--rep-text-primary, #f9fafb); }
.rep-ctx-alert__dismiss .material-symbols-outlined { font-size: 16px; }

/* — Responsive — */
@media (max-width: 480px) {
    .rep-notif-dropdown {
        width: calc(100vw - 32px);
        right: -8px;
    }
    .rep-toast-container {
        right: 12px;
        left: 12px;
        max-width: none;
    }
    .rep-ctx-alert {
        flex-wrap: wrap;
    }
    .rep-ctx-alert__action {
        width: 100%;
        padding-left: 44px;
    }
}
