/* ========== NOTIFICATIONS PAGE ========== */

#page-notifications {
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* ── Header ── */
.notif-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  background: var(--bg-primary);
}

.notif-page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.4px;
}

.btn-clear-notif {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: transparent;
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: 20px;
  color: rgba(239,68,68,0.7);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
}
.btn-clear-notif:hover {
  background: rgba(239,68,68,0.1);
  color: #ef4444;
  border-color: rgba(239,68,68,0.5);
  transform: scale(1.02);
}
.btn-clear-notif:active { transform: scale(0.97); }

/* ── Scrollable list ── */
#notifications-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 12px 120px;
  -webkit-overflow-scrolling: touch;
}

/* ── Day label ── */
.notif-day-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 18px 4px 8px;
  position: sticky;
  top: 0;
  background: var(--bg-primary);
  z-index: 2;
}

/* ── Group ── */
.notif-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 4px;
  border-radius: 18px;
  overflow: hidden;
}

/* first and last card rounded corners to mimic iPhone grouping */
.notif-group .notif-card:first-child { border-radius: 18px 18px 6px 6px; }
.notif-group .notif-card:last-child  { border-radius: 6px 6px 18px 18px; }
.notif-group .notif-card:only-child  { border-radius: 18px; }

/* ========== NOTIFICATION CARD ========== */

.notif-card {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 14px;
  background: var(--bg-secondary);
  position: relative;
  overflow: hidden;
  transition: background 0.12s, transform 0.28s ease, opacity 0.2s ease;
  cursor: default;
  user-select: none;
}
.notif-card:active { background: var(--bg-elevated); }
.notif-card.notif-cashout { background: rgba(34,197,94,0.04); }
.notif-card.notif-burst   { background: rgba(239,68,68,0.04); }

/* Shimmer on enter */
@keyframes notifSlideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.notif-card { animation: notifSlideIn 0.22s ease both; }

/* ── Icon ── */
.notif-icon-wrap {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notif-icon-cashout {
  background: rgba(34,197,94,0.14);
  color: #22c55e;
  box-shadow: 0 0 0 1px rgba(34,197,94,0.18);
}
.notif-icon-burst {
  background: rgba(239,68,68,0.11);
  color: #ef4444;
  box-shadow: 0 0 0 1px rgba(239,68,68,0.16);
}
.notif-icon-info {
  background: rgba(99,102,241,0.11);
  color: #818cf8;
  box-shadow: 0 0 0 1px rgba(99,102,241,0.16);
}

/* ── Body ── */
.notif-body-wrap { flex: 1; min-width: 0; }

.notif-top-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}

.notif-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.1px;
}

.notif-time {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.notif-desc {
  font-size: 13px;
  color: var(--text-secondary);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.4;
}

/* ── Dismiss button ── */
.notif-dismiss {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.15s, background 0.15s, color 0.15s, transform 0.1s;
}
.notif-card:hover .notif-dismiss { opacity: 1; }
.notif-dismiss:hover {
  background: rgba(239,68,68,0.15);
  color: #ef4444;
}
.notif-dismiss:active { transform: scale(0.88); }

/* Touch devices — dismiss always fully visible */
@media (hover: none) {
  .notif-dismiss { opacity: 0.55; }
}

/* ── Unread accent bar ── */
.notif-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  opacity: 0;
  transition: opacity 0.2s;
}
.notif-card:not([data-read="true"])::before { opacity: 1; }
.notif-cashout::before { background: #22c55e; }
.notif-burst::before   { background: #ef4444; }
.notif-info::before    { background: #818cf8; }

/* ── Unread dot on title ── */
.notif-card:not([data-read="true"]) .notif-title::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}
.notif-card.notif-cashout:not([data-read="true"]) .notif-title::after { background: #22c55e; }
.notif-card.notif-burst:not([data-read="true"])   .notif-title::after { background: #ef4444; }

/* ========== EMPTY STATE ========== */

#notif-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px 24px 60px;
  gap: 14px;
  text-align: center;
}

.notif-empty-icon {
  width: 72px;
  height: 72px;
  border-radius: 24px;
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.notif-empty-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.notif-empty-sub {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 210px;
  line-height: 1.6;
}

/* ========== HEADER BADGE ========== */

.badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
  box-shadow: 0 0 0 2px var(--bg-primary);
}

#notifications-btn { position: relative; }
