/**
 * XoXo Cards - Page "Cadeaux & Avantages"
 *
 * Styles dedies a la nouvelle vue bp-rewards.php (v8.5.0 - TACHE 219).
 *
 * Palette XoXo (cohérence v8.4.x) :
 *   #FF00AA primary | #FF66C4 secondary | #831843 dark | #c71585 medium
 *   #fbcfe8 border pâle | #fff5fb background pastel
 *
 * Structure :
 *   1. Progression header (compteur global + barre)
 *   2. Filtres par type de lot (pilules)
 *   3. Onglets internes (Mes débloquées / À débloquer)
 *   4. Sections empilées (Cartes / Séries / Puzzles)
 *   5. Tuiles récompenses (image + badges + body + CTA)
 *   6. Footer CTA global
 *   7. Responsive
 *
 * Spécificité haute pour vaincre les overrides du thème (pattern v8.4.2).
 *
 * @package XoXo_Cards
 * @since 8.5.0
 */

/* ============================================================ */
/* PROGRESSION GLOBALE                                          */
/* ============================================================ */
.xoxo-cards-rewards .xoxo-rewards-progress {
    background: linear-gradient(135deg, #fff5fb 0%, #fef2f8 100%);
    border: 1px solid #fce7f3;
    border-radius: 14px;
    padding: 18px 22px;
    margin: 24px 0;
}
.xoxo-cards-rewards .xoxo-rewards-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}
.xoxo-cards-rewards .xoxo-rewards-progress-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: #831843;
    margin: 0;
}
.xoxo-cards-rewards .xoxo-rewards-progress-count {
    font-size: 14px;
    font-weight: 700;
    color: #FF00AA;
    background: #fff;
    padding: 5px 12px;
    border-radius: 999px;
    border: 1.5px solid #fbcfe8;
}
.xoxo-cards-rewards .xoxo-rewards-progress-bar {
    background: #fff;
    border-radius: 999px;
    overflow: hidden;
    height: 22px;
    border: 1px solid #fbcfe8;
    position: relative;
}
.xoxo-cards-rewards .xoxo-rewards-progress-fill {
    background: linear-gradient(90deg, #FF00AA 0%, #FF66C4 100%);
    height: 100%;
    min-width: 36px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    transition: width .4s ease;
    border-radius: 999px;
}
.xoxo-cards-rewards .xoxo-rewards-progress-fill span {
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0,0,0,.15);
}

/* ============================================================ */
/* FILTRES PAR TYPE DE LOT                                      */
/* ============================================================ */
.xoxo-cards-rewards .xoxo-rewards-filters {
    display: flex !important;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0;
    margin: 16px 0 18px;
    list-style: none !important;
}
.xoxo-cards-rewards .xoxo-rewards-filters .xoxo-rewards-filter-btn,
.xoxo-cards-rewards button.xoxo-rewards-filter-btn {
    display: inline-flex !important;
    align-items: center !important;
    padding: 8px 16px !important;
    border-radius: 999px !important;
    background: #ffffff !important;
    border: 1.5px solid #fbcfe8 !important;
    color: #831843 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    line-height: 1.2 !important;
    transition: background-color .15s, color .15s, border-color .15s, box-shadow .15s, transform .15s !important;
    text-decoration: none !important;
    text-shadow: none !important;
    outline: none !important;
    font-family: inherit !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    box-sizing: border-box !important;
    min-height: 0 !important;
    height: auto !important;
}
.xoxo-cards-rewards .xoxo-rewards-filters .xoxo-rewards-filter-btn:hover,
.xoxo-cards-rewards button.xoxo-rewards-filter-btn:hover {
    background: #fff5fb !important;
    border-color: #FF66C4 !important;
    color: #c71585 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 3px 10px rgba(255, 0, 170, 0.12) !important;
}
.xoxo-cards-rewards .xoxo-rewards-filters .xoxo-rewards-filter-btn.is-active,
.xoxo-cards-rewards button.xoxo-rewards-filter-btn.is-active {
    background: linear-gradient(135deg, #FF00AA 0%, #FF66C4 100%) !important;
    color: #ffffff !important;
    border-color: transparent !important;
    box-shadow: 0 4px 14px rgba(255, 0, 170, 0.28) !important;
}

/* ============================================================ */
/* ONGLETS INTERNES (DEBLOQUEES / A DEBLOQUER)                  */
/* ============================================================ */
.xoxo-cards-rewards .xoxo-rewards-tabs {
    display: flex !important;
    flex-wrap: wrap;
    gap: 6px;
    border-bottom: 2px solid #fce7f3;
    padding: 0 0 0 0;
    margin: 0 0 20px 0;
}
.xoxo-cards-rewards .xoxo-rewards-tabs .xoxo-rewards-tab,
.xoxo-cards-rewards button.xoxo-rewards-tab {
    display: inline-flex !important;
    align-items: center !important;
    padding: 12px 22px !important;
    background: transparent !important;
    border: none !important;
    border-bottom: 3px solid transparent !important;
    margin-bottom: -2px !important;
    color: #6b7280 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: color .15s, border-color .15s, background-color .15s !important;
    line-height: 1.2 !important;
    text-decoration: none !important;
    text-shadow: none !important;
    outline: none !important;
    font-family: inherit !important;
    text-transform: none !important;
    border-radius: 0 !important;
    box-sizing: border-box !important;
    min-height: 0 !important;
    height: auto !important;
}
.xoxo-cards-rewards .xoxo-rewards-tabs .xoxo-rewards-tab:hover,
.xoxo-cards-rewards button.xoxo-rewards-tab:hover {
    color: #c71585 !important;
    background: #fff5fb !important;
}
.xoxo-cards-rewards .xoxo-rewards-tabs .xoxo-rewards-tab.is-active,
.xoxo-cards-rewards button.xoxo-rewards-tab.is-active {
    color: #FF00AA !important;
    border-bottom-color: #FF00AA !important;
    background: transparent !important;
}

/* ============================================================ */
/* PANELS                                                       */
/* ============================================================ */
.xoxo-cards-rewards .xoxo-rewards-panel {
    display: none;
}
.xoxo-cards-rewards .xoxo-rewards-panel.is-active {
    display: block;
}

/* ============================================================ */
/* SECTIONS (Cartes / Series / Puzzles)                         */
/* ============================================================ */
.xoxo-cards-rewards .xoxo-rewards-section {
    margin-bottom: 36px;
}
.xoxo-cards-rewards .xoxo-rewards-section-title {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 17px;
    font-weight: 700;
    color: #831843;
    margin: 0 0 16px 0;
    padding: 0 0 10px 0;
    border-bottom: 1px solid #f3e8ee;
}
.xoxo-cards-rewards .xoxo-rewards-section-title svg {
    color: #FF00AA;
    flex-shrink: 0;
}
.xoxo-cards-rewards .xoxo-rewards-empty {
    background: #fafafa;
    border: 1px dashed #e5e7eb;
    border-radius: 10px;
    padding: 18px 22px;
    margin: 0;
    color: #6b7280;
    font-size: 14px;
    font-style: italic;
    text-align: center;
}

/* ============================================================ */
/* GRILLE DE TUILES                                             */
/* ============================================================ */
.xoxo-cards-rewards .xoxo-rewards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
}

/* ============================================================ */
/* TUILE REWARD (article)                                       */
/* ============================================================ */
.xoxo-cards-rewards .xoxo-reward-tile {
    background: #ffffff;
    border: 1.5px solid #f3e8ee;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    position: relative;
}
.xoxo-cards-rewards .xoxo-reward-tile.is-clickable {
    cursor: pointer;
}
.xoxo-cards-rewards .xoxo-reward-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(255, 0, 170, 0.13);
    border-color: #FF66C4;
}

/* === Image === */
.xoxo-cards-rewards .xoxo-reward-tile-image-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1.4;
    background: #f9fafb;
    overflow: hidden;
}
.xoxo-cards-rewards .xoxo-reward-tile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: filter .25s ease;
}
.xoxo-cards-rewards .xoxo-reward-tile-image-placeholder {
    background: linear-gradient(135deg, #fce7f3 0%, #fff5fb 100%);
}
/* === REGLE OFFICIELLE v7.0.11 TACHE 162 (unifiee) appliquee ici ===
   Cartes / series / puzzles non-obtenus : masquage STRICT avec
   grayscale(100%) + blur(8px) sur l'image + overlay logo XoXo Cards
   pour conserver l'effet "carte cachee" au membre. Le hover NE
   relaxe PAS le masquage (regle user v8.5.1 : "les cartes doivent
   rester cachees pour le membre quand il navigue sur cette page").
   Le teasing reste assure par les badges "A debloquer" + le CTA
   "Debloquer cette recompense" en bas de tuile. */
.xoxo-cards-rewards .xoxo-reward-tile.is-locked .xoxo-reward-tile-image {
    filter: grayscale(100%) blur(8px) !important;
    -webkit-filter: grayscale(100%) blur(8px) !important;
    opacity: 0.85 !important;
    will-change: filter;
}

/* Overlay logo XoXo Cards superpose en centrage absolu sur les tuiles
   verrouillees. Pattern identique a v7.0.11 (cards.css ligne 505+). */
.xoxo-cards-rewards .xoxo-reward-tile.is-locked .xoxo-reward-tile-image-wrap::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 55%;
    height: 55%;
    background-image: url('../images/logo-overlay.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 4;  /* sous les badges (z-index 2) qui restent visibles ? NON, on
                    laisse le logo au-dessus des badges pour reforcer le masque
                    visuel. Les badges restent visibles via leur backdrop-filter. */
    z-index: 5;
    opacity: 0.95;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
    -webkit-filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}

/* === Badges sur l'image === */
.xoxo-cards-rewards .xoxo-reward-tile-badge {
    position: absolute;
    z-index: 2;
    font-size: 10.5px;
    font-weight: 700;
    padding: 4px 9px;
    border-radius: 999px;
    line-height: 1.2;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 1px 4px rgba(0,0,0,.1);
}
.xoxo-cards-rewards .xoxo-reward-tile-badge-source {
    top: 8px;
    left: 8px;
    background: rgba(31, 41, 55, 0.85);
    color: #fff;
}
.xoxo-cards-rewards .xoxo-reward-tile-badge-type {
    top: 8px;
    right: 8px;
    color: #fff;
    /* v8.5.2 : labels exacts peuvent etre longs (ex: "Accès VIP / Entrée gratuite").
       On limite a 65% de la largeur de l'image et on autorise la cesure douce. */
    max-width: calc(100% - 24px);
    white-space: normal;
    text-align: right;
    line-height: 1.25;
}
.xoxo-cards-rewards .xoxo-reward-tile-badge-type-gift     { background: rgba(255, 0, 170, 0.92); }
.xoxo-cards-rewards .xoxo-reward-tile-badge-type-promo    { background: rgba(139, 92, 246, 0.92); }
.xoxo-cards-rewards .xoxo-reward-tile-badge-type-entry    { background: rgba(34, 197, 94, 0.92); }
.xoxo-cards-rewards .xoxo-reward-tile-badge-type-discount { background: rgba(245, 158, 11, 0.92); }
/* v8.5.2 : badge bleu pour Bonus Points (advantage_type='bonus_points') */
.xoxo-cards-rewards .xoxo-reward-tile-badge-type-points   { background: rgba(59, 130, 246, 0.92); }
.xoxo-cards-rewards .xoxo-reward-tile-badge-type-other    { background: rgba(75, 85, 99, 0.92); }

/* Pillule d'etat (bas-gauche de l'image) */
.xoxo-cards-rewards .xoxo-reward-tile-state-pill {
    position: absolute;
    z-index: 2;
    bottom: 8px;
    left: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10.5px;
    font-weight: 700;
    padding: 4px 9px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.xoxo-cards-rewards .xoxo-reward-tile-state-pill-unlocked {
    background: #22c55e;
    color: #fff;
}
.xoxo-cards-rewards .xoxo-reward-tile-state-pill-locked {
    background: rgba(255,255,255,.95);
    color: #6b7280;
    border: 1px solid #e5e7eb;
}

/* === Body === */
.xoxo-cards-rewards .xoxo-reward-tile-body {
    padding: 14px 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}
.xoxo-cards-rewards .xoxo-reward-tile-title {
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
    line-height: 1.3;
}
.xoxo-cards-rewards .xoxo-reward-tile-subtitle {
    font-size: 12px;
    color: #6b7280;
    margin: 0;
    font-weight: 500;
}
.xoxo-cards-rewards .xoxo-reward-tile-value {
    font-size: 14px;
    color: #FF00AA;
    margin: 4px 0 0 0;
    font-weight: 700;
}
.xoxo-cards-rewards .xoxo-reward-tile-desc {
    font-size: 13px;
    color: #4b5563;
    margin: 4px 0 0 0;
    line-height: 1.45;
}
.xoxo-cards-rewards .xoxo-reward-tile-validity {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    color: #92400e;
    background: #fef3c7;
    padding: 3px 8px;
    border-radius: 6px;
    margin: 4px 0 0 0;
    align-self: flex-start;
    font-weight: 600;
}
.xoxo-cards-rewards .xoxo-reward-tile-progress {
    font-size: 12px;
    color: #6b7280;
    margin: 4px 0 0 0;
    font-weight: 600;
}

/* === CTA bouton "Debloquer cette recompense" === */
.xoxo-cards-rewards a.xoxo-reward-tile-cta {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    margin-top: auto !important;
    padding: 9px 14px !important;
    background: linear-gradient(135deg, #FF00AA 0%, #FF66C4 100%) !important;
    color: #ffffff !important;
    text-decoration: none !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    transition: transform .15s, box-shadow .15s !important;
    box-shadow: 0 3px 10px rgba(255, 0, 170, 0.22) !important;
    text-shadow: none !important;
    border: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    font-family: inherit !important;
}
.xoxo-cards-rewards a.xoxo-reward-tile-cta:hover,
.xoxo-cards-rewards a.xoxo-reward-tile-cta:focus {
    transform: translateY(-1px) !important;
    box-shadow: 0 5px 16px rgba(255, 0, 170, 0.36) !important;
    color: #ffffff !important;
    text-decoration: none !important;
}

/* ============================================================ */
/* FOOTER CTA GLOBAL (incitation)                               */
/* ============================================================ */
.xoxo-cards-rewards .xoxo-rewards-footer-cta {
    margin: 40px 0 12px;
    background: linear-gradient(135deg, #831843 0%, #FF00AA 100%);
    border-radius: 18px;
    padding: 32px 28px;
    color: #fff;
    text-align: center;
    box-shadow: 0 10px 30px rgba(255, 0, 170, 0.25);
}
.xoxo-cards-rewards .xoxo-rewards-footer-cta-content h3 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #fff;
}
.xoxo-cards-rewards .xoxo-rewards-footer-cta-content p {
    font-size: 14.5px;
    margin: 0 auto 18px;
    color: rgba(255,255,255,.92);
    max-width: 520px;
    line-height: 1.5;
}
.xoxo-cards-rewards a.xoxo-rewards-footer-cta-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 13px 26px !important;
    background: #ffffff !important;
    color: #FF00AA !important;
    text-decoration: none !important;
    border-radius: 999px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    transition: transform .15s, box-shadow .15s !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18) !important;
    text-shadow: none !important;
    border: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    font-family: inherit !important;
}
.xoxo-cards-rewards a.xoxo-rewards-footer-cta-btn:hover,
.xoxo-cards-rewards a.xoxo-rewards-footer-cta-btn:focus {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.26) !important;
    color: #c71585 !important;
    text-decoration: none !important;
}

/* ============================================================ */
/* RESPONSIVE                                                   */
/* ============================================================ */
@media (max-width: 782px) {
    .xoxo-cards-rewards .xoxo-rewards-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 12px;
    }
    .xoxo-cards-rewards .xoxo-rewards-progress { padding: 14px 16px; }
    .xoxo-cards-rewards .xoxo-rewards-section-title { font-size: 15px; }
    .xoxo-cards-rewards .xoxo-reward-tile-title { font-size: 14px; }
    .xoxo-cards-rewards .xoxo-reward-tile-body { padding: 12px; }
    .xoxo-cards-rewards .xoxo-rewards-footer-cta { padding: 24px 18px; }
    .xoxo-cards-rewards .xoxo-rewards-footer-cta-content h3 { font-size: 18px; }
}
@media (max-width: 480px) {
    .xoxo-cards-rewards .xoxo-rewards-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .xoxo-cards-rewards .xoxo-rewards-tabs .xoxo-rewards-tab,
    .xoxo-cards-rewards button.xoxo-rewards-tab {
        padding: 10px 14px !important;
        font-size: 12.5px !important;
        flex: 1;
        justify-content: center;
    }
    .xoxo-cards-rewards .xoxo-rewards-filters .xoxo-rewards-filter-btn,
    .xoxo-cards-rewards button.xoxo-rewards-filter-btn {
        padding: 7px 12px !important;
        font-size: 12px !important;
    }
    .xoxo-cards-rewards .xoxo-reward-tile-badge,
    .xoxo-cards-rewards .xoxo-reward-tile-state-pill {
        font-size: 9.5px;
        padding: 3px 7px;
    }
}
