/* Site notification bell, dropdown, and popup */

.tw-notif-wrap {
    position: relative;
    border-left: 1px solid #e8ecf0;
}

.tw-notif-trigger {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 18px;
    min-width: 88px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #3d4f5f;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: color 0.2s ease, background 0.2s ease;
}

.tw-notif-trigger:hover,
.tw-notif-wrap.is-open .tw-notif-trigger {
    color: #1a6fb5;
    background: rgba(52, 152, 219, 0.06);
}

.tw-notif-icon-wrap {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fef3c7;
    color: #d97706;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
    font-size: 1rem;
}

.tw-notif-icon-wrap.has-unread {
    animation: tw-notif-pulse 2s ease-in-out infinite;
}

.tw-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;
    border: 2px solid #fff;
}

.tw-notif-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: min(360px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 1200;
    overflow: hidden;
}

.tw-notif-wrap.is-open .tw-notif-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.tw-notif-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid #eef2f7;
}

.tw-notif-panel-head strong {
    font-size: 0.95rem;
    color: #1f2937;
}

.tw-notif-mark-all {
    border: none;
    background: none;
    color: #2563eb;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

.tw-notif-list {
    max-height: 340px;
    overflow-x: hidden;
    overflow-y: auto;
}

.tw-notif-item {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    text-align: left;
    border: none;
    background: #fff;
    padding: 12px 14px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background 0.15s ease;
    overflow: hidden;
}

.tw-notif-item:hover {
    background: #f8fafc;
}

.tw-notif-item.is-unread {
    background: #f0f9ff;
}

.tw-notif-item.is-urgent {
    border-left: 3px solid #dc2626;
}

.tw-notif-item.is-general {
    border-left: 3px solid #2563eb;
}

.tw-notif-item-title {
    font-weight: 700;
    font-size: 0.88rem;
    color: #111827;
    margin-bottom: 4px;
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
}

.tw-notif-item-msg {
    font-size: 0.8rem;
    color: #4b5563;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
    max-width: 100%;
}

.tw-notif-item-meta {
    margin-top: 6px;
    font-size: 0.72rem;
    color: #9ca3af;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.tw-notif-type-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
}

.tw-notif-type-pill.urgent {
    background: #fee2e2;
    color: #991b1b;
}

.tw-notif-type-pill.general {
    background: #dbeafe;
    color: #1e40af;
}

.tw-notif-empty {
    padding: 28px 16px;
    text-align: center;
    color: #6b7280;
    font-size: 0.88rem;
}

/* Mobile bell */
.mobile-notif-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: linear-gradient(180deg, #e8f4fc 0%, #dceef9 100%);
    border: 1px solid #c5d9e8;
    border-radius: 10px;
    color: #d97706;
    font-size: 1.1rem;
    cursor: pointer;
}

.mobile-notif-icon .tw-notif-badge {
    top: 2px;
    right: 0;
}

/* Popup modal — Tech Warmup branded */
.tw-notif-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(44, 62, 80, 0.62);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, visibility 0.28s;
}

.tw-notif-popup-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.tw-notif-popup {
    width: min(680px, 100%);
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(44, 62, 80, 0.28);
    border: 1px solid #c5d9e8;
    transform: translateY(20px) scale(0.96);
    transition: transform 0.28s ease;
}

.tw-notif-popup-overlay.is-visible .tw-notif-popup {
    transform: translateY(0) scale(1);
}

.tw-notif-popup-top {
    position: relative;
    padding: 28px 28px 22px;
    background: linear-gradient(180deg, #e8f4fc 0%, #dceef9 100%);
    border-bottom: 1px solid #c5d9e8;
}

.tw-notif-popup-top.urgent {
    background: linear-gradient(180deg, #fff1f2 0%, #ffe4e6 100%);
    border-bottom-color: #fecaca;
}

.tw-notif-popup-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    color: #64748b;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
}

.tw-notif-popup-close:hover {
    background: #fff;
    color: #2c3e50;
}

.tw-notif-popup-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.tw-notif-popup-brand-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #c5d9e8;
    color: #2980b9;
    font-size: 1.15rem;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
}

.tw-notif-popup-top.urgent .tw-notif-popup-brand-icon {
    color: #dc2626;
    border-color: #fecaca;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.12);
}

.tw-notif-popup-brand-text {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

.tw-notif-popup-top h3 {
    margin: 0;
    font-size: clamp(1.25rem, 2.5vw, 1.55rem);
    line-height: 1.3;
    color: #2c3e50;
    font-weight: 700;
    padding-right: 36px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.tw-notif-popup-type {
    display: inline-block;
    margin-top: 10px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tw-notif-popup-type.general {
    background: #dbeafe;
    color: #1e40af;
}

.tw-notif-popup-type.urgent {
    background: #fee2e2;
    color: #991b1b;
}

.tw-notif-popup-body {
    padding: 26px 28px;
    color: #475569;
    font-size: 1rem;
    line-height: 1.75;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.tw-notif-popup-actions {
    padding: 0 28px 28px;
    display: flex;
    justify-content: center;
    gap: 12px;
}

.tw-notif-popup-btn {
    border: none;
    border-radius: 10px;
    padding: 13px 28px;
    min-width: 160px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tw-notif-popup-btn:active {
    transform: scale(0.98);
}

.tw-notif-popup-btn.primary {
    background: linear-gradient(180deg, #3498db 0%, #2980b9 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(52, 152, 219, 0.35);
}

.tw-notif-popup-btn.primary:hover {
    box-shadow: 0 6px 18px rgba(52, 152, 219, 0.45);
}

.tw-notif-popup-btn.primary.urgent {
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35);
}

.tw-notif-popup-btn.primary.urgent:hover {
    box-shadow: 0 6px 18px rgba(220, 38, 38, 0.45);
}

@media (min-width: 992px) {
    .tw-notif-popup {
        width: min(720px, 92vw);
    }

    .tw-notif-popup-top {
        padding: 32px 36px 26px;
    }

    .tw-notif-popup-body {
        padding: 32px 36px;
        font-size: 1.05rem;
    }

    .tw-notif-popup-actions {
        padding: 0 36px 36px;
    }
}

@media (max-width: 575.98px) {
    .tw-notif-popup-top,
    .tw-notif-popup-body,
    .tw-notif-popup-actions {
        padding-left: 20px;
        padding-right: 20px;
    }

    .tw-notif-popup-actions {
        padding-bottom: 22px;
    }

    .tw-notif-popup-btn {
        width: 100%;
    }
}

@keyframes tw-notif-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.35); }
    50% { box-shadow: 0 0 0 8px rgba(217, 119, 6, 0); }
}

@media (max-width: 991.98px) {
    .tw-notif-wrap.d-none.d-lg-block {
        display: none !important;
    }
}

/* Mobile notification sheet */
.mobile-notif-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1150;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s;
}

.mobile-notif-sheet-backdrop.is-active {
    opacity: 1;
    visibility: visible;
}

.mobile-notif-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 70vh;
    background: #fff;
    border-radius: 16px 16px 0 0;
    z-index: 1160;
    transform: translateY(100%);
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -8px 30px rgba(15, 23, 42, 0.15);
    overflow: hidden;
}

.mobile-notif-sheet.is-active {
    transform: translateY(0);
}

.mobile-notif-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #eef2f7;
    flex-shrink: 0;
}

.mobile-notif-sheet-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-notif-sheet-close {
    border: none;
    background: none;
    font-size: 1.5rem;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    padding: 0 4px;
}

.mobile-notif-sheet .tw-notif-list {
    flex: 1;
    overflow-x: hidden;
    overflow-y: auto;
    max-height: none;
}
