/* ============================================
   Notifications — Bell + Panel
   TrueVideo Notification System
   ============================================ */

/* --- Bell Badge --- */
.notif-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
  animation: notifBadgePulse 2s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
  border: 2px solid #0a0a0a;
  transform: translate(25%, -25%);
}

@keyframes notifBadgePulse {
  0%, 100% { box-shadow: 0 0 6px rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 14px rgba(239, 68, 68, 0.7); }
}

.notification-bell-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.notification-bell-wrapper button {
  overflow: visible;
}

/* --- Panel --- */
.notif-panel {
  position: fixed;
  top: 70px;
  right: 20px;
  width: 400px;
  max-height: 520px;
  background: rgba(18, 18, 18, 0.97);
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(-8px) scale(0.97);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}

.notif-panel.active {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

/* --- Panel Header --- */
.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.notif-panel-title {
  font-family: 'Sora', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.notif-read-all {
  background: none;
  border: none;
  color: #22c55e;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.notif-read-all:hover {
  background: rgba(34, 197, 94, 0.1);
}

/* --- Tabs --- */
.notif-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 16px 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.notif-tabs::-webkit-scrollbar {
  display: none;
}

.notif-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 28px;
  line-height: 1.2;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  flex-shrink: 0;
  outline: none;
}

.notif-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
}

.notif-tab:focus,
.notif-tab:focus-visible {
  outline: none;
}

.notif-tab.active {
  background: linear-gradient(135deg, #22c55e, #fbbf24);
  color: #000;
  border-color: transparent;
  font-weight: 700;
}

/* --- List --- */
.notif-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.notif-list::-webkit-scrollbar {
  width: 4px;
}

.notif-list::-webkit-scrollbar-track {
  background: transparent;
}

.notif-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

/* --- Notification Item --- */
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
  position: relative;
}

.notif-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.notif-item.unread {
  background: rgba(34, 197, 94, 0.04);
  border-left: 3px solid;
  border-image: linear-gradient(180deg, #22c55e, #fbbf24) 1;
}

.notif-item.unread:hover {
  background: rgba(34, 197, 94, 0.08);
}

.notif-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.5);
}

.notif-item.unread .notif-item-icon {
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
}

.notif-item-body {
  flex: 1;
  min-width: 0;
}

.notif-item-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 2px;
}

.notif-item-message {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.notif-item-time {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.3);
  margin-top: 4px;
}

.notif-item-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  flex-shrink: 0;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notif-item-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
}

/* --- Empty State --- */
.notif-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.85rem;
  text-align: center;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
  .notif-panel {
    top: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
    transform: translateY(-100%);
  }

  .notif-panel.active {
    transform: translateY(0);
  }

  .notif-panel-header {
    padding: 14px 16px 10px;
  }

  .notif-tabs {
    padding: 8px 12px 6px;
  }

  .notif-list {
    padding: 6px;
  }

  .notif-item {
    padding: 10px;
  }
}

@media (max-width: 480px) {
  .notif-badge {
    min-width: 16px;
    height: 16px;
    font-size: 0.6rem;
    top: -3px;
    right: -3px;
  }
}

/* ============================================
   Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .notif-panel {
    transition: none;
  }

  .notif-badge {
    animation: none;
  }
}
