﻿/* ERS Notification - Modern Toast-Style Design */
/* Toast notification positioned in top-right */
.ers-notification-banner {
    position: fixed;
    top: 80px;
    right: 20px;
    left: auto;
    width: 380px;
    z-index: 10000;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.05);
    opacity: 0;
    transform: translateX(120%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

    .ers-notification-banner.ers-banner-visible {
        opacity: 1;
        transform: translateX(0);
    }

    /* Colored accent bar on left side */
    .ers-notification-banner::before {
        content: "";
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 5px;
        background: linear-gradient(180deg, #c9302c 0%, #e74c3c 100%);
        border-radius: 12px 0 0 12px;
    }

.ers-banner-content {
    display: flex;
    align-items: center; /* vertically center icon + text */
    justify-content: flex-start; /* ensure left alignment */
    padding: 12px 16px;
    gap: 12px;
    position: relative;
}

    /* Bell icon container implemented in ::before so the message flows naturally to the left */
    .ers-banner-content::before {
        content: "🔔";
        flex-shrink: 0;
        width: 44px;
        height: 44px;
        background: linear-gradient(135deg, #fff5f5 0%, #fee2e2 100%);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 20px;
        line-height: 1;
        transform-origin: 50% 10%; /* pivot near top for natural swing */
        animation: bellSwing 2s ease-in-out infinite; /* enable ringing */
    }

/* Notification badge pulse (kept on banner root) */
.ers-notification-banner::after {
    content: "";
    position: absolute;
    left: 38px; /* ✅ Adjusted to align with bell icon center */
    top: 20px; /* ✅ Adjusted to align with bell icon top */
    width: 12px;
    height: 12px;
    background: #c9302c;
    border-radius: 50%;
    border: 2px solid #ffffff;
    animation: badgePulse 2s ease-in-out infinite;
    z-index: 10; /* ✅ Ensure badge stays on top */
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

@keyframes bellSwing {
    0% {
        transform: rotate(0deg);
    }

    12% {
        transform: rotate(12deg);
    }

    24% {
        transform: rotate(-8deg);
    }

    36% {
        transform: rotate(6deg);
    }

    48% {
        transform: rotate(-4deg);
    }

    60% {
        transform: rotate(2deg);
    }

    72% {
        transform: rotate(-1deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

#ers-banner-message {
    flex: 1;
    padding-top: 2px;
    padding-left: 0; /* remove large left padding so text starts near icon */
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    text-align: left; /* align message content to the left */
}

    /* Title styling */
    #ers-banner-message::before {
        content: "ERS Score Available";
        display: block;
        font-size: 14px;
        font-weight: 600;
        color: #1a202c;
        margin-bottom: 4px;
        letter-spacing: -0.2px;
        text-align: left;
    }

/* Message body */
#ers-banner-message {
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
}

/* Quote ID highlight */
.ers-quote-id {
    display: inline-block;
    background: linear-gradient(135deg, #1a5276 0%, #2874a6 100%);
    color: #ffffff;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
}

/* Close button - Modern X design */
.ers-banner-close {
    position: absolute;
    right: 12px;
    top: 12px;
    width: 28px;
    height: 28px;
    background: #f1f5f9;
    border: none;
    border-radius: 8px;
    color: #64748b;
    font-size: 18px;
    font-weight: 300;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

    .ers-banner-close:hover {
        background: #e2e8f0;
        color: #1e293b;
        transform: scale(1.05);
    }

    .ers-banner-close:active {
        transform: scale(0.95);
    }

    .ers-banner-close:focus {
        outline: none;
        box-shadow: 0 0 0 3px rgba(26, 82, 118, 0.2);
    }

/* Entry animation with bounce */
.ers-notification-banner.ers-banner-new {
    animation: slideInBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes slideInBounce {
    0% {
        transform: translateX(120%);
        opacity: 0;
    }

    60% {
        transform: translateX(-10px);
        opacity: 1;
    }

    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Action button (optional - for "View Details") */
.ers-banner-action {
    display: inline-block;
    margin-top: 10px;
    padding: 6px 14px;
    background: linear-gradient(135deg, #1a5276 0%, #2874a6 100%);
    color: #ffffff;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .ers-banner-action:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(26, 82, 118, 0.3);
    }

/* Multiple notifications stacking */
.ers-notification-banner:nth-of-type(2) {
    top: 180px;
}

.ers-notification-banner:nth-of-type(3) {
    top: 280px;
}

/* Responsive */
@media (max-width: 480px) {
    .ers-notification-banner {
        right: 10px;
        left: 10px;
        width: auto;
    }
}
/* NEW: Footer section for "Don't alert me again" link */
.ers-banner-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 8px 16px 12px 16px;
    border-top: 1px solid #f1f5f9;
    background: #fafbfc;
    border-radius: 0 0 12px 12px;
}

/* NEW: "Don't alert me again" link styling */
.ers-dont-alert-link {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
}

    .ers-dont-alert-link:hover {
        color: #1e293b;
        background: #e2e8f0;
        text-decoration: none;
    }

    .ers-dont-alert-link:active {
        transform: scale(0.96);
    }

    .ers-dont-alert-link:focus {
        outline: none;
        box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.2);
    }

/* Theme variations */
.ers-notification-banner.ers-banner-success::before {
    background: linear-gradient(180deg, #27ae60 0%, #2ecc71 100%);
}

.ers-notification-banner.ers-banner-success::after {
    background: #27ae60;
}

.ers-notification-banner.ers-banner-warning::before {
    background: linear-gradient(180deg, #f39c12 0%, #f1c40f 100%);
}

.ers-notification-banner.ers-banner-warning::after {
    background: #f39c12;
}

.ers-notification-banner.ers-banner-info::before {
    background: linear-gradient(180deg, #1a5276 0%, #2874a6 100%);
}

.ers-notification-banner.ers-banner-info::after {
    background: #1a5276;
}
