/* ============================================================
   FEASTFLOW — UNIVERSAL NOTIFICATIONS STYLESHEET
   Supports Bell Dropdowns, Audio Toggle, Templates Catalog,
   Live Device Frame Email Preview, and Tri-Theme Defenses:
   1. Editorial Light (Default)
   2. Midnight Emerald
   3. Midnight Violet
   ============================================================ */

/* ─── Notification Bell Component ───────────────────────────── */
.notification-bell-component {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.btn-notification-bell {
    color: inherit;
    opacity: 0.85;
    transition: opacity 0.2s ease, transform 0.2s ease;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    padding: 0 !important;
}

.btn-notification-bell:hover,
.btn-notification-bell:focus {
    opacity: 1;
    transform: scale(1.05);
    color: inherit;
}

.btn-notification-bell .bell-icon {
    font-size: 1.15rem;
}

.notification-dropdown-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding-right: 2px;
}

.notification-counter,
.btn-notification-bell .notification-counter {
    position: absolute;
    top: -2px !important;
    right: -2px !important;
    left: auto !important;
    transform: none !important;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.15em 0.4em;
    min-width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px var(--theme-bg-card, #111827);
    animation: notifPulse 2.5s infinite;
    line-height: 1;
}

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

.btn-notification-bell .bell-icon.bell-swing {
    display: inline-block;
    animation: bellSwing 1.3s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
    transform-origin: top center;
    color: var(--theme-primary, #10b981) !important;
}

@keyframes bellSwing {
    0%, 100% { transform: rotate(0); }
    15% { transform: rotate(22deg); }
    30% { transform: rotate(-20deg); }
    45% { transform: rotate(14deg); }
    60% { transform: rotate(-10deg); }
    75% { transform: rotate(6deg); }
    90% { transform: rotate(-2deg); }
}

.btn-sound-toggle {
    font-size: 0.95rem;
    line-height: 1;
    transition: color 0.2s ease, transform 0.15s ease;
}

.btn-sound-toggle:hover {
    transform: scale(1.1);
}

/* ─── Dropdown Menu ─────────────────────────────────────────── */
.notification-dropdown-menu {
    width: 380px;
    max-width: 92vw;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    padding: 0;
    overflow: hidden;
    margin-top: 8px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12);
    background-color: #ffffff;
    z-index: 1060;
}

/* Mobile Viewport Cut-off Defense */
@media (max-width: 767.98px) {
    .notification-dropdown-menu {
        position: fixed !important;
        top: 64px !important;
        left: 12px !important;
        right: 12px !important;
        width: auto !important;
        max-width: calc(100vw - 24px) !important;
        transform: none !important;
        margin: 0 !important;
        max-height: 82vh !important;
        overflow-y: auto !important;
        box-shadow: 0 14px 45px rgba(0, 0, 0, 0.4) !important;
        z-index: 1080 !important;
    }
}

.notification-dropdown-header {
    padding: 12px 16px;
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.notification-header-title {
    font-size: 0.95rem;
    color: #0f172a;
}

.notification-header-subtitle {
    font-size: 0.75rem;
    color: #64748b;
    display: block;
}

.btn-mark-all-read {
    font-size: 0.8rem;
    color: #3b82f6;
    font-weight: 600;
}

.btn-mark-all-read:hover {
    color: #1d4ed8;
    text-decoration: underline !important;
}

.btn-test-sound {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
    transition: color 0.15s ease;
}

.btn-test-sound:hover {
    color: var(--theme-primary, #10b981);
    text-decoration: underline !important;
}

.notification-items-list {
    max-height: 380px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.notification-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.15s ease;
    text-decoration: none !important;
    color: inherit;
    white-space: normal;
    display: block;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item:hover {
    background-color: #f8fafc;
}

.notification-item-unread {
    background-color: rgba(59, 130, 246, 0.05);
    border-left: 3px solid #3b82f6;
}

.notification-item-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.notification-item-title {
    font-size: 0.86rem;
    color: #1e293b;
    line-height: 1.3;
}

.notification-item-time {
    font-size: 0.72rem;
    white-space: nowrap;
}

.notification-item-desc {
    font-size: 0.78rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-unread-dot {
    width: 8px;
    height: 8px;
    min-width: 8px;
    border-radius: 50%;
    background-color: #3b82f6;
    margin-top: 6px;
}

.notification-empty-item {
    color: #94a3b8;
    padding: 30px 15px;
}

.notification-dropdown-footer {
    padding: 10px 16px;
    background-color: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

/* ─── Notification Templates Management UI ───────────────────── */
.notif-pill-tabs .nav-link {
    font-size: 0.84rem;
    border-radius: 50px;
    padding: 0.42rem 1.1rem;
    color: #475569;
    border: 1px solid #e2e8f0;
    background-color: #ffffff;
    margin-right: 0.35rem;
    margin-bottom: 0.35rem;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.notif-pill-tabs .nav-link:hover {
    background-color: #f1f5f9;
    color: #0f172a;
    border-color: #cbd5e1;
}

.notif-pill-tabs .nav-link.active {
    background-color: #00c896;
    color: #ffffff !important;
    border-color: #00c896;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(0, 200, 150, 0.28);
}

.notif-card {
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
    background-color: #ffffff;
}

.notif-shortcode-badge {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.78rem;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    background-color: #f1f5f9;
    color: #0f172a;
    border: 1px solid #cbd5e1;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-block;
    user-select: all;
    margin-right: 6px;
    margin-bottom: 6px;
}

.notif-shortcode-badge:hover {
    background-color: #e2e8f0;
    border-color: #94a3b8;
    color: #0284c7;
    transform: translateY(-1px);
}

.notif-shortcode-badge:active {
    transform: translateY(0);
}

.notif-channel-badge {
    font-size: 0.74rem;
    font-weight: 600;
    padding: 0.25rem 0.55rem;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.notif-channel-email {
    background-color: rgba(14, 165, 233, 0.12);
    color: #0284c7;
    border: 1px solid rgba(14, 165, 233, 0.25);
}

.notif-channel-sms {
    background-color: rgba(245, 158, 11, 0.12);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.notif-channel-whatsapp {
    background-color: rgba(34, 197, 94, 0.12);
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.notif-channel-inapp {
    background-color: rgba(168, 85, 247, 0.12);
    color: #9333ea;
    border: 1px solid rgba(168, 85, 247, 0.25);
}

.notif-code-editor {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    background-color: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 12px;
}

.notif-sticky-panel {
    position: sticky;
    top: 20px;
    z-index: 10;
}

.notif-table-truncate {
    max-width: 260px;
}

/* ─── Device Iframe Preview ─────────────────────────────────── */
.notif-device-preview-wrapper {
    background-color: #e2e8f0;
    border-radius: 14px;
    padding: 24px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 620px;
    overflow: auto;
}

.notif-device-frame {
    background-color: #ffffff;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.15);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 10px solid #1e293b;
    position: relative;
}

.notif-device-frame.device-desktop {
    width: 100%;
    max-width: 660px;
    height: 600px;
}

.notif-device-frame.device-tablet {
    width: 500px;
    height: 600px;
}

.notif-device-frame.device-mobile {
    width: 375px;
    height: 580px;
    border-radius: 36px;
    border-width: 12px;
}

.notif-preview-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    background-color: #ffffff;
}

.notif-preview-controls {
    display: inline-flex;
    background-color: #f1f5f9;
    padding: 4px;
    border-radius: 50px;
    border: 1px solid #cbd5e1;
}

.notif-preview-btn {
    border: none;
    background: transparent;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    transition: all 0.2s ease;
}

.notif-preview-btn.active {
    background-color: #ffffff;
    color: #0f172a;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* ============================================================
   THEME 1: MIDNIGHT EMERALD OVERRIDES
   ============================================================ */
[data-theme="midnight-emerald"] .notification-dropdown-menu,
body[data-theme="midnight-emerald"] .notification-dropdown-menu {
    background-color: #0d1526 !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="midnight-emerald"] .notification-dropdown-header,
[data-theme="midnight-emerald"] .notification-dropdown-footer,
body[data-theme="midnight-emerald"] .notification-dropdown-header,
body[data-theme="midnight-emerald"] .notification-dropdown-footer {
    background-color: #0a0f1e !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

[data-theme="midnight-emerald"] .notification-header-title,
body[data-theme="midnight-emerald"] .notification-header-title {
    color: #f8fafc !important;
}

[data-theme="midnight-emerald"] .notification-header-subtitle,
[data-theme="midnight-emerald"] .notification-item-time,
[data-theme="midnight-emerald"] .notification-item-desc,
body[data-theme="midnight-emerald"] .notification-header-subtitle,
body[data-theme="midnight-emerald"] .notification-item-time,
body[data-theme="midnight-emerald"] .notification-item-desc {
    color: #94a3b8 !important;
}

[data-theme="midnight-emerald"] .notification-item,
body[data-theme="midnight-emerald"] .notification-item {
    border-bottom-color: rgba(255, 255, 255, 0.06) !important;
    color: #f8fafc !important;
}

[data-theme="midnight-emerald"] .notification-item:hover,
body[data-theme="midnight-emerald"] .notification-item:hover {
    background-color: rgba(0, 200, 150, 0.08) !important;
}

[data-theme="midnight-emerald"] .notification-item-unread,
body[data-theme="midnight-emerald"] .notification-item-unread {
    background-color: rgba(0, 200, 150, 0.12) !important;
    border-left-color: #00c896 !important;
}

[data-theme="midnight-emerald"] .notification-item-title,
body[data-theme="midnight-emerald"] .notification-item-title {
    color: #ffffff !important;
}

[data-theme="midnight-emerald"] .notification-unread-dot,
body[data-theme="midnight-emerald"] .notification-unread-dot {
    background-color: #00c896 !important;
    box-shadow: 0 0 8px rgba(0, 200, 150, 0.6);
}

[data-theme="midnight-emerald"] .notif-card,
body[data-theme="midnight-emerald"] .notif-card {
    background-color: #111827 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="midnight-emerald"] .notif-pill-tabs .nav-link,
body[data-theme="midnight-emerald"] .notif-pill-tabs .nav-link {
    background-color: #0d1526 !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #cbd5e1 !important;
}

[data-theme="midnight-emerald"] .notif-pill-tabs .nav-link.active,
body[data-theme="midnight-emerald"] .notif-pill-tabs .nav-link.active {
    background-color: #00c896 !important;
    color: #0a0f1e !important;
    font-weight: 700;
}

[data-theme="midnight-emerald"] .notif-shortcode-badge,
body[data-theme="midnight-emerald"] .notif-shortcode-badge {
    background-color: #0d1526 !important;
    border-color: rgba(0, 200, 150, 0.3) !important;
    color: #00c896 !important;
}

[data-theme="midnight-emerald"] .notif-code-editor,
body[data-theme="midnight-emerald"] .notif-code-editor {
    background-color: #0a0f1e !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #f8fafc !important;
}

/* ============================================================
   THEME 2: MIDNIGHT VIOLET OVERRIDES
   ============================================================ */
[data-theme="midnight-violet"] .notification-dropdown-menu,
body[data-theme="midnight-violet"] .notification-dropdown-menu {
    background-color: #160d30 !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6) !important;
}

[data-theme="midnight-violet"] .notification-dropdown-header,
[data-theme="midnight-violet"] .notification-dropdown-footer,
body[data-theme="midnight-violet"] .notification-dropdown-header,
body[data-theme="midnight-violet"] .notification-dropdown-footer {
    background-color: #0d0820 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

[data-theme="midnight-violet"] .notification-header-title,
body[data-theme="midnight-violet"] .notification-header-title {
    color: #f8fafc !important;
}

[data-theme="midnight-violet"] .notification-header-subtitle,
[data-theme="midnight-violet"] .notification-item-time,
[data-theme="midnight-violet"] .notification-item-desc,
body[data-theme="midnight-violet"] .notification-header-subtitle,
body[data-theme="midnight-violet"] .notification-item-time,
body[data-theme="midnight-violet"] .notification-item-desc {
    color: #9ca3af !important;
}

[data-theme="midnight-violet"] .notification-item,
body[data-theme="midnight-violet"] .notification-item {
    border-bottom-color: rgba(255, 255, 255, 0.06) !important;
    color: #f8fafc !important;
}

[data-theme="midnight-violet"] .notification-item:hover,
body[data-theme="midnight-violet"] .notification-item:hover {
    background-color: rgba(245, 200, 66, 0.08) !important;
}

[data-theme="midnight-violet"] .notification-item-unread,
body[data-theme="midnight-violet"] .notification-item-unread {
    background-color: rgba(245, 200, 66, 0.12) !important;
    border-left-color: #f5c842 !important;
}

[data-theme="midnight-violet"] .notification-item-title,
body[data-theme="midnight-violet"] .notification-item-title {
    color: #ffffff !important;
}

[data-theme="midnight-violet"] .notification-unread-dot,
body[data-theme="midnight-violet"] .notification-unread-dot {
    background-color: #f5c842 !important;
    box-shadow: 0 0 8px rgba(245, 200, 66, 0.6);
}

[data-theme="midnight-violet"] .notif-card,
body[data-theme="midnight-violet"] .notif-card {
    background-color: #160d30 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="midnight-violet"] .notif-pill-tabs .nav-link,
body[data-theme="midnight-violet"] .notif-pill-tabs .nav-link {
    background-color: #110b28 !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #e2e8f0 !important;
}

[data-theme="midnight-violet"] .notif-pill-tabs .nav-link.active,
body[data-theme="midnight-violet"] .notif-pill-tabs .nav-link.active {
    background-color: #f5c842 !important;
    color: #0d0820 !important;
    font-weight: 700;
}

[data-theme="midnight-violet"] .notif-shortcode-badge,
body[data-theme="midnight-violet"] .notif-shortcode-badge {
    background-color: #110b28 !important;
    border-color: rgba(245, 200, 66, 0.3) !important;
    color: #f5c842 !important;
}

[data-theme="midnight-violet"] .notif-code-editor,
body[data-theme="midnight-violet"] .notif-code-editor {
    background-color: #0d0820 !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #f8fafc !important;
}

/* ============================================================
   THEME 3: EDITORIAL LIGHT OVERRIDES
   ============================================================ */
[data-theme="editorial-light"] .notification-dropdown-menu,
body[data-theme="editorial-light"] .notification-dropdown-menu {
    background-color: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08) !important;
}

[data-theme="editorial-light"] .notification-item:hover,
body[data-theme="editorial-light"] .notification-item:hover {
    background-color: #f8fafc !important;
}

[data-theme="editorial-light"] .notification-item-unread,
body[data-theme="editorial-light"] .notification-item-unread {
    background-color: rgba(232, 57, 77, 0.05) !important;
    border-left-color: #e8394d !important;
}

[data-theme="editorial-light"] .notification-unread-dot,
body[data-theme="editorial-light"] .notification-unread-dot {
    background-color: #e8394d !important;
}

[data-theme="editorial-light"] .notif-pill-tabs .nav-link.active,
body[data-theme="editorial-light"] .notif-pill-tabs .nav-link.active {
    background-color: #e8394d !important;
    border-color: #e8394d !important;
    color: #ffffff !important;
}

[data-theme="editorial-light"] .notif-shortcode-badge,
body[data-theme="editorial-light"] .notif-shortcode-badge {
    background-color: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #e8394d !important;
}

.notifications-page-container {
    min-height: 65vh;
}
.notif-filter-group {
    background: rgba(255, 255, 255, 0.05);
}
.notif-item-transparent {
    background: transparent !important;
}
.notif-icon-box-40 {
    width: 40px;
    height: 40px;
}

/* ─── Platform Master Status Banner ────────────────────────── */
.notif-master-banner {
    border-radius: 12px;
    transition: all 0.3s ease;
}
.notif-master-banner-active {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(16, 185, 129, 0.02) 100%);
    border: 1px solid rgba(16, 185, 129, 0.25) !important;
}
.notif-master-banner-inactive {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(239, 68, 68, 0.02) 100%);
    border: 1px solid rgba(239, 68, 68, 0.25) !important;
}
.notif-master-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ─── WhatsApp & SMS API Settings & Diagnostics ──────────────── */
.api-guide-card {
    border-radius: 14px;
    border: 1px solid rgba(0, 200, 150, 0.25);
    background: linear-gradient(135deg, rgba(0, 200, 150, 0.04) 0%, rgba(59, 130, 246, 0.03) 100%);
}

.api-guide-step {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.api-step-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--bs-primary, #00c896);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.api-preset-btn {
    font-size: 0.78rem;
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    margin-right: 0.35rem;
    margin-bottom: 0.35rem;
    transition: all 0.15s ease;
}

.api-eye-btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.gateway-config-card {
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #ffffff;
}

.gateway-config-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
}

.gateway-header-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.gateway-icon-whatsapp {
    background-color: rgba(37, 211, 102, 0.12);
    color: #25d366;
}

.gateway-icon-twilio {
    background-color: rgba(242, 47, 70, 0.12);
    color: #f22f46;
}

/* Dark Theme Defenses */
[data-theme="midnight-emerald"] .gateway-config-card,
[data-theme="midnight-violet"] .gateway-config-card {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="midnight-emerald"] .gateway-config-card:hover,
[data-theme="midnight-violet"] .gateway-config-card:hover {
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

[data-theme="midnight-emerald"] .api-guide-card {
    background: linear-gradient(135deg, rgba(0, 200, 150, 0.08) 0%, rgba(15, 23, 42, 0.3) 100%);
    border-color: rgba(0, 200, 150, 0.25);
}

[data-theme="midnight-violet"] .api-guide-card {
    background: linear-gradient(135deg, rgba(245, 200, 66, 0.08) 0%, rgba(20, 15, 45, 0.3) 100%);
    border-color: rgba(245, 200, 66, 0.25);
}


