/**
 * Worklumo Affiliates — Modern Enterprise Frontend Box Styles
 * Design: Minimalist, Elevated White Card, Midnight Navy Action
 * Palette: Worklumo Midnight (#001B40), Worklumo Blue (#0075DD), Emerald (#10B981), Slate (#64748B)
 */

.wl-affiliate-box {
    margin: 2.25rem 0;
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
    clear: both;
}

.wl-affiliate-box.wl-align-center {
    margin-left: auto;
    margin-right: auto;
    max-width: 760px;
}

.wl-affiliate-box.wl-align-wide {
    max-width: 100%;
}

.wl-aff-inner {
    position: relative;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.6rem 1.85rem;
    box-shadow: 0 4px 20px -2px rgba(0, 27, 64, 0.05), 0 2px 6px -1px rgba(0, 27, 64, 0.02);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    box-sizing: border-box;
}

.wl-aff-inner:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px -4px rgba(0, 27, 64, 0.09), 0 4px 12px -2px rgba(0, 27, 64, 0.03);
    border-color: #cbd5e1;
}

/* Header: Brand Avatar, Title, Category & Badges */
.wl-aff-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.wl-aff-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.wl-aff-avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 700;
    font-size: 17px;
    line-height: 1;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.wl-aff-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wl-aff-name {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    color: #001b40 !important;
    line-height: 1.25 !important;
}

.wl-aff-category-sub {
    font-size: 0.76rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1;
}

/* Badges Group */
.wl-aff-badges-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.wl-aff-promo-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1;
}

.wl-badge-dot {
    width: 7px;
    height: 7px;
    background-color: #10b981;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

/* Lead Description */
.wl-aff-description {
    margin: 0.75rem 0 1rem 0;
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.55;
}

.wl-aff-description p {
    margin: 0 !important;
}

/* 3 Key Highlights (Checkmark List) */
.wl-aff-highlights {
    list-style: none !important;
    margin: 1rem 0 1.25rem 0 !important;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.wl-aff-highlights li {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    color: #1e293b;
    font-size: 0.93rem;
    font-weight: 500;
    line-height: 1.45;
    margin: 0 !important;
    padding: 0 !important;
}

.wl-check-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ecfdf5;
    color: #10b981;
    flex-shrink: 0;
    margin-top: 1px;
}

.wl-check-icon svg {
    display: block;
    stroke: #10b981;
}

/* Footer: Single CTA on Left + Trust Signature on Right */
.wl-aff-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.25rem;
    padding-top: 1.15rem;
    border-top: 1px solid #f1f5f9;
}

.wl-aff-cta-wrap {
    display: flex;
    align-items: center;
}

body .entry-content .wl-affiliate-box .wl-aff-cta-btn,
body .entry-content a.wl-aff-cta-btn,
body .wl-affiliate-box a.wl-aff-cta-btn,
.wl-aff-cta-btn,
.wl-aff-cta-btn span {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    background: #001b40 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    border-bottom: none !important;
    padding: 0.75rem 1.6rem !important;
    border-radius: 8px !important;
    border: 1px solid #00122e !important;
    box-shadow: 0 2px 6px rgba(0, 27, 64, 0.15) !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
}

body .entry-content .wl-affiliate-box .wl-aff-cta-btn span,
body .entry-content a.wl-aff-cta-btn span,
.wl-aff-cta-btn span {
    display: inline-block !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    text-decoration: none !important;
    border-bottom: none !important;
}

body .entry-content .wl-affiliate-box .wl-aff-cta-btn:hover,
body .entry-content a.wl-aff-cta-btn:hover,
body .wl-affiliate-box a.wl-aff-cta-btn:hover,
.wl-aff-cta-btn:hover,
.wl-aff-cta-btn:focus,
.wl-aff-cta-btn:hover span,
.wl-aff-cta-btn:focus span {
    background: #0f172a !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 14px rgba(0, 27, 64, 0.25) !important;
    text-decoration: none !important;
    border-bottom: none !important;
}

body .entry-content .wl-affiliate-box .wl-aff-cta-btn:visited,
body .entry-content a.wl-aff-cta-btn:visited,
body .wl-affiliate-box a.wl-aff-cta-btn:visited,
.wl-aff-cta-btn:visited,
.wl-aff-cta-btn:visited span {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    text-decoration: none !important;
    border-bottom: none !important;
}

.wl-aff-arrow {
    display: inline-block !important;
    color: #ffffff !important;
    stroke: #ffffff !important;
    transition: transform 0.2s ease;
}

.wl-aff-cta-btn:hover .wl-aff-arrow {
    transform: translateX(3px);
}

/* Trust Signature & Interactive Popover */
.wl-aff-trust-sign {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
}

.wl-trust-label {
    color: #64748b;
    user-select: none;
}

.wl-aff-tooltip-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.wl-aff-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: #eef2f6;
    color: #64748b;
    border: 1px solid #cbd5e1;
    padding: 0;
    margin: 0;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
    flex-shrink: 0;
}

.wl-aff-info-btn:hover,
.wl-aff-info-btn:focus,
.wl-aff-tooltip-wrap.is-active .wl-aff-info-btn {
    background: #0075dd;
    color: #ffffff;
    border-color: #0063c1;
    transform: scale(1.1);
    box-shadow: 0 2px 6px rgba(0, 117, 221, 0.35);
}

.wl-info-icon-svg {
    display: block;
    width: 11px;
    height: 11px;
    pointer-events: none;
}

/* Popover floats UPWARDS from footer */
.wl-aff-popover {
    position: absolute;
    bottom: calc(100% + 10px);
    right: 0;
    width: 290px;
    max-width: min(290px, 80vw);
    background: #001b40;
    color: #ffffff;
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: 0 12px 28px -4px rgba(0, 27, 64, 0.35), 0 4px 10px -2px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px) scale(0.97);
    transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s;
    pointer-events: none;
    text-align: left;
}

/* Triangle Arrow pointing down */
.wl-aff-popover::before {
    content: "";
    position: absolute;
    bottom: -5px;
    right: 8px;
    width: 10px;
    height: 10px;
    background: #001b40;
    transform: rotate(45deg);
    border-radius: 2px;
}

/* Visibility Triggers */
.wl-aff-tooltip-wrap:hover .wl-aff-popover,
.wl-aff-tooltip-wrap.is-active .wl-aff-popover,
.wl-aff-info-btn:focus + .wl-aff-popover,
.wl-aff-tooltip-wrap:focus-within .wl-aff-popover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.wl-popover-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #38bdf8;
    margin-bottom: 6px;
}

.wl-popover-text {
    font-size: 12px !important;
    line-height: 1.5 !important;
    color: #e2e8f0 !important;
    margin: 0 !important;
    font-weight: 400 !important;
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
    .wl-aff-inner {
        padding: 1.25rem 1.25rem;
    }
    
    .wl-aff-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .wl-aff-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 0.85rem;
    }

    .wl-aff-cta-btn {
        width: 100% !important;
    }

    .wl-aff-trust-sign {
        justify-content: center;
    }

    .wl-aff-popover {
        right: auto;
        left: 50%;
        transform: translateX(-50%) translateY(6px);
    }

    .wl-aff-tooltip-wrap:hover .wl-aff-popover,
    .wl-aff-tooltip-wrap.is-active .wl-aff-popover {
        transform: translateX(-50%) translateY(0);
    }

    .wl-aff-popover::before {
        right: auto;
        left: 50%;
        transform: translateX(-50%) rotate(45deg);
    }
}
