/* Modern Notification Styles */
/* Override semua rule yang mungkin mengganggu - HARUS di atas */
.notification,
body > .notification,
html body > .notification,
body .notification,
html body .notification,
div.notification {
  /* POSISI - HARUS DI ATAS, BUKAN DI BAWAH */
  position: fixed !important;
  top: 20px !important;
  right: 20px !important;
  left: auto !important;
  bottom: auto !important;
  
  /* STYLING */
  background-color: #fff !important;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
  padding: 12px 16px !important;
  max-width: 400px;
  width: 100%;
  
  /* ANIMASI - transform hanya untuk slide, TIDAK mengubah posisi */
  transform: translateX(120%) !important;
  transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1) !important;
  
  /* LAYER - HARUS PALING ATAS */
  z-index: 999999 !important;
  
  /* LAYOUT */
  overflow: hidden;
  display: grid !important;
  grid-template-columns: 24px 1fr 24px !important;
  grid-template-areas: "icon content close" !important;
  gap: 12px;
  align-items: start;
  margin: 0 !important;
}

.notification.show {
  transform: translateX(0) !important;
  /* Pastikan posisi tetap di atas saat show */
  position: fixed !important;
  top: 20px !important;
  right: 20px !important;
  left: auto !important;
  bottom: auto !important;
}

/* Types */
.notification.success {
  border-left: 4px solid #28a745;
}

.notification.error {
  border-left: 4px solid #dc3545;
}

.notification.warning {
  border-left: 4px solid #ffc107;
}

.notification.info {
  border-left: 4px solid #17a2b8;
}

/* Icon */
.notification-icon {
  grid-area: icon;
  line-height: 1;
  margin-top: 3px;
}

.notification.success .notification-icon {
  color: #28a745;
}

.notification.error .notification-icon {
  color: #dc3545;
}

.notification.warning .notification-icon {
  color: #ffc107;
}

.notification.info .notification-icon {
  color: #17a2b8;
}

.notification-icon i {
  font-size: 18px;
  display: block;
}

/* Content */
.notification-content {
  grid-area: content;
  min-width: 0; /* Ensures text truncation works */
}

.notification-title {
  font-weight: 600;
  font-size: 15px;
  line-height: 1.4;
  margin: 0 0 2px;
  color: #212529;
}

.notification-message {
  font-size: 13px;
  line-height: 1.4;
  margin: 0;
  color: #6c757d;
  word-break: break-word;
}

/* Close button */
.notification-close {
  grid-area: close;
  background: none;
  border: none;
  color: #adb5bd;
  cursor: pointer;
  padding: 0;
  margin: 0;
  line-height: 1;
  margin-top: 3px;
}

.notification-close:hover {
  color: #495057;
}

.notification-close i {
  font-size: 14px;
  display: block;
}

/* Progress bar */
.notification-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background-color: #e9ecef;
}

.notification-progress::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  transform: translateX(-100%);
  animation: notification-progress 3s linear forwards;
}

.notification.success .notification-progress::after {
  background-color: #28a745;
}

.notification.error .notification-progress::after {
  background-color: #dc3545;
}

.notification.warning .notification-progress::after {
  background-color: #ffc107;
}

.notification.info .notification-progress::after {
  background-color: #17a2b8;
}

@keyframes notification-progress {
  to {
    transform: translateX(0);
  }
}

/* Responsive adjustments */
@media (max-width: 576px) {
  .notification {
    width: calc(100% - 32px) !important;
    max-width: none !important;
    right: 16px !important;
    left: auto !important;
    top: 20px !important;
    bottom: auto !important;
  }
}

/* Pastikan notifikasi selalu di atas semua elemen - override SEMUA rule */
body > .notification,
html body > .notification,
body .notification,
html body .notification,
div.notification,
.notification[class*="notification"] {
  position: fixed !important;
  top: 20px !important;
  right: 20px !important;
  left: auto !important;
  bottom: auto !important;
  z-index: 999999 !important;
  margin: 0 !important;
  padding: 12px 16px !important;
  /* JANGAN PERNAH di bawah */
  bottom: auto !important;
  /* JANGAN PERNAH di kiri */
  left: auto !important;
}

/* Override rule dari style.css yang mengatur body > * */
body > .notification {
  position: fixed !important;
  top: 20px !important;
  right: 20px !important;
  left: auto !important;
  bottom: auto !important;
}

/* Override untuk mobile - HARUS DI ATAS JUGA */
@media (max-width: 991px) {
  body > .notification,
  html body > .notification,
  body .notification,
  html body .notification,
  div.notification {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    left: auto !important;
    bottom: auto !important;
    z-index: 999999 !important;
  }
}

/* Override untuk semua ukuran layar */
@media (min-width: 0px) {
  .notification {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    left: auto !important;
    bottom: auto !important;
  }
} 