/* ===================================================
   PSG Notifications — Frontend Styles (Premium v3.3.5)
   =================================================== */

:root {
  --psg-primary: #6c63ff;
  --psg-primary-grad: linear-gradient(135deg, #6c63ff, #9c5bff);
  --psg-danger: #e74c3c;
  --psg-success: #22c55e;
  --psg-warning: #f59e0b;
  --psg-info: #3b82f6;
  --psg-text-dark: #1a1a2e;
  --psg-text-gray: #5e5e7e;
  --psg-glass: rgba(255, 255, 255, 0.95);
  --psg-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
}

/* ── Bell icon ──────────────────────────────────── */
#psg-notif-bell {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 99990;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--psg-primary-grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(108, 99, 255, 0.4);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#psg-notif-bell:hover {
  transform: translateY(-4px) scale(1.1);
  box-shadow: 0 12px 32px rgba(108, 99, 255, 0.5);
}

#psg-notif-bell svg {
  width: 26px;
  height: 26px;
}

#psg-notif-bell.psg-bell-ring svg {
  animation: psg-ring 0.6s ease-in-out infinite;
}

@keyframes psg-ring {
  0% { transform: rotate(0); }
  20% { transform: rotate(15deg); }
  40% { transform: rotate(-15deg); }
  60% { transform: rotate(10deg); }
  80% { transform: rotate(-10deg); }
  100% { transform: rotate(0); }
}

.psg-notif-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 22px;
  height: 22px;
  background: var(--psg-danger);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  animation: psg-pulse 2s infinite;
}

@keyframes psg-pulse {
  0% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(231, 76, 60, 0); }
  100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0); }
}

/* ── Overlay ────────────────────────────────────── */
#psg-notif-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 30, 0.4);
  backdrop-filter: blur(4px);
  z-index: 99991;
}

/* ── Drawer ─────────────────────────────────────── */
#psg-notif-drawer {
  position: fixed;
  top: 15px;
  right: -420px;
  width: 400px;
  max-width: 92vw;
  height: calc(100% - 30px);
  background: var(--psg-glass);
  backdrop-filter: blur(12px);
  box-shadow: -10px 0 50px rgba(0, 0, 0, 0.15);
  z-index: 99992;
  display: flex;
  flex-direction: column;
  transition: right 0.4s cubic-bezier(0.19, 1, 0.22, 1);
  border-radius: 24px;
  margin-right: 15px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

#psg-notif-drawer.psg-drawer-open {
  right: 0;
}

#psg-notif-drawer-header {
  padding: 24px 24px 20px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#psg-notif-drawer-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--psg-text-dark);
}

#psg-notif-drawer-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,0.05);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
}
#psg-notif-drawer-close:hover { background: rgba(0,0,0,0.1); transform: rotate(90deg); }

#psg-notif-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#psg-notif-list::-webkit-scrollbar { width: 4px; }
#psg-notif-list::-webkit-scrollbar-track { background: transparent; }
#psg-notif-list::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 10px; }

/* ── Notification Card ──────────────────────────── */
.psg-notif-card {
  background: #fff;
  border-radius: 18px;
  border: 1px solid rgba(0,0,0,0.04);
  box-shadow: 0 4px 15px rgba(0,0,0,0.03);
  overflow: hidden;
  transition: all 0.3s;
  animation: psg-slide-in 0.4s ease-out;
}
@keyframes psg-slide-in {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.psg-notif-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

.psg-notif-card-image img {
  width: 100%; max-height: 160px; object-fit: cover;
}

.psg-notif-card-body { padding: 18px; }

.psg-notif-type-badge {
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px;
  padding: 4px 10px; border-radius: 12px; margin-bottom: 10px; display: inline-block;
}
.psg-notif-card[data-type="info"] .psg-notif-type-badge { background: #eff6ff; color: #3b82f6; }
.psg-notif-card[data-type="offer"] .psg-notif-type-badge { background: #f0fdf4; color: #22c55e; }
.psg-notif-card[data-type="promo"] .psg-notif-type-badge { background: #fffbeb; color: #d97706; }
.psg-notif-card[data-type="warning"] .psg-notif-type-badge { background: #fff7ed; color: #f97316; }

.psg-notif-card-title {
  font-size: 16px; font-weight: 700; color: var(--psg-text-dark); margin: 0 0 8px; line-height: 1.3;
}
.psg-notif-card-text {
  font-size: 14px; color: var(--psg-text-gray); line-height: 1.5; margin-bottom: 15px;
}

.psg-notif-coupon {
  background: #f8f8ff; border: 1.5px dashed var(--psg-primary);
  border-radius: 12px; padding: 12px; display: flex; align-items: center; gap: 10px; margin-bottom: 15px;
}
.psg-coupon-code { font-family: 'Monaco', monospace; font-weight: 700; color: var(--psg-primary); flex: 1; }
.psg-copy-coupon {
  background: var(--psg-primary); color: #fff; border: none; padding: 6px 12px; border-radius: 8px;
  font-size: 12px; font-weight: 600; cursor: pointer; transition: 0.2s;
}
.psg-copy-coupon.psg-copied { background: var(--psg-success); }

.psg-notif-cta {
  width: 100%; background: var(--psg-primary-grad); color: #fff; border-radius: 12px;
  padding: 10px; text-align: center; font-weight: 700; text-decoration: none; display: block;
  transition: transform 0.2s; margin-bottom: 12px;
}
.psg-notif-cta:hover { color: #fff; transform: scale(1.02); }

.psg-card-from-other-style { border: 1px dashed #eee; opacity: 0.8; }

.psg-notif-dismiss {
  background: none; border: none; color: #bbb; font-size: 12px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; gap: 5px; transition: color 0.2s;
}
.psg-notif-dismiss:hover { color: var(--psg-danger); }

/* ── Modal (Pop-up style) ────────────────────────── */
#psg-notif-modal-root {
  position: fixed; inset: 0; pointer-events: none; z-index: 99998;
  display: flex; align-items: center; justify-content: center;
}
.psg-notif-modal {
  pointer-events: auto;
  width: min(500px, 90vw);
  background: #fff;
  border-radius: 28px;
  box-shadow: 0 30px 100px rgba(0,0,0,0.3);
  overflow: hidden;
  opacity: 0; transform: translateY(40px) scale(0.95);
  transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}
.psg-notif-modal.psg-modal-active {
  opacity: 1; transform: translateY(0) scale(1);
}

.psg-modal-close {
  position: absolute; top: 15px; right: 15px; width: 34px; height: 34px;
  background: rgba(255,255,255,0.8); backdrop-filter: blur(5px); border: none;
  border-radius: 50%; cursor: pointer; z-index: 10; font-size: 14px;
}

.psg-modal-image img { width: 100%; height: auto; display: block; }
.psg-modal-body { padding: 30px; text-align: center; }

.psg-modal-badge {
  background: #f0f0ff; color: var(--psg-primary); font-size: 11px; font-weight: 800;
  text-transform: uppercase; padding: 5px 12px; border-radius: 20px; margin-bottom: 15px; display: inline-block;
}
.psg-modal-title { font-size: 24px; font-weight: 800; color: var(--psg-text-dark); margin: 0 0 15px; line-height: 1.2; }
.psg-modal-text { font-size: 16px; color: var(--psg-text-gray); line-height: 1.6; margin-bottom: 25px; }

.psg-modal-coupon {
  background: #fdfdfd; border: 2px solid #eee; border-radius: 16px; padding: 15px;
  display: flex; flex-direction: column; gap: 10px; margin-bottom: 25px;
}
.psg-modal-coupon .psg-code { font-size: 20px; font-weight: 800; letter-spacing: 3px; color: var(--psg-primary); }
.psg-copy-btn {
  background: var(--psg-primary); color: #fff; border: none; border-radius: 10px;
  padding: 10px; font-weight: 700; cursor: pointer;
}
.psg-copy-btn.success { background: var(--psg-success); }

.psg-modal-cta {
  background: var(--psg-primary-grad); color: #fff; text-decoration: none;
  padding: 15px 30px; border-radius: 16px; font-weight: 800; display: block;
  font-size: 16px; transition: 0.3s;
}
.psg-modal-cta:hover { transform: scale(1.03); color: #fff; text-decoration: none; }

/* ── Sticky Bar ──────────────────────────────────── */
#psg-notif-sticky-root {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 99997; pointer-events: none;
}
.psg-sticky-bar {
  background: var(--psg-primary-grad); color: #fff;
  padding: 10px 20px; box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  pointer-events: auto; transform: translateY(-100%);
  transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}
.psg-sticky-bar.psg-sticky-active { transform: translateY(0); }
.psg-sticky-wrap {
  max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 20px;
}
.psg-sticky-badge { font-size: 20px; }
.psg-sticky-content { flex: 1; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.psg-sticky-body-text { opacity: 0.85; margin-left: 10px; font-weight: 400; }
.psg-sticky-cta {
  background: #fff; color: var(--psg-primary); padding: 6px 16px; border-radius: 20px;
  text-decoration: none; font-size: 13px; font-weight: 800; white-space: nowrap;
}
.psg-sticky-close { background: none; border: none; color: #fff; opacity: 0.6; cursor: pointer; font-size: 18px; }

/* ── Countdown Timer ────────────────────────────── */
.psg-countdown {
  display: flex; gap: 8px; justify-content: center; margin: 15px 0;
}
.psg-cd-item {
  background: rgba(0,0,0,0.04); padding: 8px 12px; border-radius: 10px;
  font-size: 11px; text-transform: uppercase; font-weight: 600; color: #888;
}
.psg-cd-item span {
  display: block; font-size: 18px; font-weight: 800; color: var(--psg-primary); line-height: 1;
}
.psg-countdown-compact { margin: 10px 0; transform: scale(0.9); transform-origin: left; gap: 4px; }
.psg-countdown-compact .psg-cd-item { padding: 4px 8px; background: transparent; border: 1px solid #eee; }
.psg-countdown-compact .psg-cd-item span { font-size: 14px; }

.psg-sticky-bar .psg-countdown { margin: 0; }
.psg-sticky-bar .psg-cd-item { background: rgba(255,255,255,0.15); color: #fff; padding: 2px 6px; }
.psg-sticky-bar .psg-cd-item span { color: #fff; font-size: 14px; }

/* ── Utils ──────────────────────────────────────── */
body.psg-drawer-open-lock { overflow: hidden; }

@media (max-width: 480px) {
  #psg-notif-bell { bottom: 20px; right: 20px; }
  #psg-notif-drawer { top: 0; right: -100%; width: 100%; height: 100%; margin: 0; border-radius: 0; }
}
