/**
 * UNIVGA PWA — Notifications agenda (style WhatsApp / heads-up)
 */

#uvg-agenda-notif-stack {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top, 0px));
  left: 12px;
  right: 12px;
  z-index: 2147483000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 420px;
  margin: 0 auto;
}

.uvg-agenda-notif {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 14px 14px 12px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 18px;
  box-shadow: 0 12px 40px rgba(11, 79, 140, 0.22), 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(11, 79, 140, 0.1);
  transform: translateY(-120%);
  opacity: 0;
  animation: uvgNotifIn .45s cubic-bezier(.2, .9, .2, 1) forwards;
  touch-action: pan-y;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.uvg-agenda-notif.is-urgent {
  background: linear-gradient(135deg, #0B4F8C 0%, #1565C0 55%, #1E7A34 130%);
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
  box-shadow: 0 16px 48px rgba(11, 79, 140, 0.4);
}

.uvg-agenda-notif.is-leaving {
  animation: uvgNotifOut .35s ease forwards;
}

@keyframes uvgNotifIn {
  from { transform: translateY(-120%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

@keyframes uvgNotifOut {
  to { transform: translateY(-30px); opacity: 0; }
}

.uvg-agenda-notif__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0B4F8C, #1565C0);
  color: #fff;
  font-size: 1.15rem;
}

.uvg-agenda-notif.is-urgent .uvg-agenda-notif__icon {
  background: rgba(255, 255, 255, 0.2);
}

.uvg-agenda-notif__body {
  flex: 1;
  min-width: 0;
}

.uvg-agenda-notif__label {
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  opacity: .75;
  margin-bottom: 2px;
}

.uvg-agenda-notif__title {
  font-size: .95rem;
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 4px;
  color: #8B0000;
}

.uvg-agenda-notif__msg {
  font-size: .82rem;
  line-height: 1.35;
  opacity: .88;
  margin: 0;
}

.uvg-agenda-notif__meta {
  font-size: .75rem;
  opacity: .7;
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.uvg-agenda-notif__actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.uvg-agenda-notif__btn {
  border: none;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.uvg-agenda-notif__btn--join {
  background: #1E7A34;
  color: #fff;
}

.uvg-agenda-notif.is-urgent .uvg-agenda-notif__btn--join {
  background: #fff;
  color: #0B4F8C;
}

.uvg-agenda-notif__btn--snooze {
  background: rgba(11, 79, 140, 0.1);
  color: #0B4F8C;
}

.uvg-agenda-notif.is-urgent .uvg-agenda-notif__btn--snooze {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.uvg-agenda-notif__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 50%;
  color: inherit;
  opacity: .6;
  cursor: pointer;
  font-size: .85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.uvg-agenda-notif.is-urgent .uvg-agenda-notif__close {
  background: rgba(255, 255, 255, 0.15);
}

/* Plein écran « c'est l'heure » */
#uvg-agenda-notif-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 2147483001;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(11, 79, 140, 0.92);
  backdrop-filter: blur(8px);
}

#uvg-agenda-notif-fullscreen.is-open {
  display: flex;
  animation: uvgFullIn .35s ease;
}

@keyframes uvgFullIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.uvg-agenda-fullscreen-card {
  text-align: center;
  color: #fff;
  max-width: 340px;
  width: 100%;
}

.uvg-agenda-fullscreen-card .uvg-fs-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
  animation: uvgPulse 1.2s ease infinite;
}

@keyframes uvgPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.08); }
}

.uvg-agenda-fullscreen-card h2 {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 800;
  color: #8B0000;
}

.uvg-agenda-fullscreen-card p {
  margin: 0 0 24px;
  opacity: .9;
  font-size: 1rem;
}

.uvg-agenda-fullscreen-card .uvg-fs-join {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: #fff;
  color: #0B4F8C;
  border: none;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 800;
  text-decoration: none;
  margin-bottom: 12px;
}

.uvg-agenda-fullscreen-card .uvg-fs-dismiss {
  display: block;
  margin: 0 auto;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.75);
  font-size: .88rem;
  cursor: pointer;
  font-family: inherit;
}

/* Bandeau permission push */
#uvg-agenda-perm-banner {
  position: fixed;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  left: 12px;
  right: 12px;
  z-index: 2147482999;
  max-width: 420px;
  margin: 0 auto;
  padding: 14px 16px;
  background: #16263a;
  color: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  display: none;
  align-items: center;
  gap: 12px;
  animation: uvgNotifIn .4s ease forwards;
}

#uvg-agenda-perm-banner.is-visible {
  display: flex;
}

#uvg-agenda-perm-banner p {
  flex: 1;
  margin: 0;
  font-size: .82rem;
  line-height: 1.35;
}

#uvg-agenda-perm-banner button {
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

#uvg-agenda-perm-enable {
  background: #1E7A34;
  color: #fff;
}

#uvg-agenda-perm-later {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* Badge sur l'onglet Agenda */
.univga-pwa-bottomnav__item[data-tab="calendar"].has-agenda-alert::after {
  content: '';
  position: absolute;
  top: 4px;
  right: calc(50% - 18px);
  width: 9px;
  height: 9px;
  background: #e53935;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(229, 57, 53, 0.4);
}
