/* ──────────────────────────────────────────────────────────────
   Screen: Réglages (onglet bottom-nav Réglages)
   Extrait du mono-fichier index.html (J4). Regroupe la CSS de :
   - Récompenses (btn-add-reward, reward-row, reward-badge, btn-delete-reward)
   - Notifications (notif-*, btn-send)
   - Offres (btn-offer-type, offer-thumb, upload-zone, upload-placeholder, btn-remove-image)

   Note : .reward-badge est aussi utilisé sur la liste clients quand un client
   débloque une récompense. Il reste ici car conceptuellement lié aux récompenses.
   ────────────────────────────────────────────────────────────── */

/* ── Reward badge (pastille "récompense débloquée") ─────────── */

.reward-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, var(--green), #30D158);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  margin-top: 4px;
  line-height: 1.2;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reward-badge .icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

/* ── Notifications ──────────────────────────────────────────── */

.notif-templates {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.notif-tpl {
  padding: 6px 12px;
  background: var(--bg);
  border: 1.5px solid var(--separator);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  color: var(--primary);
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.notif-tpl:hover  { background: var(--separator); border-color: var(--blue); }
.notif-tpl.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.notif-phrases {
  display: none;
  flex-direction: column;
  gap: 6px;
  margin-top: 2px;
  padding: 10px;
  background: var(--bg);
  border-radius: 10px;
  border: 1.5px solid var(--separator);
}

.notif-phrases.open { display: flex; }

.notif-phrase-btn {
  text-align: left;
  background: var(--card);
  border: 1px solid var(--separator);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
  color: var(--primary);
  cursor: pointer;
  line-height: 1.4;
  transition: border-color 0.12s, background 0.12s;
}

.notif-phrase-btn:hover { border-color: var(--blue); background: #F0F7FF; }

.notif-form { display: flex; flex-direction: column; gap: 12px; }

/* Sélecteur de segment (Tous / Dormants / Actifs) au-dessus du textarea */
.notif-segment {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1.5px solid var(--separator);
  border-radius: 10px;
  padding: 8px 12px;
  /* Contient le select même si l'option la plus longue dépasse la largeur mobile */
  max-width: 100%;
  overflow: hidden;
}
.notif-segment-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  flex-shrink: 0;
}
.notif-segment select {
  flex: 1;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  color: var(--primary);
  font-weight: 500;
  cursor: pointer;
  outline: none;
  padding: 4px 18px 4px 0;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='1 1 5 5 9 1'/></svg>");
  background-repeat: no-repeat;
  background-position: right center;
  /* min-width:0 + text-overflow : autorise le select à shrink sous la largeur
     de sa plus longue option, avec ellipsis sur mobile étroit. Sans ces règles,
     Chrome Android prend min-width = contenu le + long → débordement à droite. */
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html.dark .notif-segment select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none' stroke='%239A9AA6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='1 1 5 5 9 1'/></svg>");
}
/* Options du <select> : par défaut rendues par l'OS/navigateur, indépendantes de var(--primary).
   Sans ces règles explicites, en dark mode Tampino + OS light, on a texte blanc sur fond blanc. */
.notif-segment select option {
  background: #FFFFFF;
  color: #0F0F14;
}
html.dark .notif-segment select option {
  background: #1C1C25;
  color: #F5F5F7;
}

.notif-form textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--separator);
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  resize: none;
  height: 90px;
  background: #FAFAFA;
  outline: none;
  transition: border-color 0.15s;
  color: var(--primary);
}

.notif-form textarea:focus {
  border-color: var(--blue);
  background: #fff;
}

.notif-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.notif-count {
  font-size: 13px;
  color: var(--secondary);
  flex-shrink: 0;
}

.btn-send {
  flex: 1;
  padding: 13px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s, transform 0.1s;
}

.btn-send:active  { opacity: 0.85; transform: scale(0.98); }
.btn-send:disabled{ opacity: 0.5;  cursor: default; transform: none; }

/* ── Récompenses (paliers points → cadeaux) ─────────────────── */

.btn-add-reward {
  background: none;
  border: 1.5px solid var(--separator);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--primary);
  font-family: inherit;
  transition: background 0.15s;
}

.btn-add-reward:hover { background: var(--bg); }

.reward-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--separator);
}

.reward-row:last-child { border-bottom: none; }

.reward-row-title { font-size: 15px; font-weight: 500; }

.reward-row-pts {
  font-size: 13px;
  color: var(--secondary);
  margin-top: 2px;
}

.btn-delete-reward {
  background: none;
  border: none;
  color: var(--red);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s;
  flex-shrink: 0;
}

.btn-delete-reward:hover { background: #FFF0EF; }

/* ── Offres (menu/prestations, images uploadées) ────────────── */

.btn-offer-type {
  flex: 1;
  padding: 9px;
  border: 1.5px solid var(--separator);
  border-radius: 10px;
  background: var(--card);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  color: var(--secondary);
  transition: all .15s;
}
.btn-offer-type.active {
  background: var(--text);
  color: var(--text-inverse);
  border-color: var(--text);
}

.offer-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: #F5F5F7;
  cursor: zoom-in;
}
.offer-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Lightbox : ouverture d'une image Menu/Prestation en grand.
   Aligné sur le pattern .sms-modal-backdrop (overlay fixe + .hidden). */
.offer-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
  cursor: zoom-out;
}
.offer-lightbox.hidden { display: none; }
.offer-lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
  cursor: default;
  /* Sans touch-action:none, Chrome Android intercepte le pinch comme gesture natif
     (zoom navigateur de toute la page) ET ne dispatche jamais touchstart à 2 doigts
     vers nos handlers → impossible d'implémenter notre pinch-to-zoom custom. */
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.offer-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .15);
  border: none;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}
.offer-lightbox-close:hover { background: rgba(255, 255, 255, .25); }

/* ── Teaser "Demander un site internet" ─────────────────────────────────
   Affiché sous l'input Site internet quand celui-ci est vide (toggle JS).
   Carte d'upsell discrète mais visible — bleu Tampino doux. */
.website-teaser {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(0, 122, 255, .07), rgba(0, 122, 255, .02));
  border: 1.5px solid rgba(0, 122, 255, .2);
  border-radius: 12px;
}
.website-teaser-icon {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: rgba(255, 255, 255, .7);
  border-radius: 10px;
}
.website-teaser-body { flex: 1; min-width: 0; }
.website-teaser-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  margin: 0 0 2px;
}
.website-teaser-sub {
  font-size: 12px;
  color: var(--secondary);
  margin: 0;
  line-height: 1.4;
}
.website-teaser-cta {
  flex: 0 0 auto;
  padding: 9px 14px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.website-teaser-cta:hover { opacity: .9; }

/* Mobile : empile pour ne pas tronquer le CTA */
@media (max-width: 520px) {
  .website-teaser { flex-wrap: wrap; }
  .website-teaser-cta { width: 100%; margin-top: 4px; }
}

.offer-thumb-del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  background: rgba(0,0,0,.55);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
}

.upload-zone {
  border: 2px dashed var(--separator);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
  overflow: hidden;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-zone:hover { border-color: var(--blue); background: #F0F7FF; }

.upload-zone img {
  width: 100%;
  max-height: 140px;
  object-fit: cover;
  border-radius: 8px;
}

.upload-placeholder { pointer-events: none; }
.upload-placeholder span  { font-size: 28px; display: block; margin-bottom: 6px; }
.upload-placeholder p     { font-size: 14px; color: var(--secondary); margin-bottom: 2px; }
.upload-placeholder small { font-size: 11px; color: #C7C7CC; }

.btn-remove-image {
  margin-top: 8px;
  background: none;
  border: none;
  color: var(--red);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 0;
  font-family: inherit;
}
