:root {
  --notif-orange: #F58220;
  --notif-black: #0A0A0A;
  --notif-white: #FFFFFF;
  --notif-gray-50: #FAFAFA;
  --notif-gray-100: #F2F2F2;
  --notif-gray-200: #EAEAEA;
  --notif-gray-300: #D9D9D9;
  --notif-gray-600: #6B6B6B;
  --notif-gray-700: #4B4B4B;
  --notif-gray-900: #1A1A1A;
  --notif-success: #10b981;
  --notif-success-bg: #ecfdf5;
  --notif-success-light: #d1fae5;
  --notif-warning: #f59e0b;
  --notif-warning-bg: #fffbeb;
  --notif-warning-light: #fef3c7;
  --notif-error: #ef4444;
  --notif-error-bg: #fef2f2;
  --notif-error-light: #fee2e2;
  --notif-info: #3b82f6;
  --notif-info-bg: #eff6ff;
  --notif-info-light: #dbeafe;
  --notif-radius: 16px;
  --notif-radius-sm: 10px;
  --notif-shadow: 0 8px 32px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
  --notif-shadow-hover: 0 12px 40px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06);
}

/* ===== Container ===== */
.notifications-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
  width: 100%;
  pointer-events: none;
}

/* ===== Notification card ===== */
.notification {
  position: relative;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: var(--notif-radius);
  box-shadow: var(--notif-shadow);
  border: 1px solid rgba(255, 255, 255, 0.6);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  opacity: 0;
  transform: translateX(calc(100% + 20px));
  transition: transform 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275),
              opacity 0.35s ease,
              box-shadow 0.3s ease;
  pointer-events: auto;
  overflow: hidden;
  cursor: default;
  will-change: transform, opacity;
}

.notification:hover {
  box-shadow: var(--notif-shadow-hover);
}

.notification.show {
  opacity: 1;
  transform: translateX(0);
}

.notification.hide {
  opacity: 0;
  transform: translateX(calc(100% + 20px)) scale(0.95);
  transition: transform 0.35s cubic-bezier(0.6, -0.28, 0.735, 0.045),
              opacity 0.25s ease;
}

/* ===== Type accent (left stripe) ===== */
.notification::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  transition: background 0.3s ease;
}

.notification.success { background: rgba(236, 253, 245, 0.92); }
.notification.success::before { background: var(--notif-success); }

.notification.warning { background: rgba(255, 251, 235, 0.92); }
.notification.warning::before { background: var(--notif-warning); }

.notification.error { background: rgba(254, 242, 242, 0.92); }
.notification.error::before { background: var(--notif-error); }

.notification.info { background: rgba(239, 246, 255, 0.92); }
.notification.info::before { background: var(--notif-info); }

/* ===== Icon ===== */
.notification-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.notification.show .notification-icon {
  animation: notifIconPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.15s both;
}

.notification.success .notification-icon {
  background: var(--notif-success-light);
  color: var(--notif-success);
}
.notification.warning .notification-icon {
  background: var(--notif-warning-light);
  color: var(--notif-warning);
}
.notification.error .notification-icon {
  background: var(--notif-error-light);
  color: var(--notif-error);
}
.notification.info .notification-icon {
  background: var(--notif-info-light);
  color: var(--notif-info);
}

/* ===== Content ===== */
.notification-content {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}

.notification-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: var(--notif-gray-900);
  margin-bottom: 2px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.notification-message {
  font-family: 'Roboto', sans-serif;
  font-size: 12.5px;
  color: var(--notif-gray-600);
  line-height: 1.45;
  word-wrap: break-word;
}

/* ===== Duplicate badge ===== */
.notification-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--notif-white);
  margin-left: 6px;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.notification-badge.bump {
  animation: notifBadgeBump 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.notification.success .notification-badge { background: var(--notif-success); }
.notification.warning .notification-badge { background: var(--notif-warning); }
.notification.error .notification-badge { background: var(--notif-error); }
.notification.info .notification-badge { background: var(--notif-info); }

/* ===== Close button ===== */
.notification-close {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  color: var(--notif-gray-600);
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.2s ease;
  opacity: 0;
  margin-top: 1px;
}

.notification:hover .notification-close {
  opacity: 1;
}

.notification-close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--notif-black);
  transform: scale(1.1);
}

/* ===== Progress bar ===== */
.notification-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  transform-origin: left;
  transform: scaleX(1);
  border-radius: 0 0 var(--notif-radius) var(--notif-radius);
  opacity: 0.7;
}

.notification.success .notification-progress { background: var(--notif-success); }
.notification.warning .notification-progress { background: var(--notif-warning); }
.notification.error .notification-progress { background: var(--notif-error); }
.notification.info .notification-progress { background: var(--notif-info); }

/* ===== Actions ===== */
.notification-actions {
  margin-top: 10px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.notification-action {
  padding: 6px 14px;
  border: none;
  border-radius: var(--notif-radius-sm);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Montserrat', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.notification-action.primary {
  background: var(--notif-orange);
  color: white;
}
.notification-action.primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 130, 32, 0.3);
}

.notification-action.secondary {
  background: var(--notif-gray-100);
  color: var(--notif-gray-700);
}
.notification-action.secondary:hover {
  background: var(--notif-gray-200);
}

/* ===== Image ===== */
.notification.with-image { padding-left: 20px; }

.notification-image {
  position: absolute;
  left: 16px;
  top: 14px;
  width: 40px;
  height: 40px;
  border-radius: var(--notif-radius-sm);
  object-fit: cover;
  border: 2px solid var(--notif-white);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ===== Loading state ===== */
.notification.loading { overflow: hidden; }

.notification.loading::after {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
  animation: notifLoading 1.8s ease infinite;
}

/* ===== Mobile ===== */
.notifications-container.notifications-container--mobile {
  top: 0;
  right: 0;
  left: 0;
  padding: calc(10px + env(safe-area-inset-top, 0)) 10px 10px;
  max-width: none;
  width: 100%;
  gap: 8px;
  align-items: center;
}

.notifications-container.notifications-container--mobile .notification {
  width: min(100%, 400px);
  margin: 0;
  border-radius: var(--notif-radius);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.14);
  transform: translateY(calc(-100% - 16px));
}

.notifications-container.notifications-container--mobile .notification::before {
  left: 0; top: 0; bottom: 0; width: 4px;
  border-radius: var(--notif-radius) 0 0 var(--notif-radius);
}

.notifications-container.notifications-container--mobile .notification.show {
  transform: translateY(0);
}

.notifications-container.notifications-container--mobile .notification.hide {
  transform: translateY(calc(-100% - 16px)) scale(0.95);
}

.notifications-container.notifications-container--mobile .notification-close {
  opacity: 1;
}

@media (max-width: 768px) {
  .notifications-container:not(.notifications-container--mobile) {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }
  .notifications-container:not(.notifications-container--mobile) .notification {
    padding: 12px 14px;
  }
  .notification-title { font-size: 12.5px; }
  .notification-message { font-size: 12px; }
  .notification-actions { flex-direction: column; }
  .notification-action { width: 100%; text-align: center; }
}

@media (max-width: 480px) {
  .notifications-container:not(.notifications-container--mobile) {
    top: 6px; right: 6px; left: 6px;
  }
  .notifications-container:not(.notifications-container--mobile) .notification {
    padding: 10px 12px;
    gap: 10px;
  }
  .notification-icon { width: 26px; height: 26px; font-size: 13px; border-radius: 8px; }
  .notification-close { width: 22px; height: 22px; font-size: 14px; }
}

/* ===== Animations ===== */
@keyframes notifIconPop {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes notifBadgeBump {
  0% { transform: scale(1); }
  40% { transform: scale(1.35); }
  70% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

@keyframes notifLoading {
  0% { left: -100%; }
  100% { left: 100%; }
}

@keyframes notifShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

@keyframes notifPulse {
  0% { box-shadow: 0 0 0 0 rgba(245, 130, 32, 0.35); }
  70% { box-shadow: 0 0 0 10px rgba(245, 130, 32, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 130, 32, 0); }
}

.notification-shake { animation: notifShake 0.5s ease-in-out; }
.notification-pulse { animation: notifPulse 2s infinite; }
