/* ========================================
   OGAds Offer Wall - Enhanced Styles
   Loaded in <head> after style.css; the ID-scoped
   selectors override the legacy inline .offer-card
   styles embedded in the game pages.
   ======================================== */

/* --- Scrollable offer list --- */
#offersContainer {
    /* Cap by remaining viewport space, not a fixed value: 330px ≈ modal
       padding + icon + title + subtitle + instruction box above the list.
       Prevents the modal and this list from scrolling at the same time. */
    max-height: min(340px, calc(85vh - 330px));
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px;
    /* Stretch cards nearly edge-to-edge inside the modal (modal padding is 50px) */
    margin-left: -40px;
    margin-right: -40px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 212, 255, 0.5) rgba(255, 255, 255, 0.05);
}

/* Short viewports: never nest two scrollbars. Disable the inner list
   scroll entirely and let the modal itself scroll as one column. Also
   shrink the modal padding so cards keep their ~10px edge gap. */
@media (max-height: 700px) {
    .modal .modal-content {
        padding: 30px 40px;
    }

    #offersContainer {
        max-height: none;
        overflow: visible;
        padding-right: 0;
        margin-left: -30px;
        margin-right: -30px;
    }
}

#offersContainer::-webkit-scrollbar {
    width: 6px;
}

#offersContainer::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
}

#offersContainer::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #00d4ff, #7c3aed);
    border-radius: 10px;
}

#offersContainer::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #3ae2ff, #9b5cf8);
}

/* --- Offer card --- */
#offersContainer .offer-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 10px;
    text-decoration: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    animation: offerFadeIn 0.35s ease backwards;
}

/* Gradient glow wash on hover */
#offersContainer .offer-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.12), rgba(124, 58, 237, 0.12));
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

#offersContainer .offer-card:hover {
    border-color: rgba(0, 212, 255, 0.7);
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 8px 24px rgba(0, 212, 255, 0.18), 0 0 0 1px rgba(0, 212, 255, 0.25);
}

#offersContainer .offer-card:hover::before {
    opacity: 1;
}

/* --- App icon --- */
#offersContainer .offer-card img {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #fff;
    object-fit: cover;
    flex-shrink: 0;
    margin-right: 0;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12), 0 4px 12px rgba(0, 0, 0, 0.35);
}

/* --- Text block --- */
#offersContainer .offer-info {
    flex: 1;
    text-align: left;
    min-width: 0;
}

#offersContainer .offer-name {
    color: #fff;
    font-size: 0.88rem;
    font-weight: 700;
    display: block;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#offersContainer .offer-desc {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.72rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.35;
}

/* --- Legacy arrow (fallback card) --- */
#offersContainer .offer-arrow {
    color: #00d4ff;
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* --- Staggered entrance animation --- */
#offersContainer .offer-card:nth-child(1) { animation-delay: 0.02s; }
#offersContainer .offer-card:nth-child(2) { animation-delay: 0.06s; }
#offersContainer .offer-card:nth-child(3) { animation-delay: 0.10s; }
#offersContainer .offer-card:nth-child(4) { animation-delay: 0.14s; }
#offersContainer .offer-card:nth-child(5) { animation-delay: 0.18s; }
#offersContainer .offer-card:nth-child(6) { animation-delay: 0.22s; }
#offersContainer .offer-card:nth-child(7) { animation-delay: 0.26s; }
#offersContainer .offer-card:nth-child(8) { animation-delay: 0.30s; }
#offersContainer .offer-card:nth-child(9) { animation-delay: 0.34s; }
#offersContainer .offer-card:nth-child(10) { animation-delay: 0.38s; }

@keyframes offerFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
