/* SIM PKK - internal web/PWA notifications V14
 * Desktop Web Premium Notification Panel
 * Fokus perubahan: tampilan, posisi dropdown, keterbacaan, dan responsivitas.
 * Alur/feed/push notification tidak diubah.
 */

.simpkk-notification-menu {
  position: relative !important;
}

.simpkk-notification-menu .nav-link {
  position: relative;
}

.simpkk-notification-badge {
  position: absolute;
  top: 3px;
  right: 0;
  z-index: 2;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff5b6f 0%, #e53955 100%);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  line-height: 15px;
  text-align: center;
  box-shadow: 0 5px 12px rgba(229, 57, 85, .28);
}

.simpkk-notification-badge[hidden] {
  display: none !important;
}

/* Panel dasar. Posisi desktop dikunci di media query agar Popper tidak
 * mendorong dropdown melewati sisi kanan viewport. */
.simpkk-notification-menu .dropdown-menu {
  width: min(430px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  padding: 0 !important;
  overflow: hidden;
  border: 1px solid rgba(15, 93, 154, .10) !important;
  border-radius: 20px !important;
  background: rgba(255, 255, 255, .99) !important;
  box-shadow:
    0 28px 70px rgba(15, 42, 70, .19),
    0 5px 18px rgba(15, 42, 70, .08) !important;
}

.simpkk-notification-menu .dropdown-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 72px;
  padding: 14px 16px 13px 18px !important;
  border-bottom: 1px solid rgba(15, 93, 154, .08);
  background:
    radial-gradient(circle at 84% 0%, rgba(52, 181, 228, .16), transparent 34%),
    linear-gradient(135deg, #f8fcff 0%, #ffffff 58%, #f4faff 100%);
  color: #17324d;
  letter-spacing: normal !important;
}

/* Ikon dekoratif header tanpa mengubah markup/alur. */
.simpkk-notification-menu .dropdown-header::before {
  content: "\f0f3";
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #0b73ba 0%, #16a3d8 100%);
  color: #fff;
  font-family: "Font Awesome 6 Free";
  font-size: 17px;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(11, 115, 186, .22);
}

.simpkk-notification-menu .dropdown-header > span {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display: block;
  padding-bottom: 15px;
  color: #17324d;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.simpkk-notification-menu .dropdown-header > span::after {
  content: "Aktivitas terbaru SIM PKK";
  position: absolute;
  left: 0;
  bottom: 0;
  color: #8292a4;
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: .01em;
}

.simpkk-notification-enable {
  flex: 0 0 auto;
  border: 1px solid rgba(11, 115, 186, .12);
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(11, 115, 186, .08);
  color: #0969aa;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}

.simpkk-notification-enable:hover,
.simpkk-notification-enable:focus {
  background: rgba(11, 115, 186, .13);
  box-shadow: 0 7px 16px rgba(11, 115, 186, .12);
  transform: translateY(-1px);
  outline: none;
}

.simpkk-notification-enable[hidden] {
  display: none !important;
}

#simpkk-notification-list {
  height: auto;
  max-height: min(455px, 62vh);
  padding: 8px 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  background: linear-gradient(180deg, #fbfdff 0%, #fff 20%, #fff 100%);
  scrollbar-width: thin;
  scrollbar-color: #cbd8e4 transparent;
}

#simpkk-notification-list::-webkit-scrollbar {
  width: 6px;
}

#simpkk-notification-list::-webkit-scrollbar-track {
  background: transparent;
}

#simpkk-notification-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #cbd8e4;
}

.simpkk-notification-item {
  position: relative;
  display: flex !important;
  align-items: flex-start;
  gap: 12px;
  width: auto !important;
  min-width: 0;
  margin: 4px 10px;
  padding: 12px 13px !important;
  border: 1px solid rgba(15, 93, 154, .075) !important;
  border-radius: 15px !important;
  white-space: normal !important;
  text-decoration: none !important;
  background: #fff !important;
  box-shadow: 0 3px 12px rgba(31, 65, 98, .035);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}

.simpkk-notification-item::before {
  content: "";
  position: absolute;
  top: 17px;
  right: 13px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16a3d8;
  box-shadow: 0 0 0 4px rgba(22, 163, 216, .10);
}

.simpkk-notification-item:last-child {
  border-bottom: 1px solid rgba(15, 93, 154, .075) !important;
}

.simpkk-notification-item:hover,
.simpkk-notification-item:focus,
.simpkk-notification-item:active {
  border-color: rgba(11, 115, 186, .18) !important;
  background: linear-gradient(135deg, #f8fcff 0%, #fff 100%) !important;
  box-shadow: 0 10px 24px rgba(28, 82, 124, .10);
  transform: translateY(-1px);
  text-decoration: none !important;
  outline: none;
}

.simpkk-notification-item .dropdown-item-icon {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  margin: 0 !important;
  border: 1px solid rgba(11, 115, 186, .08);
  border-radius: 13px !important;
  display: grid !important;
  place-items: center;
  background: linear-gradient(135deg, #e8f5ff 0%, #f2fbff 100%) !important;
  color: #0b73ba !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85);
}

.simpkk-notification-item .dropdown-item-icon i {
  margin: 0 !important;
  font-size: 15px;
}

.simpkk-notification-item .dropdown-item-desc {
  flex: 1 1 auto;
  min-width: 0;
  width: auto !important;
  margin-left: 0 !important;
  padding-right: 14px;
  line-height: 1.45 !important;
  color: #495c6d !important;
  white-space: normal !important;
  overflow: visible !important;
}

.simpkk-notification-title {
  display: block;
  margin: 0 0 5px;
  padding-right: 5px;
  color: #172b3f !important;
  font-size: 12px;
  font-weight: 800 !important;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.simpkk-notification-activity {
  display: block;
  margin: 6px 0 7px;
  padding: 7px 9px 7px 10px;
  border: 0;
  border-left: 3px solid #1b91cd;
  border-radius: 8px;
  background: linear-gradient(90deg, #edf7ff 0%, #f8fcff 100%);
}

.simpkk-notification-activity small {
  display: block;
  margin-bottom: 2px;
  color: #7f91a3;
  font-size: 8px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.simpkk-notification-activity strong {
  display: block;
  color: #235f8c;
  font-size: 10.5px;
  font-weight: 750;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.simpkk-notification-message {
  display: block;
  color: #5d6d7d;
  font-size: 10.5px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.simpkk-notification-item .time {
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
  margin-top: 7px !important;
  padding: 3px 7px;
  border-radius: 999px;
  background: #f3f6f9;
  color: #8391a0 !important;
  font-size: 8.5px !important;
  font-weight: 700 !important;
  line-height: 1.2;
  letter-spacing: .01em !important;
  text-transform: none !important;
}

.simpkk-notification-empty {
  min-height: 180px;
  padding: 46px 20px 38px;
  color: #7d8c9b;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.65;
}

.simpkk-notification-empty i {
  display: inline-grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 11px !important;
  border: 1px solid rgba(11, 115, 186, .10);
  border-radius: 18px;
  background: linear-gradient(135deg, #eaf6ff, #f7fcff);
  color: #58a4d4;
  font-size: 20px;
  box-shadow: 0 10px 25px rgba(41, 104, 147, .08);
}

.simpkk-notification-footer {
  position: relative;
  min-height: 44px;
  margin: 0 !important;
  padding: 12px 15px 12px 36px !important;
  border-top: 1px solid rgba(15, 93, 154, .08);
  color: #7d8b99;
  font-size: 9.5px;
  font-weight: 600 !important;
  line-height: 1.45;
  letter-spacing: 0 !important;
  text-align: left;
  background: #f9fbfd;
}

.simpkk-notification-footer::before {
  content: "\f05a";
  position: absolute;
  top: 13px;
  left: 16px;
  color: #2d91c8;
  font-family: "Font Awesome 6 Free";
  font-size: 12px;
  font-weight: 900;
}

/* ============================================================
   WEBSITE / DESKTOP
   Paksa posisi relatif ke tombol lonceng. Ini mengalahkan transform
   inline Popper yang sebelumnya dapat membuat panel keluar viewport.
   ============================================================ */
@media (min-width: 992px) {
  .simpkk-notification-menu .simpkk-notification-panel.dropdown-menu {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    right: 0 !important;
    bottom: auto !important;
    left: auto !important;
    width: 430px !important;
    max-width: min(430px, calc(100vw - 32px)) !important;
    margin: 0 !important;
    transform: none !important;
    will-change: auto !important;
    z-index: 1085 !important;
  }

  .simpkk-notification-menu .simpkk-notification-panel.dropdown-menu::before {
    content: "";
    position: absolute;
    top: -7px;
    right: 17px;
    width: 14px;
    height: 14px;
    border-top: 1px solid rgba(15, 93, 154, .10);
    border-left: 1px solid rgba(15, 93, 154, .10);
    background: #f9fdff;
    transform: rotate(45deg);
    z-index: 0;
  }

  .simpkk-notification-menu .simpkk-notification-panel.dropdown-menu > * {
    position: relative;
    z-index: 1;
  }
}

/* ============================================================
   TABLET / MOBILE / PWA
   Pertahankan pola fixed yang sudah stabil. Hanya menyesuaikan visual.
   ============================================================ */
@media (max-width: 991.98px) {
  .simpkk-notification-menu .nav-link {
    width: 42px;
    height: 42px;
    display: grid !important;
    place-items: center;
    padding: 0 !important;
  }

  .simpkk-notification-menu .dropdown-menu {
    position: fixed !important;
    top: 72px !important;
    right: 10px !important;
    left: auto !important;
    bottom: auto !important;
    transform: none !important;
    width: min(390px, calc(100vw - 20px)) !important;
    max-width: calc(100vw - 20px) !important;
    max-height: calc(100dvh - 92px) !important;
    margin: 0 !important;
    overflow: hidden !important;
    z-index: 1065 !important;
  }

  .simpkk-notification-menu .dropdown-header {
    min-height: 66px;
    padding: 11px 12px !important;
  }

  .simpkk-notification-menu .dropdown-header::before {
    flex-basis: 38px;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    font-size: 15px;
  }

  .simpkk-notification-menu .dropdown-header > span {
    font-size: 12.5px;
  }

  .simpkk-notification-menu .dropdown-header > span::after {
    font-size: 8.5px;
  }

  #simpkk-notification-list {
    max-height: calc(100dvh - 210px) !important;
    padding: 6px 0;
    overflow-y: auto !important;
    touch-action: pan-y !important;
  }

  .simpkk-notification-item {
    margin: 4px 7px;
    padding: 11px !important;
    gap: 10px;
  }

  .simpkk-notification-item .dropdown-item-icon {
    flex-basis: 38px;
    width: 38px;
    height: 38px;
    border-radius: 12px !important;
  }
}

@media (max-width: 380px) {
  .simpkk-notification-menu .dropdown-menu {
    right: 6px !important;
    width: calc(100vw - 12px) !important;
    max-width: calc(100vw - 12px) !important;
  }

  .simpkk-notification-enable {
    max-width: 104px;
    padding: 6px 8px;
    white-space: normal;
  }
}


/* v8.10 - status Web Push PWA selalu terbaca, tidak hilang diam-diam */
.simpkk-notification-enable.is-active {
  border-color: rgba(31, 139, 76, .22) !important;
  background: rgba(31, 139, 76, .12) !important;
  color: #18723f !important;
}
.simpkk-notification-enable.is-warning {
  border-color: rgba(225, 145, 24, .28) !important;
  background: rgba(255, 178, 44, .14) !important;
  color: #925400 !important;
}
.simpkk-notification-enable.is-error {
  border-color: rgba(197, 55, 55, .24) !important;
  background: rgba(210, 64, 64, .11) !important;
  color: #a92d2d !important;
}
html.nr-pwa-native .simpkk-notification-enable {
  max-width: none !important;
  min-height: 32px !important;
  padding: 7px 11px !important;
  white-space: nowrap !important;
  font-size: 9px !important;
}
