/**
 * XoXo Cards - Design System Unifie (v5.3.15 - Tache 71)
 * 
 * Harmonise la presentation visuelle de TOUTES les pages FO (sauf Echanges > Proposer 
 * qui utilise .xoxo-step-* deja finalise en v5.3.14). 
 * 
 * Strategie : cibler les conteneurs existants des templates via selecteurs de classe
 * (.xoxo-cards-collection, .xoxo-cards-wishlist, .xoxo-cards-packs, etc.) et appliquer
 * un design system coherent inspire du succes visuel de la page "Proposer".
 * 
 * NE JAMAIS MODIFIER : .xoxo-propose-steps, .xoxo-step, .xoxo-step-*, .xoxo-exchange-*
 * (reserve a la page Echanges > Proposer, finalise Tache 70)
 */

/* =============================================================
   0. COMPOSANT .xoxo-page-block - Pattern visuel inspire de .xoxo-step
   Utilise par TOUS les templates FO pour un rendu coherent
   (sauf .xoxo-step/.xoxo-propose-steps qui sont preserves)
   ============================================================= */
.xoxo-page-block {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.xoxo-page-block:hover {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}
.xoxo-page-block-hero .xoxo-page-block-header {
    background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
    border-bottom: 1px solid #f9a8d4;
    padding: 20px 22px;
    display: flex;
    /* v5.3.18 - BUG 2 : centrage vertical du CTA (bouton Nouveau Puzzle) dans le hero rose */
    align-items: center;
    gap: 16px;
}
.xoxo-page-block-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #FF00AA;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(255, 0, 170, 0.35);
}
.xoxo-page-block-icon svg {
    display: block;
}
.xoxo-page-block-title-wrap {
    flex: 1;
    min-width: 0;
}
.xoxo-page-block-title {
    margin: 0 0 4px;
    font-size: 17px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.3;
    letter-spacing: -0.005em;
}
.xoxo-page-block-desc {
    margin: 0;
    font-size: 13px;
    color: #4b5563;
    line-height: 1.55;
}
.xoxo-page-block-cta {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    /* v5.3.18 - BUG 2 : auto-centrage vertical par rapport aux blocs icone/titre (plus haut ou plus bas) */
    align-self: center;
    gap: 8px;
}
.xoxo-page-block-body {
    padding: 18px 22px;
}
/* Mobile */
@media (max-width: 640px) {
    .xoxo-page-block-hero .xoxo-page-block-header {
        padding: 16px 14px;
        gap: 12px;
        flex-wrap: wrap;
    }
    .xoxo-page-block-icon {
        width: 38px;
        height: 38px;
    }
    .xoxo-page-block-icon svg {
        width: 18px;
        height: 18px;
    }
    .xoxo-page-block-title {
        font-size: 15px;
    }
    .xoxo-page-block-desc {
        font-size: 12.5px;
    }
    .xoxo-page-block-cta {
        width: 100%;
        margin-top: 8px;
    }
    .xoxo-page-block-cta .xoxo-btn {
        width: 100%;
    }
    .xoxo-page-block-body {
        padding: 14px 16px;
    }
}

/* =============================================================
   1. VARIABLES CSS - Palette XoXo + espacements + typo
   ============================================================= */
:root {
    --xoxo-pink: #FF00AA;
    --xoxo-pink-dark: #e60099;
    --xoxo-pink-light: #fdf2f8;
    --xoxo-pink-medium: #fce7f3;
    --xoxo-pink-accent: #f9a8d4;
    --xoxo-pink-text: #9d174d;
    
    --xoxo-text-primary: #1f2937;
    --xoxo-text-secondary: #4b5563;
    --xoxo-text-muted: #6b7280;
    --xoxo-text-dim: #9ca3af;
    
    --xoxo-border: #e5e7eb;
    --xoxo-border-light: #f3f4f6;
    --xoxo-bg-card: #ffffff;
    --xoxo-bg-soft: #f8fafc;
    
    --xoxo-radius-sm: 8px;
    --xoxo-radius-md: 12px;
    --xoxo-radius-lg: 16px;
    
    --xoxo-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --xoxo-shadow-md: 0 2px 12px rgba(0, 0, 0, 0.08);
    --xoxo-shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.12);
    --xoxo-shadow-pink: 0 3px 10px rgba(255, 0, 170, 0.35);
}

/* =============================================================
   2. CONTENEURS PRINCIPAUX - Harmonisation globale
   ============================================================= */
.xoxo-cards-collection,
.xoxo-cards-wishlist,
.xoxo-cards-my-cards,
.xoxo-cards-packs,
.xoxo-cards-puzzles,
.xoxo-cards-scanner,
.xoxo-cards-shop,
.xoxo-cards-points,
.xoxo-cards-podium,
.xoxo-cards-statistics {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 4px 40px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--xoxo-text-primary);
}

/* =============================================================
   3. HEADER DE PAGE - Bandeau titre + description (unifie)
   Cible : .xoxo-page-header OU les premiers <h3> de chaque page
   ============================================================= */
.xoxo-cards-collection > h2,
.xoxo-cards-collection > h3,
.xoxo-cards-wishlist .xoxo-wishlist-header h3,
.xoxo-cards-my-cards > h3,
.xoxo-cards-packs > h3,
.xoxo-cards-puzzles > h3,
.xoxo-cards-shop > h3,
.xoxo-cards-podium > h3,
.xoxo-cards-statistics > h3 {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 800;
    color: var(--xoxo-text-primary);
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.xoxo-cards-collection > p.xoxo-subtitle,
.xoxo-cards-wishlist > p.xoxo-subtitle,
.xoxo-cards-my-cards > p.xoxo-subtitle,
.xoxo-cards-packs > p.xoxo-subtitle,
.xoxo-cards-puzzles > p.xoxo-subtitle,
.xoxo-cards-podium > p.xoxo-subtitle,
.xoxo-cards-statistics > p.xoxo-subtitle,
.xoxo-cards-shop > p.xoxo-subtitle,
.xoxo-cards-points > p.xoxo-subtitle,
.xoxo-cards-scanner .xoxo-subtitle {
    margin: 0 0 20px;
    font-size: 14px;
    color: var(--xoxo-text-secondary);
    line-height: 1.5;
}

/* =============================================================
   4. BOX "CARDS" - Applique aux sections secondaires de chaque page
   (compteurs, filtres, blocs actions, stats, etc.)
   ============================================================= */

/* Compteurs statistiques (ex: cards-stats, wishlist-stats, puzzle-stats, etc.) */
.xoxo-cards-collection .xoxo-collection-stats,
.xoxo-cards-wishlist .xoxo-wishlist-stats,
.xoxo-cards-my-cards .xoxo-my-cards-stats,
.xoxo-cards-puzzles .xoxo-puzzles-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.xoxo-cards-collection .xoxo-collection-stats > *,
.xoxo-cards-wishlist .xoxo-wishlist-stats > *,
.xoxo-cards-my-cards .xoxo-my-cards-stats > *,
.xoxo-cards-puzzles .xoxo-puzzles-stats > * {
    background: var(--xoxo-bg-card);
    border: 1px solid var(--xoxo-border);
    border-radius: var(--xoxo-radius-md);
    padding: 16px 18px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.xoxo-cards-collection .xoxo-collection-stats > *:hover,
.xoxo-cards-wishlist .xoxo-wishlist-stats > *:hover,
.xoxo-cards-my-cards .xoxo-my-cards-stats > *:hover,
.xoxo-cards-puzzles .xoxo-puzzles-stats > *:hover {
    border-color: var(--xoxo-pink-accent);
    box-shadow: var(--xoxo-shadow-md);
}

/* =============================================================
   5. CAGNOTTE (Points) - Gradient rose accentue
   ============================================================= */
.xoxo-points-balance,
.xoxo-cards-points .xoxo-points-balance,
.xoxo-cards-packs .xoxo-points-balance {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 24px 28px;
    margin: 0 0 24px;
    background: linear-gradient(135deg, var(--xoxo-pink) 0%, var(--xoxo-pink-dark) 100%);
    border-radius: var(--xoxo-radius-lg);
    color: #ffffff;
    box-shadow: var(--xoxo-shadow-pink);
}

.xoxo-points-balance .xoxo-balance-label {
    font-size: 15px;
    font-weight: 600;
    opacity: 0.95;
    letter-spacing: 0.01em;
}

.xoxo-points-balance .xoxo-balance-value {
    font-size: 32px;
    font-weight: 800;
    line-height: 1;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.xoxo-points-balance .xoxo-balance-unit {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.9;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* =============================================================
   6. SCANNER QR - Hero centre epure
   ============================================================= */
.xoxo-cards-scanner .xoxo-scanner-hero {
    background: linear-gradient(135deg, var(--xoxo-pink-light) 0%, var(--xoxo-pink-medium) 100%);
    border: 1px solid var(--xoxo-pink-accent);
    border-radius: var(--xoxo-radius-lg);
    padding: 32px 24px;
    text-align: center;
    margin-bottom: 24px;
}

.xoxo-cards-scanner .xoxo-scanner-hero h3 {
    margin: 12px 0 8px;
    font-size: 20px;
    font-weight: 800;
    color: var(--xoxo-text-primary);
}

.xoxo-cards-scanner .xoxo-scanner-hero .xoxo-subtitle {
    margin: 0 auto 0;
    max-width: 480px;
    font-size: 14px;
    color: var(--xoxo-text-secondary);
    line-height: 1.55;
}

.xoxo-cards-scanner .xoxo-scanner-icon {
    font-size: 42px;
    line-height: 1;
    display: inline-block;
    padding: 14px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: var(--xoxo-shadow-md);
}

/* =============================================================
   7. PODIUM - Classement stylise
   ============================================================= */
.xoxo-cards-podium .xoxo-podium-section,
.xoxo-cards-podium .xoxo-podium-filters,
.xoxo-cards-podium .xoxo-leaderboard-container {
    background: var(--xoxo-bg-card);
    border: 1px solid var(--xoxo-border);
    border-radius: var(--xoxo-radius-md);
    padding: 20px 22px;
    margin-bottom: 16px;
    transition: box-shadow 0.2s ease;
}

.xoxo-cards-podium .xoxo-podium-section:hover,
.xoxo-cards-podium .xoxo-leaderboard-container:hover {
    box-shadow: var(--xoxo-shadow-md);
}

.xoxo-cards-podium h3,
.xoxo-cards-podium h4 {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 700;
    color: var(--xoxo-text-primary);
}

/* =============================================================
   8. STATISTIQUES - Grille de tuiles
   ============================================================= */
.xoxo-cards-statistics .xoxo-stats-grid,
.xoxo-cards-statistics .xoxo-stats-section {
    background: var(--xoxo-bg-card);
    border: 1px solid var(--xoxo-border);
    border-radius: var(--xoxo-radius-md);
    padding: 20px 22px;
    margin-bottom: 16px;
}

.xoxo-cards-statistics .xoxo-stats-tile {
    background: var(--xoxo-bg-soft);
    border-radius: var(--xoxo-radius-sm);
    padding: 14px 16px;
    transition: background 0.15s ease, transform 0.15s ease;
}

.xoxo-cards-statistics .xoxo-stats-tile:hover {
    background: var(--xoxo-pink-light);
    transform: translateY(-1px);
}

.xoxo-cards-statistics .xoxo-stats-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--xoxo-pink);
    line-height: 1.1;
}

.xoxo-cards-statistics .xoxo-stats-label {
    font-size: 12px;
    color: var(--xoxo-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    margin-top: 4px;
}

/* =============================================================
   9. BOUTIQUE / PACKS - Grille produits coherente
   ============================================================= */
.xoxo-cards-shop .xoxo-shop-grid,
.xoxo-cards-packs .xoxo-packs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 8px;
}

.xoxo-cards-shop .xoxo-shop-item,
.xoxo-cards-packs .xoxo-pack-card {
    background: var(--xoxo-bg-card);
    border: 1px solid var(--xoxo-border);
    border-radius: var(--xoxo-radius-md);
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.xoxo-cards-shop .xoxo-shop-item:hover,
.xoxo-cards-packs .xoxo-pack-card:hover {
    border-color: var(--xoxo-pink-accent);
    box-shadow: var(--xoxo-shadow-lg);
    transform: translateY(-2px);
}

/* =============================================================
   10. PUZZLES - Coherence avec collection
   ============================================================= */
.xoxo-cards-puzzles .xoxo-puzzle-item,
.xoxo-cards-puzzles .xoxo-puzzle-card {
    background: var(--xoxo-bg-card);
    border: 1px solid var(--xoxo-border);
    border-radius: var(--xoxo-radius-md);
    overflow: hidden;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.xoxo-cards-puzzles .xoxo-puzzle-item:hover,
.xoxo-cards-puzzles .xoxo-puzzle-card:hover {
    border-color: var(--xoxo-pink-accent);
    box-shadow: var(--xoxo-shadow-md);
}

/* =============================================================
   11. MES CARTES / ALBUM - Coherence
   ============================================================= */
.xoxo-cards-my-cards .xoxo-my-cards-filters,
.xoxo-cards-my-cards .xoxo-my-cards-actions,
.xoxo-cards-collection .xoxo-collection-filters,
.xoxo-cards-collection .xoxo-album-filters {
    background: var(--xoxo-bg-card);
    border: 1px solid var(--xoxo-border);
    border-radius: var(--xoxo-radius-md);
    padding: 14px 16px;
    margin-bottom: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

/* =============================================================
   12. BOUTONS - Harmonisation si non deja stylises
   ============================================================= */
.xoxo-btn.xoxo-btn-primary:not([disabled]) {
    background: var(--xoxo-pink);
    border-color: var(--xoxo-pink);
    color: #ffffff;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.xoxo-btn.xoxo-btn-primary:not([disabled]):hover {
    background: var(--xoxo-pink-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 0, 170, 0.35);
}

.xoxo-btn.xoxo-btn-outline {
    background: transparent;
    border: 1px solid var(--xoxo-border);
    color: var(--xoxo-text-secondary);
    font-weight: 500;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.xoxo-btn.xoxo-btn-outline:hover {
    border-color: var(--xoxo-pink);
    color: var(--xoxo-pink);
    background: var(--xoxo-pink-light);
}

/* =============================================================
   13. EMPTY STATE - Harmonisation
   ============================================================= */
.xoxo-empty-state {
    text-align: center;
    padding: 40px 24px;
    background: var(--xoxo-bg-soft);
    border: 1px dashed var(--xoxo-border);
    border-radius: var(--xoxo-radius-md);
    color: var(--xoxo-text-muted);
}

.xoxo-empty-state p {
    margin: 0;
    font-size: 14px;
    color: var(--xoxo-text-muted);
}

/* =============================================================
   14. ONGLETS (tabs - ex: echanges - SANS toucher au propose)
   ============================================================= */
.xoxo-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 2px solid var(--xoxo-border);
    margin-bottom: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.xoxo-tabs .xoxo-tab {
    flex-shrink: 0;
    padding: 10px 18px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    color: var(--xoxo-text-muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.xoxo-tabs .xoxo-tab:hover:not(.active) {
    color: var(--xoxo-pink);
}

.xoxo-tabs .xoxo-tab.active {
    color: var(--xoxo-pink);
    border-bottom-color: var(--xoxo-pink);
}

/* =============================================================
   15. LOADING - Spinner unifie (beaute et coherence)
   ============================================================= */
.xoxo-loading {
    text-align: center;
    padding: 32px 20px;
    color: var(--xoxo-text-muted);
    font-size: 14px;
}

.xoxo-loading::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 10px;
    vertical-align: -3px;
    border: 2px solid var(--xoxo-pink);
    border-top-color: transparent;
    border-radius: 50%;
    animation: xoxo-spin 0.65s linear infinite;
}

/* =============================================================
   16. RESPONSIVE MOBILE - Ajustements globaux
   ============================================================= */
@media (max-width: 640px) {
    .xoxo-cards-collection,
    .xoxo-cards-wishlist,
    .xoxo-cards-my-cards,
    .xoxo-cards-packs,
    .xoxo-cards-puzzles,
    .xoxo-cards-scanner,
    .xoxo-cards-shop,
    .xoxo-cards-points,
    .xoxo-cards-podium,
    .xoxo-cards-statistics {
        padding: 8px 2px 32px;
    }
    
    .xoxo-cards-collection > h2,
    .xoxo-cards-collection > h3,
    .xoxo-cards-wishlist .xoxo-wishlist-header h3,
    .xoxo-cards-my-cards > h3,
    .xoxo-cards-packs > h3,
    .xoxo-cards-puzzles > h3,
    .xoxo-cards-shop > h3,
    .xoxo-cards-podium > h3,
    .xoxo-cards-statistics > h3 {
        font-size: 19px;
    }
    
    .xoxo-points-balance {
        padding: 18px 20px;
        gap: 8px;
    }
    
    .xoxo-points-balance .xoxo-balance-value {
        font-size: 26px;
    }
    
    .xoxo-cards-scanner .xoxo-scanner-hero {
        padding: 24px 18px;
    }
}
