/*
 * Styles front-office du module lumarewards
 *
 * Compatible thème Classic PrestaShop 1.7 (Bootstrap 4).
 * Classes préfixées "rewards-" pour éviter les conflits avec le thème.
 */

/* ─── Widget dans /my-account ─────────────────────────────── */
.rewards-account-link {
    text-decoration: none;
}
.rewards-account-stats {
    display: block;
    font-size: 0.85em;
    color: #777;
    margin-top: 4px;
}

/* ─── Dashboard ────────────────────────────────────────────── */

/* Padding des conteneurs de pages (dashboard + inscription affilié). Sur
   PS 1.7/8 le thème le fournit via la classe Bootstrap 4 ".card-block" ;
   cette classe a été renommée ".card-body" en Bootstrap 5 (PS 9), donc le
   padding disparaissait. On le pose nous-mêmes pour un rendu identique sur
   les trois versions, sans dépendre du thème. */
#rewards-dashboard,
#rewards-register {
    padding: 1.5rem;
}

/* Messages flash : aligne verticalement l'icône Material avec le texte.
   Sans flexbox, l'icône (24px) déborde par rapport au texte. */
.rewards-flash {
    display: flex;
    align-items: center;
    gap: 8px;
}
.rewards-flash .material-icons {
    flex-shrink: 0; /* l'icône garde sa taille même si le texte est long */
}

#rewards-dashboard .nav-tabs {
    margin-bottom: 25px;
    border-bottom: 2px solid #e9ecef;
}
#rewards-dashboard .nav-tabs .nav-link {
    color: #555;
    border: none;
    padding: 12px 20px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}
#rewards-dashboard .nav-tabs .nav-link.active {
    color: #2fb5d2;
    border-bottom: 2px solid #2fb5d2;
    background: transparent;
}
#rewards-dashboard .nav-tabs .nav-link .material-icons {
    font-size: 20px;
}
#rewards-dashboard .nav-tabs .badge {
    margin-left: 6px;
}

/* Affichage des panneaux d'onglets piloté par le module (classe .active),
   indépendamment de la version de Bootstrap du thème (BS4 sur PS 1.7.8/8,
   BS5 sur PS 9). Évite qu'un panneau reste masqué ou ne s'affiche pas. */
#rewards-dashboard .tab-content > .tab-pane {
    display: none;
}
#rewards-dashboard .tab-content > .tab-pane.active {
    display: block;
    opacity: 1;
}

/* ─── Cartes de statistiques ──────────────────────────────── */
.rewards-stats {
    margin-bottom: 30px;
}
.rewards-stats .stat-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    margin-bottom: 15px;
    border-left: 4px solid #2fb5d2;
}
.rewards-stats .stat-value {
    font-size: 2em;
    font-weight: 700;
    color: #232323;
    line-height: 1.1;
}
.rewards-stats .stat-label {
    font-size: 0.9em;
    color: #777;
    margin-top: 5px;
}

/* ─── Bloc de conversion / partage ────────────────────────── */
.rewards-convert,
.rewards-share {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}
.rewards-share-input {
    max-width: 600px;
}
.rewards-share-input input {
    font-family: monospace;
    font-size: 1.1em;
}
.rewards-share-buttons {
    margin-top: 15px;
}
.rewards-share-buttons .btn {
    /* inline-flex + align-items pour centrer verticalement l'icône et le
       texte : sur le thème 1.7 les .btn ne sont pas en flex, l'icône Material
       (plus haute que le texte) se désaligne sinon. OK sur 8/9 (déjà en flex). */
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-right: 8px;
    margin-bottom: 8px;
}

/* ─── Tableaux ─────────────────────────────────────────────── */
.rewards-movements .rewards-points-gain {
    color: #28a745;
}
.rewards-movements .rewards-points-loss {
    color: #dc3545;
}

/* ─── Onglet Affiliation : CTA ────────────────────────────── */
.rewards-affiliate-cta {
    padding: 40px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    margin: 20px 0;
}
.rewards-affiliate-cta h2 {
    color: #232323;
    margin-bottom: 15px;
}
.rewards-affiliate-cta .lead {
    color: #555;
    max-width: 600px;
    margin: 0 auto 25px;
}
/* Centrage du bouton CTA indépendamment du thème : sur PS 8 le centrage par
   .text-center (text-align) n'agit pas sur ce bouton. On le passe donc en
   bloc rétréci à son contenu et on le centre par ses marges auto — ce qui
   ne dépend plus du text-align du parent. Identique sur PS 1.7 / 8 / 9. */
#rewards-dashboard .rewards-affiliate-cta .btn {
    display: block;
    width: -moz-fit-content;
    width: fit-content;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}
.rewards-affiliate-perks {
    list-style: none;
    padding: 0;
    max-width: 500px;
    margin: 0 auto 30px;
    text-align: left;
}
.rewards-affiliate-perks li {
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.rewards-affiliate-perks .material-icons {
    color: #28a745;
    font-size: 22px;
}

/* ─── Page d'inscription affilié ──────────────────────────── */
.rewards-register-intro {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
}
.rewards-register-features {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 20px 0 0;
}
.rewards-register-features li {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #555;
}
.rewards-register-features .material-icons {
    color: #2fb5d2;
}
.rewards-register-form .form-group {
    margin-bottom: 20px;
}
.rewards-register-form label {
    font-weight: 500;
}
.rewards-submit {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

/* ─── Tier VIP fidélité (v1.2.0 — table-driven, multi-tiers) ─── */
.rewards-tier-card {
    background: #fff;
    border: 2px solid #ccc;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
}
.rewards-tier-header {
    color: #fff;
    padding: 20px 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.rewards-tier-icon-big {
    font-size: 56px;
    line-height: 1;
}
.rewards-tier-label {
    font-size: 0.85em;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.rewards-tier-title h3 {
    margin: 4px 0;
    font-size: 1.8em;
    color: #fff;
}
.rewards-tier-multiplier {
    font-size: 1em;
    background: rgba(255,255,255,0.2);
    padding: 4px 10px;
    border-radius: 4px;
    display: inline-block;
}
.rewards-tier-perks {
    display: flex;
    gap: 10px;
    padding: 12px 25px;
    background: #fff8e1;
    border-bottom: 1px solid #ffe082;
    align-items: center;
    font-size: 0.95em;
    color: #7c5e0a;
}

/* Progression vers tier suivant */
.rewards-tier-progress {
    padding: 18px 25px;
    background: #f8f9fa;
}
.rewards-tier-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.95em;
}
.rewards-tier-progress-bar {
    height: 12px;
    background: #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}
.rewards-tier-progress-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.6s ease-out;
}
.rewards-tier-max {
    padding: 18px 25px;
    background: #f8f9fa;
    text-align: center;
    color: #28a745;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Timeline horizontale des tiers */
.rewards-tier-timeline {
    display: flex;
    padding: 20px 15px;
    background: #fff;
    border-top: 1px solid #e9ecef;
    overflow-x: auto;
    gap: 6px;
}
.rewards-tier-step {
    flex: 1;
    min-width: 100px;
    text-align: center;
    padding: 12px 8px;
    border-radius: 8px;
    background: #f8f9fa;
    border: 2px solid transparent;
    opacity: 0.45;
    transition: all 0.2s;
    --tier-color: #ccc;
}
.rewards-tier-step.reached {
    opacity: 1;
    background: #fff;
    border-color: var(--tier-color);
}
.rewards-tier-step.current {
    box-shadow: 0 4px 14px rgba(0,0,0,0.1);
    transform: scale(1.05);
}
.rewards-tier-step-icon {
    font-size: 28px;
    line-height: 1;
    margin-bottom: 6px;
}
.rewards-tier-step-name {
    font-weight: 600;
    font-size: 0.95em;
    margin-bottom: 4px;
}
.rewards-tier-step-threshold {
    font-size: 0.8em;
    color: #777;
}
.rewards-tier-step-mult {
    font-size: 0.85em;
    color: #28a745;
    font-weight: 600;
    margin-top: 4px;
}

/* ─── MLM block (Phase 5) ─────────────────────────────────── */
.rewards-mlm-divider {
    margin: 40px 0 25px;
    border: 0;
    border-top: 1px dashed #ccc;
}
.rewards-mlm-block h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #6f42c1;
}
.rewards-mlm-block h3 .material-icons {
    font-size: 28px;
}
.stat-card.stat-mlm {
    border-left-color: #6f42c1;
}
.rewards-mlm-invite {
    background: #f5f3fa;
    border-left: 4px solid #6f42c1;
}
.rewards-sponsor-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.05em;
}
.rewards-sponsor-banner .material-icons {
    font-size: 28px;
    color: #28a745;
}

/* ─── P1 : Hooks de visibilité ────────────────────────────── */

/* Bloc fiche produit */
.rewards-product-block {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 6px;
    padding: 10px 14px;
    margin: 12px 0;
    font-size: 0.95em;
}
.rewards-product-block .badge {
    margin-left: 6px;
}
.rewards-product-link {
    margin-left: auto;
    font-weight: 500;
    white-space: nowrap;
}

/* Bloc panier */
.rewards-cart-block {
    display: flex;
    gap: 15px;
    background: #f0f8ff;
    border-left: 4px solid #2fb5d2;
    border-radius: 6px;
    padding: 15px 20px;
    margin: 20px 0;
}
.rewards-cart-block .rewards-cart-icon .material-icons {
    font-size: 36px;
    color: #2fb5d2;
}
.rewards-cart-block p {
    margin: 0;
    padding: 2px 0;
}

/* ─── Bloc pied de page : 3 cartes programmes ─────────────── */
/* Le thème Classic de PS 8 rend le hook displayFooter à l'intérieur d'une
   .row flex (avec les colonnes de liens), ce qui coince notre bloc sous une
   colonne. flex + clear le forcent à occuper sa propre ligne pleine largeur,
   quel que soit le contexte du thème (sans effet sur 1.7 / 9). */
.rewards-footer-section {
    width: 100%;
    flex: 0 0 100%;
    clear: both;
    box-sizing: border-box;
    background: #f7f7f9;
    border-top: 1px solid #e9ecef;
    padding: 40px 15px;
    margin-top: 30px;
}
/* Conteneur centré, largeur limitée sur grand écran */
.rewards-footer-inner {
    max-width: 1100px;
    margin: 0 auto;
}
.rewards-footer-title {
    text-align: center;
    margin: 0 0 28px;
    font-size: 1.4em;
    color: #232323;
}
/* Grille : 3 colonnes sur PC, 1 colonne sur mobile */
.rewards-footer-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}
/* Chaque carte : distincte, fond blanc, ombre */
.rewards-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 26px 22px;
    text-align: center;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.rewards-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.09);
}
.rewards-card-icon {
    margin-bottom: 10px;
}
.rewards-card-icon .material-icons {
    font-size: 46px;
}
.rewards-card h4 {
    font-size: 1.15em;
    color: #232323;
    margin: 0 0 12px;
}
.rewards-card p {
    color: #666;
    font-size: 0.93em;
    line-height: 1.5;
    flex-grow: 1; /* aligne les liens en bas même si textes inégaux */
    margin-bottom: 16px;
}
.rewards-card-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-weight: 600;
    color: #2fb5d2;
    text-decoration: none;
}
.rewards-card-link:hover {
    color: #1a8ca3;
    text-decoration: none;
}
.rewards-card-link .material-icons {
    font-size: 18px;
}

/* Responsive : 1 colonne empilée sur tablette/mobile */
@media (max-width: 767px) {
    .rewards-footer-cards {
        grid-template-columns: 1fr;
    }
}

/* Page landing publique */
.rewards-landing-hero {
    text-align: center;
    padding: 50px 20px 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    margin-bottom: 40px;
}
.rewards-landing-hero h1 {
    margin-bottom: 15px;
}
.rewards-landing-hero .lead {
    max-width: 700px;
    margin: 0 auto 25px;
    color: #555;
}
.rewards-landing-cta-top .btn {
    padding: 12px 30px;
}
.rewards-landing-programs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}
.rewards-program-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}
.rewards-program-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}
.rewards-program-card .program-icon {
    font-size: 48px;
    color: #2fb5d2;
    margin-bottom: 10px;
}
.rewards-program-card .program-icon .material-icons {
    font-size: 56px;
}
.rewards-program-card h2 {
    font-size: 1.4em;
    margin-bottom: 12px;
}
.rewards-program-card ul {
    list-style: none;
    padding: 0;
    text-align: left;
    margin: 20px 0;
}
.rewards-program-card ul li {
    padding: 6px 0;
    padding-left: 22px;
    position: relative;
}
.rewards-program-card ul li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: bold;
}
.rewards-program-affiliate {
    background: linear-gradient(135deg, #f5f3fa 0%, #fff 100%);
    border-color: #d4c9f2;
}
.rewards-landing-faq {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
}
.rewards-landing-faq h3 {
    margin-bottom: 20px;
}
.rewards-landing-faq details {
    margin-bottom: 12px;
    padding: 12px 16px;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
}
.rewards-landing-faq summary {
    font-weight: 500;
    cursor: pointer;
}
.rewards-landing-faq details[open] summary {
    margin-bottom: 8px;
}

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    #rewards-dashboard .nav-tabs .nav-link {
        padding: 10px 12px;
        font-size: 0.9em;
    }
    .rewards-stats .stat-value {
        font-size: 1.5em;
    }
    .rewards-share-buttons .btn {
        display: flex;
        justify-content: center;
        width: 100%;
        margin-right: 0;
    }
}
