/* =============================================================
   IBM Affiliate Table — ibm-affiliate.css  v2.0
   Modern, high-tech design for Indian betting/gaming affiliate
   ============================================================= */

/* ---- Google Font: Rajdhani (display) + Nunito (body) ---- */
@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@600;700&family=Nunito:wght@400;600;700;800&display=swap');

/* ---- Design tokens ---- */
:root {
    --ibm-blue:        #0023a7;
    --ibm-blue-dark:   #001578;
    --ibm-blue-light:  #1a3fd4;
    --ibm-gold:        #fcc50a;
    --ibm-gold-dark:   #d4a200;
    --ibm-orange:      #b33f00;
    --ibm-orange-light:#e05000;
    --ibm-white:       #ffffff;
    --ibm-off-white:   #f4f6fb;
    --ibm-border:      rgba(0,35,167,0.10);
    --ibm-shadow:      0 8px 32px rgba(0,0,0,0.13);
    --ibm-shadow-lg:   0 16px 48px rgba(0,0,0,0.20);
    --ibm-radius:      18px;
    --ibm-radius-sm:   10px;
    --ibm-font-body:   'Nunito', sans-serif;
    --ibm-font-display:'Rajdhani', sans-serif;
    --ibm-max-width:   1200px;
    /* category tab colours */
    --cat-casino:   #0023a7;
    --cat-sports:   #b02a37;
    --cat-slots:    #00757a;
    --cat-crash:    #7a1fa2;
    --cat-aviator:  #d45000;
    --cat-ipl:      #1b6e23;
    --cat-owsports: #b5175e;
}

/* ---- SEO title (visually hidden but in DOM for crawlers) ---- */
.ibm-affiliate-seo-title {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
}

/* =============================================
   WRAPPER
   ============================================= */

#ibm-affiliate-wrapper {
    max-width: var(--ibm-max-width);
    margin: 32px auto;
    padding: 0 16px;
    font-family: var(--ibm-font-body);
    color: #111;
    box-sizing: border-box;
}

/* =============================================
   MOBILE LIST — hidden on desktop
   DESKTOP LIST — hidden on mobile
   ============================================= */

.ibm-aff-mobile-list  { display: none; }
.ibm-aff-desktop-list { display: block; }

@media (max-width: 767px) {
    .ibm-aff-mobile-list  { display: block; }
    .ibm-aff-desktop-list { display: none; }
}

/* =============================================
   LOAD MORE (initial hidden items via JS)
   ============================================= */

/* JS adds data-hidden to items beyond first 10 */
.ibm-aff-box-desktop[data-hidden],
.ibm-aff-card-mobile[data-hidden] {
    display: none;
}

/* =============================================
   CATEGORY TABS (shared desktop + mobile)
   ============================================= */

.ibm-aff-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.ibm-aff-tab {
    padding: 5px 14px;
    border-radius: 999px;
    font-family: var(--ibm-font-body);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #fff;
    border: none;
    cursor: pointer;
    user-select: none;
    opacity: 0.88;
    transition: opacity 0.18s, transform 0.18s, box-shadow 0.18s;
    text-transform: uppercase;
}

.ibm-aff-tab:hover {
    opacity: 1;
    transform: translateY(-1px);
}

.ibm-aff-tab.active {
    opacity: 1;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.85), 0 4px 14px rgba(0,0,0,0.28);
    transform: translateY(-1px);
}

.ibm-aff-tab[data-cat="casino"]   { background: var(--cat-casino); }
.ibm-aff-tab[data-cat="sports"]   { background: var(--cat-sports); }
.ibm-aff-tab[data-cat="slots"]    { background: var(--cat-slots); }
.ibm-aff-tab[data-cat="crash"]    { background: var(--cat-crash); }
.ibm-aff-tab[data-cat="aviator"]  { background: var(--cat-aviator); }
.ibm-aff-tab[data-cat="ipl"]      { background: var(--cat-ipl); }
.ibm-aff-tab[data-cat="owsports"] { background: var(--cat-owsports); }

/* =============================================
   DEPOSIT PANELS (shared)
   ============================================= */

.ibm-aff-deposits-wrapper {
    margin-top: 12px;
    border-top: 2px dashed var(--ibm-border);
    padding-top: 10px;
}

.ibm-aff-tab-panel {
    display: none;
    animation: ibm-fade-in 0.22s ease;
}

.ibm-aff-tab-panel.active {
    display: block;
}

@keyframes ibm-fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ibm-aff-deposit-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ibm-aff-deposit-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 14px;
    background: var(--ibm-off-white);
    border-radius: var(--ibm-radius-sm);
    padding: 7px 12px;
    font-size: 13px;
    font-family: var(--ibm-font-body);
    font-weight: 600;
    color: #222;
}

.dep-label {
    color: var(--ibm-blue);
    font-weight: 800;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    min-width: 72px;
}

.dep-bonus {
    color: #111;
    font-weight: 800;
    font-size: 14px;
}

.dep-pct {
    color: var(--ibm-orange);
    font-weight: 800;
    font-size: 14px;
}

.dep-min {
    color: #555;
    font-size: 12px;
    font-weight: 600;
}

.dep-spins {
    background: var(--ibm-gold);
    color: #333;
    font-size: 11px;
    font-weight: 800;
    border-radius: 999px;
    padding: 2px 9px;
    white-space: nowrap;
}

/* =============================================
   OFFER TEXT (shared)
   ============================================= */

.ibm-aff-offer-line {
    display: block;
    line-height: 1.55;
    padding: 1px 0;
}

.ibm-aff-offer-label {
    font-weight: 800;
    color: #111;
    font-family: var(--ibm-font-body);
}

.ibm-aff-offer-value {
    color: #333;
    font-weight: 600;
}

/* =============================================
   STARS (shared)
   ============================================= */

.ibm-aff-stars {
    display: inline-flex;
    gap: 1px;
}

.ibm-aff-star {
    font-size: 17px;
    line-height: 1;
}

.ibm-aff-star.filled { color: var(--ibm-gold); }
.ibm-aff-star.empty  { color: #d0d0d0; }

/* =============================================
   BUTTONS (shared)
   ============================================= */

.ibm-aff-btn-play,
.ibm-aff-btn-review {
    display: block;
    text-align: center;
    border-radius: 999px;
    font-family: var(--ibm-font-body);
    font-weight: 800;
    font-size: 14px;
    text-decoration: none !important;
    transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.15s;
    white-space: nowrap;
    cursor: pointer;
    border: 2px solid transparent;
    line-height: 1.2;
}

.ibm-aff-btn-play {
    background: var(--ibm-blue);
    border-color: var(--ibm-blue);
    color: #fff !important;
    padding: 10px 20px;
    letter-spacing: 0.04em;
}

.ibm-aff-btn-play:hover {
    background: var(--ibm-gold);
    border-color: var(--ibm-gold-dark);
    color: var(--ibm-blue-dark) !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(252,197,10,0.45);
}

.ibm-aff-btn-review {
    background: transparent;
    border-color: var(--ibm-orange);
    color: var(--ibm-orange) !important;
    padding: 8px 20px;
}

.ibm-aff-btn-review:hover {
    background: var(--ibm-orange);
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(179,63,0,0.30);
}

/* =============================================
   BADGE IMAGES (shared positioning base)
   ============================================= */

.ibm-aff-badge {
    position: absolute;
    pointer-events: none;
}

.ibm-aff-badge img {
    display: block;
    width: 100%;
    height: auto;
}

/* =============================================
   RANK BACKGROUND CIRCLE
   ============================================= */

.rank-bg {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: url('../ibm-affiliate/logos/rank-bg.webp') center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rank-num {
    font-family: var(--ibm-font-display);
    font-weight: 700;
    font-size: 22px;
    line-height: 1;
    text-shadow: 0 1px 4px rgba(0,0,0,0.55);
}

.rank-gold   .rank-num { color: #ffd700; }
.rank-silver .rank-num { color: #e0e0e0; }
.rank-bronze .rank-num { color: #cd7f32; }
.rank-default .rank-num { color: #f0f0f0; }

/* =============================================
   ██████  DESKTOP LAYOUT
   ============================================= */

.ibm-aff-box-desktop {
    position: relative;
    margin-bottom: 14px;
    border-radius: var(--ibm-radius);
    background: #fff;
    box-shadow: var(--ibm-shadow);
    border: 1px solid var(--ibm-border);
    padding: 14px 18px 16px;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    overflow: visible; /* allow badge to sit outside */
}

.ibm-aff-box-desktop:hover {
    box-shadow: var(--ibm-shadow-lg);
    transform: translateY(-2px);
}

/* Desktop main grid row */
.ibm-aff-row {
    display: grid;
    grid-template-columns: 68px 120px 160px 1fr 190px;
    align-items: center;
    gap: 14px;
}

.ibm-aff-col { position: relative; }

/* Col: Rank */
.ibm-aff-col.rank {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Col: Logo */
.ibm-aff-col.logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ibm-aff-col.logo img {
    max-width: 110px;
    max-height: 80px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: 8px;
}

/* Col: Brand */
.ibm-aff-col.brand {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ibm-aff-col.brand .brand-name {
    font-family: var(--ibm-font-display);
    font-weight: 700;
    font-size: 18px;
    color: #0a0a2a;
    line-height: 1.15;
}

/* Col: Offer */
.ibm-aff-col.offer {
    font-size: 13.5px;
    color: #222;
    border-left: 3px solid var(--ibm-blue);
    padding-left: 12px;
}

/* Col: CTA */
.ibm-aff-col.cta {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Desktop badge: bottom-left of box */
.ibm-aff-badge-desktop {
    bottom: 10px;
    left: 14px;
    width: 110px;
}

/* =============================================
   ██████  MOBILE CARD LAYOUT
   ============================================= */

.ibm-aff-card-mobile {
    position: relative;
    margin-bottom: 14px;
    border-radius: var(--ibm-radius);
    background: #fff;
    box-shadow: var(--ibm-shadow);
    border: 1px solid var(--ibm-border);
    padding: 14px 14px 16px;
    overflow: visible;
}

/* Row 1: Logo */
.ibm-aff-card-logo {
    text-align: center;
    margin-bottom: 10px;
}

.ibm-aff-card-logo img {
    max-width: 160px;
    max-height: 56px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: inline-block;
    border-radius: 8px;
}

/* Row 2: Name + Stars */
.ibm-aff-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.ibm-aff-card-header .brand-name {
    font-family: var(--ibm-font-display);
    font-weight: 700;
    font-size: 17px;
    color: #0a0a2a;
    line-height: 1.2;
}

/* Row 3: Offer */
.ibm-aff-card-offer {
    font-size: 13px;
    color: #222;
    border-left: 3px solid var(--ibm-blue);
    padding-left: 10px;
    margin-bottom: 12px;
}

/* Row 4: CTA */
.ibm-aff-card-cta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* Mobile badge: top-right */
.ibm-aff-badge-mobile {
    top: 8px;
    right: 10px;
    width: 80px;
}

/* =============================================
   SPECIAL BADGE CARD/BOX EFFECTS
   ============================================= */

/* ---- Top Pick — deep blue glass ---- */
.ibm-aff-box-desktop.badge-top-pick,
.ibm-aff-card-mobile.badge-top-pick {
    background: linear-gradient(135deg, rgba(0,35,167,0.12) 0%, rgba(255,255,255,1) 60%);
    border-color: rgba(0,35,167,0.25);
    box-shadow: 0 8px 28px rgba(0,35,167,0.18);
}

/* ---- Trending — warm ember ---- */
.ibm-aff-box-desktop.badge-trending,
.ibm-aff-card-mobile.badge-trending {
    background: linear-gradient(135deg, rgba(220,80,20,0.11) 0%, rgba(255,255,255,1) 60%);
    border-color: rgba(220,80,20,0.22);
    box-shadow: 0 8px 28px rgba(180,60,0,0.16);
}

/* ---- Editor's Choice — rich purple ---- */
.ibm-aff-box-desktop.badge-editors-choice,
.ibm-aff-card-mobile.badge-editors-choice {
    background: linear-gradient(135deg, rgba(120,30,170,0.11) 0%, rgba(255,255,255,1) 60%);
    border-color: rgba(120,30,170,0.22);
    box-shadow: 0 8px 28px rgba(120,30,170,0.16);
}

/* ---- Best Bonus — gold tint ---- */
.ibm-aff-box-desktop.badge-best-bonus,
.ibm-aff-card-mobile.badge-best-bonus {
    background: linear-gradient(135deg, rgba(252,197,10,0.13) 0%, rgba(255,255,255,1) 60%);
    border-color: rgba(212,162,0,0.28);
}

/* ---- New — fresh green ---- */
.ibm-aff-box-desktop.badge-new,
.ibm-aff-card-mobile.badge-new {
    background: linear-gradient(135deg, rgba(0,130,60,0.10) 0%, rgba(255,255,255,1) 60%);
    border-color: rgba(0,130,60,0.22);
}

/* ---- High Roller — deep charcoal ---- */
.ibm-aff-box-desktop.badge-high-roller,
.ibm-aff-card-mobile.badge-high-roller {
    background: linear-gradient(135deg, rgba(30,30,60,0.10) 0%, rgba(255,255,255,1) 60%);
    border-color: rgba(30,30,60,0.20);
}

/* ---- Fast Payout — teal ---- */
.ibm-aff-box-desktop.badge-fast-payout,
.ibm-aff-card-mobile.badge-fast-payout {
    background: linear-gradient(135deg, rgba(0,117,122,0.10) 0%, rgba(255,255,255,1) 60%);
    border-color: rgba(0,117,122,0.22);
}

/* ---- Exclusive — crimson ---- */
.ibm-aff-box-desktop.badge-exclusive,
.ibm-aff-card-mobile.badge-exclusive {
    background: linear-gradient(135deg, rgba(181,23,94,0.10) 0%, rgba(255,255,255,1) 60%);
    border-color: rgba(181,23,94,0.22);
}

/* =============================================
   BADGE ANIMATIONS (viewport-triggered)
   ============================================= */

/* Top Pick — gold pulse */
@keyframes ibm-aff-pulse-gold {
    0%   { box-shadow: 0 8px 28px rgba(0,35,167,0.18); }
    50%  { box-shadow: 0 8px 28px rgba(0,35,167,0.18), 0 0 0 4px rgba(252,197,10,0.35); }
    100% { box-shadow: 0 8px 28px rgba(0,35,167,0.18); }
}

.badge-top-pick.ibm-aff-animate {
    animation: ibm-aff-pulse-gold 3s ease-in-out infinite;
}

/* Trending — shimmer sweep */
@keyframes ibm-aff-shimmer {
    0%   { background-position: -200% center; }
    100% { background-position:  200% center; }
}

.badge-trending.ibm-aff-animate {
    background-image: linear-gradient(
        105deg,
        rgba(220,80,20,0.08) 0%,
        rgba(255,255,255,0.95) 40%,
        rgba(255,200,50,0.18) 55%,
        rgba(255,255,255,0.95) 70%,
        rgba(220,80,20,0.08) 100%
    );
    background-size: 200% 100%;
    animation: ibm-aff-shimmer 3.5s linear infinite;
}

/* Editor's Choice — purple glow */
@keyframes ibm-aff-purple-glow {
    0%   { box-shadow: 0 8px 28px rgba(120,30,170,0.16); }
    50%  { box-shadow: 0 8px 28px rgba(120,30,170,0.16), 0 0 24px 4px rgba(186,104,200,0.40); }
    100% { box-shadow: 0 8px 28px rgba(120,30,170,0.16); }
}

.badge-editors-choice.ibm-aff-animate {
    animation: ibm-aff-purple-glow 3s ease-in-out infinite;
}

/* =============================================
   LOAD MORE BUTTON
   ============================================= */

.ibm-aff-loadmore-wrapper {
    text-align: center;
    margin-top: 24px;
    padding-bottom: 8px;
}

#ibm-aff-loadmore {
    padding: 12px 36px;
    border-radius: 999px;
    border: 2px solid var(--ibm-blue);
    background: var(--ibm-blue);
    color: #fff;
    font-family: var(--ibm-font-body);
    font-weight: 800;
    font-size: 15px;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s, box-shadow 0.15s;
}

#ibm-aff-loadmore:hover:not([disabled]) {
    background: var(--ibm-gold);
    border-color: var(--ibm-gold-dark);
    color: var(--ibm-blue-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(252,197,10,0.40);
}

#ibm-aff-loadmore[disabled] {
    opacity: 0.45;
    cursor: default;
    background: #aaa;
    border-color: #aaa;
}

/* =============================================
   RESPONSIVE TWEAKS 768–1024px
   ============================================= */

@media (max-width: 1024px) and (min-width: 768px) {
    .ibm-aff-row {
        grid-template-columns: 58px 100px 130px 1fr 170px;
        gap: 10px;
    }

    .ibm-aff-col.logo img {
        max-width: 90px;
    }

    .ibm-aff-col.brand .brand-name {
        font-size: 15px;
    }

    .ibm-aff-col.offer {
        font-size: 12.5px;
    }

    .ibm-aff-btn-play,
    .ibm-aff-btn-review {
        font-size: 13px;
        padding: 8px 14px;
    }

    .ibm-aff-badge-desktop {
        width: 88px;
    }
}

/* =============================================
   ENTRY ANIMATION (staggered on load)
   ============================================= */

@keyframes ibm-aff-entry {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ibm-aff-box-desktop,
.ibm-aff-card-mobile {
    animation: ibm-aff-entry 0.38s ease both;
}

/* Stagger first 10 items */
.ibm-aff-box-desktop:nth-child(1),
.ibm-aff-card-mobile:nth-child(1) { animation-delay: 0.04s; }
.ibm-aff-box-desktop:nth-child(2),
.ibm-aff-card-mobile:nth-child(2) { animation-delay: 0.08s; }
.ibm-aff-box-desktop:nth-child(3),
.ibm-aff-card-mobile:nth-child(3) { animation-delay: 0.12s; }
.ibm-aff-box-desktop:nth-child(4),
.ibm-aff-card-mobile:nth-child(4) { animation-delay: 0.16s; }
.ibm-aff-box-desktop:nth-child(5),
.ibm-aff-card-mobile:nth-child(5) { animation-delay: 0.20s; }
.ibm-aff-box-desktop:nth-child(6),
.ibm-aff-card-mobile:nth-child(6) { animation-delay: 0.24s; }
.ibm-aff-box-desktop:nth-child(7),
.ibm-aff-card-mobile:nth-child(7) { animation-delay: 0.28s; }
.ibm-aff-box-desktop:nth-child(8),
.ibm-aff-card-mobile:nth-child(8) { animation-delay: 0.32s; }
.ibm-aff-box-desktop:nth-child(9),
.ibm-aff-card-mobile:nth-child(9) { animation-delay: 0.36s; }
.ibm-aff-box-desktop:nth-child(10),
.ibm-aff-card-mobile:nth-child(10) { animation-delay: 0.40s; }