/* Container for each popup */
.popup-notification {
    position: fixed;
    right: 20px;
    bottom: var(--popup-bottom-offset, 20px);
    z-index: 9999;
    font-family: Arial, sans-serif;
    width: 420px; /* ensures expanded fits */
}

/* Bubble (collapsed state) */
.popup-bubble {
    background: var(--bg-primary);
    border: 1px solid white;
    border-radius: 50px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
    transition: all 0.3s ease;
    animation: float 3s ease-in-out infinite;
    z-index: 1; /* ensure bubble is below expanded */
}

.popup-bubble:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 123, 255, 0.4);
}

.popup-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.popup-text {
    color: white;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}

/* Expanded popup */
.popup-expanded {
    display: none;
    background: white;
    border: 1px solid white;
    border-radius: 12px;
    width: 420px; /* same width as container */
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    animation: slideIn 0.3s ease;
    position: fixed;      /* fix to viewport instead of relative */
    right: 20px;          /* same as popup container */
    bottom: 20px;         /* fixed bottom, ignore stacking offsets */
    z-index: 10000;       /* above everything */
}

.popup-header {
    background: var(--bg-primary);
    padding: 16px;
    position: relative;
    display: flex;
    justify-content: center;
}

.popup-logo {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
}

.popup-close {
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    position: absolute;
    top: 16px;
    right: 16px;
}

.popup-close:hover {
    background-color: rgba(0, 0, 0, 0.9);
}

.popup-content {
    padding: 20px;
    color: #333;
    line-height: 1.5;
    font-size: 14px;
    text-align: center;
    font-weight: bold;

    a {
        text-decoration: underline;
    }
}

/* Show/hide logic */
.popup-notification.expanded .popup-bubble {
    display: none;
}

.popup-notification.expanded .popup-expanded {
    display: block;
}

/* Floating animation */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-6px); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Responsive */
@media (max-width: 480px) {
    .popup-notification {
        bottom: 10px;
        right: 10px;
        left: 10px;
        width: auto;
    }

    .popup-expanded {
        width: calc(100% - 40px);
    }

    .popup-logo {
        max-width: 350px;
    }

    .popup-header {
        padding: 12px;
    }

    .popup-content {
        padding: 16px;
        font-size: 13px;
    }
}
