/* ============================================================
   WhatsApp Channel Join Popup
   Scoped under #jobNotificationPopup so it cannot affect the rest
   of the site. Reuses Bootstrap design tokens & the site's theme.
   ============================================================ */

#jobNotificationPopup {
    --job-popup-z: 2000;
    --wa-green: #25d366;
    --wa-green-dark: #1da851;
    position: fixed;
    inset: 0;
    z-index: var(--job-popup-z);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

#jobNotificationPopup.is-open {
    opacity: 1;
    visibility: visible;
}

#jobNotificationPopup .job-popup {
    position: relative;
    width: 100%;
    max-width: 430px;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    background: #ffffff;
    border-radius: 1.25rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    padding: 2rem 1.5rem 1.5rem;
    text-align: center;
    transform: translateY(12px) scale(0.98);
    transition: transform 0.25s ease;
}

#jobNotificationPopup.is-open .job-popup {
    transform: none;
}

/* Close button */
#jobNotificationPopup .job-popup-close {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    width: 2.25rem;
    height: 2.25rem;
    border: 0;
    border-radius: 50%;
    background: #f1f3f5;
    color: #495057;
    font-size: 1.35rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1;
    transition: background-color 0.15s ease, color 0.15s ease;
}

#jobNotificationPopup .job-popup-close:hover {
    background: #e9ecef;
    color: #212529;
}

#jobNotificationPopup .job-popup-close:focus-visible,
#jobNotificationPopup .job-popup-later:focus-visible,
#jobNotificationPopup .job-popup-wa-link:focus-visible,
#jobNotificationPopup .job-popup-wa-join:focus-visible {
    outline: 3px solid rgba(13, 110, 253, 0.5);
    outline-offset: 2px;
}

/* Body */
#jobNotificationPopup .job-popup-icon {
    width: 3.5rem;
    height: 3.5rem;
    margin: 0 auto 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(37, 211, 102, 0.12);
    color: var(--wa-green);
    font-size: 2rem;
    line-height: 1;
}

#jobNotificationPopup .job-popup-title {
    font-weight: 700;
    color: #212529;
    margin-bottom: 0.5rem;
}

#jobNotificationPopup .job-popup-sub {
    color: #6c757d;
    font-size: 0.92rem;
    margin: 0 0 1rem;
}

#jobNotificationPopup .job-popup-benefits {
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem 0.75rem;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 500;
    color: #495057;
}

#jobNotificationPopup .job-popup-benefits li {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    line-height: 1.3;
}

#jobNotificationPopup .job-popup-benefits i {
    color: var(--wa-green);
    font-size: 0.9rem;
    margin-top: 0.1rem;
    flex: 0 0 auto;
}

/* Contact input + error */
#jobNotificationPopup .job-popup-input {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    text-align: center;
}

#jobNotificationPopup .job-popup-error {
    color: #dc3545;
    font-size: 0.82rem;
    font-weight: 500;
    margin-top: 0.5rem;
    text-align: left;
}

/* Subscribe submit */
#jobNotificationPopup .job-popup-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    margin-top: 0.9rem;
    padding: 0.75rem 1rem;
    border: 0;
    border-radius: 0.6rem;
    background: linear-gradient(135deg, #0d6efd, #6610f2);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 0.5rem 1rem rgba(13, 110, 253, 0.25);
    transition: opacity 0.15s ease;
}

#jobNotificationPopup .job-popup-submit:hover {
    opacity: 0.92;
}

#jobNotificationPopup .job-popup-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

#jobNotificationPopup .job-popup-submit-icon {
    font-size: 1rem;
    line-height: 1;
}

#jobNotificationPopup .job-popup-submit:focus-visible {
    outline: 3px solid rgba(13, 110, 253, 0.5);
    outline-offset: 2px;
}

/* Success state */
#jobNotificationPopup .job-popup-success-icon {
    font-size: 2.75rem;
    line-height: 1;
    margin-bottom: 0.5rem;
}

#jobNotificationPopup .job-popup-success .job-popup-title {
    margin-bottom: 0.5rem;
}

/* "or join instantly" divider */
#jobNotificationPopup .job-popup-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.1rem 0 0.9rem;
    color: #adb5bd;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

#jobNotificationPopup .job-popup-divider::before,
#jobNotificationPopup .job-popup-divider::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: #e9ecef;
}

/* WhatsApp row: link + join button side by side */
#jobNotificationPopup .job-popup-wa {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
}

#jobNotificationPopup .job-popup-wa-link {
    flex: 1 1 auto;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 0.9rem;
    border: 1px solid #e9ecef;
    border-radius: 0.6rem;
    background: #f8f9fa;
    color: #212529;
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
    overflow: hidden;
    white-space: nowrap;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

#jobNotificationPopup .job-popup-wa-link:hover {
    background: #f1f3f5;
    border-color: #dee2e6;
    color: #212529;
}

#jobNotificationPopup .job-popup-wa-link i {
    color: var(--wa-green);
    font-size: 1.15rem;
    flex: 0 0 auto;
}

#jobNotificationPopup .job-popup-wa-link span {
    overflow: hidden;
    text-overflow: ellipsis;
}

#jobNotificationPopup .job-popup-wa-join {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1.35rem;
    border-radius: 0.6rem;
    background: var(--wa-green);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.92rem;
    text-decoration: none;
    box-shadow: 0 0.5rem 1rem rgba(37, 211, 102, 0.28);
    transition: background-color 0.15s ease;
}

#jobNotificationPopup .job-popup-wa-join:hover {
    background: var(--wa-green-dark);
    color: #ffffff;
}

/* Snooze */
#jobNotificationPopup .job-popup-later {
    display: inline-block;
    margin-top: 1rem;
    border: 0;
    background: transparent;
    color: #6c757d;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 0.35rem;
}

#jobNotificationPopup .job-popup-later:hover {
    color: #495057;
}

#jobNotificationPopup .job-popup-privacy {
    margin: 0.75rem 0 0;
    font-size: 0.75rem;
    color: #adb5bd;
}

#jobNotificationPopup .job-popup-privacy i {
    margin-right: 0.15rem;
}

/* Scroll lock applied to <body> while popup is open */
body.job-popup-no-scroll {
    overflow: hidden;
}

/* Mobile: bottom sheet */
@media (max-width: 767.98px) {
    #jobNotificationPopup {
        align-items: flex-end;
        padding: 0;
    }

    #jobNotificationPopup .job-popup {
        max-width: none;
        max-height: 92vh;
        border-radius: 1.25rem 1.25rem 0 0;
        padding: 2rem 1.25rem 1.75rem;
        box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.35);
    }
}

/* Avoid cramped two-column benefits on very small screens (e.g. 320px) */
@media (max-width: 399.98px) {
    #jobNotificationPopup .job-popup-benefits {
        grid-template-columns: 1fr;
    }
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
    #jobNotificationPopup,
    #jobNotificationPopup .job-popup {
        transition: none;
    }

    #jobNotificationPopup .job-popup {
        transform: none;
    }
}
