/* ============================================
   AD POPUP OVERLAY
   ============================================ */
#ad-popup {
    position: fixed;
    inset: 0;
    z-index: 11000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#ad-popup.popup-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ============================================
   BACKDROP
   ============================================ */
.popup-backdrop {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(20, 16, 40, 0.72), rgba(6, 6, 12, 0.88));
    backdrop-filter: blur(10px);
}

/* ============================================
   POPUP DIALOG
   ============================================ */
.popup-dialog {
    position: relative;
    background: #14141d;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    max-width: 520px;
    width: 90%;
    overflow: hidden;
    box-shadow:
        0 24px 70px rgba(0, 0, 0, 0.6),
        0 0 120px rgba(124, 92, 255, 0.12);
    transform: scale(0.9) translateY(24px) rotateX(4deg);
    transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.popup-dialog::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #7c5cff, #00e89d, #7c5cff);
    z-index: 12;
    border-radius: 20px 20px 0 0;
}

#ad-popup:not(.popup-hidden) .popup-dialog {
    transform: scale(1) translateY(0) rotateX(0);
}

/* ============================================
   CLOSE BUTTON
   ============================================ */
.popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    width: 36px;
    height: 36px;
    background: rgba(10, 10, 18, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 50%;
    color: #fff;
    font-size: 22px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.popup-close:hover {
    background: rgba(124, 92, 255, 0.6);
    border-color: rgba(255, 255, 255, 0.25);
    transform: scale(1.12) rotate(90deg);
}

/* ============================================
   POPUP IMAGE
   ============================================ */
.popup-image-container {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
}

.popup-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.5s ease;
}

/* Soft gradient sitting over the image bottom for the partner badge */
.popup-image-fade {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(20, 20, 29, 0.9), rgba(20, 20, 29, 0) 55%);
    pointer-events: none;
}

.popup-dialog:hover .popup-image {
    transform: scale(1.06);
}

.popup-partner {
    position: absolute;
    left: 18px;
    bottom: 14px;
    padding: 5px 12px;
    background: rgba(124, 92, 255, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 999px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* ============================================
   POPUP DETAILS
   ============================================ */
.popup-details {
    padding: 24px 32px 26px;
}

/* ============================================
   TITLE ROW + VERIFIED BADGE
   ============================================ */
.popup-title-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.popup-title {
    flex: 1;
    min-width: 0;
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.3;
}

/* Subtle spinning serrated ring around a dark disc + check.
   The outer ring uses a repeating-conic-gradient teeth
   mask shaped into a band so only the protruding teeth
   are visible. */
.verified-badge {
    flex: 0 0 auto;
    position: relative;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #14141d;
    box-shadow:
        0 0 0 1px rgba(0, 232, 157, 0.4),
        0 6px 18px rgba(0, 0, 0, 0.55);
    margin-top: 2px;
}

.verified-badge::before {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    background: repeating-conic-gradient(
        from -6deg,
        rgba(0, 232, 157, 0.85) 0deg 5.5deg,
        transparent 5.5deg 11deg
    );
    -webkit-mask: radial-gradient(circle at center, transparent 0 10px, #000 10.5px 21px, transparent 21.5px);
            mask: radial-gradient(circle at center, transparent 0 10px, #000 10.5px 21px, transparent 21.5px);
    animation: badgeSpin 12s linear infinite;
}

.verified-badge::after {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.verified-badge svg {
    width: 13px;
    height: 13px;
    position: relative;
    z-index: 1;
}

@keyframes badgeSpin {
    to { transform: rotate(360deg); }
}

/* Featured (paid/validated) tag shown inside the popup for featured partners */
.popup-featured {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    margin-top: 1px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #6b3a00;
    background: linear-gradient(135deg, #ffe08a, #ff8a3d);
    box-shadow: 0 4px 12px rgba(255, 170, 60, 0.35);
    white-space: nowrap;
}

.popup-featured svg {
    width: 12px;
    height: 12px;
}

.popup-featured-hidden {
    display: none;
}

/* ============================================
   DESCRIPTION
   ============================================ */
.popup-description {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.6;
    margin-bottom: 22px;
}

/* ============================================
   PRICE ROW + CTA
   ============================================ */
.popup-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.popup-price-block {
    display: flex;
    flex-direction: column;
}

.popup-price-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 2px;
}

.popup-price {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, #7c5cff, #00e89d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

.popup-cta-wrap {
    position: relative;
}

.popup-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #7c5cff, #00e89d);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 15px rgba(124, 92, 255, 0.3);
}

.popup-cta svg {
    width: 15px;
    height: 15px;
    transition: transform 0.2s ease;
}

.popup-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(124, 92, 255, 0.5);
}

.popup-cta:hover svg {
    transform: translate(2px, -2px);
}

.popup-cta:active {
    transform: translateY(0);
}

.popup-domain {
    margin-top: 14px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 0.02em;
}

.popup-domain::before {
    content: '\2192';
    margin-right: 6px;
    color: #00e89d;
}

@media (max-width: 480px) {
    .popup-details {
        padding: 20px 20px 22px;
    }
    .popup-price-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .popup-cta {
        width: 100%;
        justify-content: center;
    }
}
