/* ============================================================================
 * Dashboard — page Notifications (web / tablette / mobile)
 * S'appuie sur mp-dashboard-orders.css pour les chips et le groupement par jour.
 * ========================================================================== */

.mp-notifs-page {
  /* hérite de .mp-orders-page pour layout/padding/max-width */
}

/* === Groupements par jour (today / yesterday / week / older) === */
.mp-notifs-groups {
  display: flex;
  flex-direction: column;
  gap: var(--mp-space-5);
}

.mp-notifs-group {
  display: flex;
  flex-direction: column;
  gap: var(--mp-space-2);
}

/* === Liste de notifications === */
.mp-notifs-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--mp-space-2);
}

/* === Card notification === */
.mp-notif-card {
  --notif-color: var(--mp-color-text-muted);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: var(--mp-space-3);
  padding: var(--mp-space-3);
  background: var(--mp-color-bg);
  border: 1px solid var(--mp-color-border-light);
  border-radius: var(--mp-radius-card);
  transition: border-color var(--mp-anim), box-shadow var(--mp-anim), background var(--mp-anim);
  position: relative;
}

@media (min-width: 640px) {
  .mp-notif-card { padding: var(--mp-space-4); gap: var(--mp-space-4); }
}

.mp-notif-card:hover {
  border-color: color-mix(in srgb, var(--notif-color) 40%, var(--mp-color-border));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* État non lu : fond légèrement teinté + barre latérale colorée */
.mp-notif-card.is-unread {
  background: color-mix(in srgb, var(--notif-color) 4%, var(--mp-color-bg));
}

.mp-notif-card.is-unread::before {
  content: "";
  position: absolute;
  left: 0;
  top: var(--mp-space-3);
  bottom: var(--mp-space-3);
  width: 3px;
  background: var(--notif-color);
  border-radius: 2px;
}

/* === Icône colorée selon type === */
.mp-notif-card__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--notif-color) 12%, transparent);
  color: var(--notif-color);
  flex-shrink: 0;
}

/* === Corps : titre + message + lien === */
.mp-notif-card__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mp-notif-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--mp-space-2);
  flex-wrap: wrap;
}

.mp-notif-card__title {
  font-size: var(--mp-fs-sm);
  font-weight: var(--mp-fw-semibold);
  color: var(--mp-color-text);
  margin: 0;
  line-height: 1.3;
  word-break: break-word;
}

@media (min-width: 640px) {
  .mp-notif-card__title { font-size: var(--mp-fs-base); }
}

.mp-notif-card__time {
  font-size: var(--mp-fs-xs);
  color: var(--mp-color-text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.mp-notif-card__msg {
  font-size: var(--mp-fs-sm);
  color: var(--mp-color-text-muted);
  margin: 0;
  line-height: 1.45;
  word-break: break-word;
}

.mp-notif-card__link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--mp-fs-xs);
  font-weight: var(--mp-fw-semibold);
  color: var(--notif-color);
  text-decoration: none;
  margin-top: 2px;
  align-self: flex-start;
  padding: 2px 0;
  transition: opacity var(--mp-anim);
}

.mp-notif-card__link:hover { opacity: 0.75; }

/* === Actions à droite : dot + bouton "marquer lu" === */
.mp-notif-card__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--mp-space-2);
  flex-shrink: 0;
}

.mp-notif-card__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--notif-color);
  margin-top: 4px;
}

.mp-notif-card__mark {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--mp-color-border);
  background: var(--mp-color-bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--mp-color-text-muted);
  cursor: pointer;
  transition: all var(--mp-anim);
}

.mp-notif-card__mark:hover {
  border-color: var(--notif-color);
  color: var(--notif-color);
  background: color-mix(in srgb, var(--notif-color) 10%, transparent);
}

/* === Mobile : compacter === */
@media (max-width: 639px) {
  .mp-notif-card { gap: var(--mp-space-2); padding: var(--mp-space-3); }
  .mp-notif-card__icon { width: 32px; height: 32px; border-radius: 8px; }
  .mp-notif-card__icon svg { width: 16px; height: 16px; }
  .mp-notif-card__head { gap: 4px; }
  .mp-notif-card__title { font-size: var(--mp-fs-sm); }
  .mp-notif-card__msg { font-size: var(--mp-fs-xs); }
  /* Le dot suffit à indiquer "non lu" sur mobile — bouton mark devient invisible
     mais reste accessible via le lien (ouverture de la commande marque comme lue) */
  .mp-notif-card__mark { width: 24px; height: 24px; }
}

/* === Animation marqué comme lu === */
.mp-notif-card.is-removing {
  opacity: 0.5;
  transform: translateX(8px);
  transition: opacity 0.2s, transform 0.2s;
}
