/* ═══════════════════════════════════════════════════════════════════
   Notification Center — KOR UshuaiaHub
   Bell widget, dropdown panel, toast notifications
   ═══════════════════════════════════════════════════════════════════ */

/* ── Bell Button ──────────────────────────────────────────────── */
.notif-bell-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}

.notif-bell-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  transform: scale(1.08);
}

[data-theme="dark"] .notif-bell-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.notif-bell-btn.has-unread svg {
  animation: bellShake 0.5s ease-in-out;
}

@keyframes bellShake {
  0%, 100% { transform: rotate(0); }
  15% { transform: rotate(12deg); }
  30% { transform: rotate(-10deg); }
  45% { transform: rotate(8deg); }
  60% { transform: rotate(-6deg); }
  75% { transform: rotate(3deg); }
}

/* ── Badge ────────────────────────────────────────────────────── */
.notif-badge {
  position: absolute;
  top: 2px;
  right: 0;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 99px;
  background: #ef4444;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  pointer-events: none;
  animation: badgePop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 1px 3px rgba(239, 68, 68, 0.4);
}

@keyframes badgePop {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

/* ── Panel ────────────────────────────────────────────────────── */
.notif-panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 380px;
  max-width: 95vw;
  height: 100vh;
  background: var(--surface, #fff);
  border-left: 1px solid var(--border, #e5e7eb);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  transition: right 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  overflow: hidden;
}

.notif-panel.is-open {
  right: 0;
}

/* Backdrop */
.notif-panel.is-open::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.2);
  z-index: -1;
  backdrop-filter: blur(2px);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  background: var(--surface, #fff);
}

.notif-panel-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.notif-panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notif-mark-all {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.notif-mark-all:hover {
  opacity: 0.85;
}

.notif-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.2s;
}

.notif-close:hover {
  background: rgba(0, 0, 0, 0.06);
}

/* ── Panel Body ───────────────────────────────────────────────── */
.notif-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.notif-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-muted);
  gap: 12px;
  opacity: 0.6;
}

.notif-empty p {
  margin: 0;
  font-size: 0.85rem;
}

/* ── Notification Item ────────────────────────────────────────── */
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 20px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border, #f3f4f6);
  position: relative;
}

.notif-item:hover {
  background: rgba(0, 0, 0, 0.025);
}

[data-theme="dark"] .notif-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.notif-item.is-unread {
  background: rgba(59, 130, 246, 0.04);
}

.notif-item.is-unread:hover {
  background: rgba(59, 130, 246, 0.08);
}

.notif-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: currentColor;
  -webkit-background-clip: text;
  background-clip: text;
  opacity: 0.85;
}

.notif-icon svg {
  flex-shrink: 0;
}

.notif-content {
  flex: 1;
  min-width: 0;
}

.notif-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 2px;
}

.notif-body {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.notif-time {
  font-size: 0.68rem;
  color: var(--text-muted);
  opacity: 0.7;
}

.notif-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 4px;
}

/* ── Toast ────────────────────────────────────────────────────── */
.notif-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  max-width: 360px;
  z-index: 10001;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.4s ease;
}

.notif-toast.is-visible {
  transform: translateX(0);
  opacity: 1;
}

[data-theme="dark"] .notif-toast {
  background: #1e293b;
  border-color: #334155;
}

.notif-toast-icon {
  flex-shrink: 0;
  margin-top: 1px;
}

.notif-toast-content {
  flex: 1;
  min-width: 0;
}

.notif-toast-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.notif-toast-body {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 2px;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 640px) {
  .notif-panel {
    width: 100%;
    right: -100%;
  }

  .notif-toast {
    bottom: 16px;
    right: 16px;
    left: 16px;
    max-width: none;
  }
}
