/* ══════════════════════════════════════════════════════════
   NOTIFICACIONES — Campana + panel desplegable en el navbar
   Incluir DESPUÉS de style_foro.css en foro.html, categoria.html
   y hilo.html:
   <link rel="stylesheet" href="css/style_notif.css">
   ══════════════════════════════════════════════════════════ */

/* ── CAMPANA DE NOTIFICACIONES ───────────────────────────── */
.nav-bell-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-left: 14px;
}

.nav-bell-btn {
  position: relative;
  height: 34px;
  padding: 0 16px;
  border-radius: 2px;
  background: rgba(196,95,255,0.06);
  border: 1px solid rgba(196,95,255,0.25);
  color: var(--text-muted);
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; cursor: pointer;
  font-family: 'Nunito Sans', sans-serif;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  white-space: nowrap;
}
.nav-bell-btn:hover { color: var(--accent); border-color: rgba(196,95,255,0.5); background: rgba(196,95,255,0.12); }

.nav-bell-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
}

.nav-bell-badge {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 17px; height: 17px;
  background: var(--vc-pink);
  color: #fff;
  font-size: 9px; font-weight: 800;
  border-radius: 9px;
  align-items: center; justify-content: center;
  border: 2px solid var(--bg);
  padding: 0 3px;
  pointer-events: none;
}

/* ── PANEL DE NOTIFICACIONES ─────────────────────────────── */
.notif-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: -8px;
  width: 340px;
  background: var(--bg-2);
  border: 1px solid rgba(196,95,255,0.2);
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  z-index: 400;
  border-radius: 4px;
  overflow: hidden;
}

.notif-panel::before {
  content: '';
  position: absolute;
  top: -6px; right: 16px;
  width: 10px; height: 10px;
  background: var(--bg-2);
  border-left: 1px solid rgba(196,95,255,0.2);
  border-top: 1px solid rgba(196,95,255,0.2);
  transform: rotate(45deg);
}

.notif-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.notif-panel-title {
  font-size: 11px; font-weight: 800;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text);
}

.notif-mark-all {
  font-size: 10px; font-weight: 600;
  color: var(--accent);
  background: transparent; border: none;
  cursor: pointer; font-family: 'Nunito Sans', sans-serif;
  transition: opacity 0.2s;
}
.notif-mark-all:hover { opacity: 0.7; }

.notif-list {
  max-height: 380px;
  overflow-y: auto;
}

.notif-loading {
  display: flex; justify-content: center; padding: 24px;
}
.notif-spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(196,95,255,0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: prfSpin 0.8s linear infinite;
}
@keyframes prfSpin { to { transform: rotate(360deg); } }

.notif-empty {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 32px 20px; text-align: center;
  color: var(--text-muted); font-size: 12px; font-weight: 500;
}
.notif-empty i { font-size: 24px; opacity: 0.25; }

.notif-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background 0.15s;
  position: relative;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg-3); }
.notif-item--unread { background: rgba(196,95,255,0.04); }

.notif-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--vc-purple), var(--vc-pink));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: #fff;
  overflow: hidden;
}
.notif-avatar img { width: 100%; height: 100%; object-fit: cover; }

.notif-body { flex: 1; min-width: 0; }

.notif-text {
  font-size: 12px; font-weight: 500; color: var(--text-dim);
  line-height: 1.5; margin-bottom: 4px;
}
.notif-text strong { color: var(--text); font-weight: 700; }

.notif-time {
  font-size: 10px; color: var(--text-muted); font-weight: 600;
  display: flex; align-items: center; gap: 5px;
}
.notif-time i { color: var(--accent); font-size: 9px; }

.notif-dot {
  position: absolute; top: 14px; right: 12px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--vc-pink);
}

.notif-actions {
  display: flex; gap: 16px; margin-top: 10px;
}
.notif-action-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 7px 16px; border-radius: 2px; border: none; cursor: pointer;
  font-family: 'Nunito Sans', sans-serif; transition: opacity 0.2s, transform 0.15s;
}
.notif-action-btn:hover { opacity: 0.85; transform: translateY(-1px); }
.notif-action-btn--accept { background: rgba(78,207,160,0.15); color: #4ecfa0; border: 1px solid rgba(78,207,160,0.35); }
.notif-action-btn--reject { background: rgba(255,79,163,0.1);  color: #ff4fa3; border: 1px solid rgba(255,79,163,0.3); }

/* ── MOBILE ───────────────────────────────────────────────── */
@media (max-width: 1024px) {
  /* Botón: solo icono, sin texto ni padding ancho, para que no
     empuje al resto de la navbar (RRSS + hamburguesa).
     OJO: sin margin-left:auto aquí — .nav-social ya lo lleva, y si
     los dos lo tienen a la vez el espacio libre se reparte entre
     ambos huecos y la campana queda flotando en medio de la navbar. */
  .nav-bell-wrap { margin-left: 14px; order: 9; }
  .nav-bell-btn {
    height: 32px;
    padding: 0 8px;
    gap: 0;
  }
  .nav-bell-label { display: none; }

  /* Panel: a pantalla casi completa, centrado, sin desbordar */
  .notif-panel {
    position: fixed;
    top: 75px;
    left: 8px;
    right: 8px;
    width: auto;
    max-width: none;
  }
  .notif-panel::before { display: none; }
}

/* ── PERFILES CLICABLES EN MENSAJES DEL HILO ─────────────── */
.thread-post-avatar:hover { opacity: 0.85; }
.thread-post-username:hover { color: var(--accent) !important; }

.meta-author:hover { color: var(--accent) !important; text-decoration: underline; }

.notif-more {
  text-align: center; padding: 10px 16px;
  font-size: 10px; font-weight: 700; color: var(--text-muted);
  border-top: 1px solid var(--border);
  letter-spacing: 0.02em;
}
.notif-more i { margin-right: 5px; opacity: 0.6; }

/* ── FILA TIEMPO + BOTÓN ELIMINAR (papelera compacta) ────── */
.notif-time-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.notif-del-btn {
  background: transparent; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 11px;
  padding: 3px 5px; border-radius: 2px;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.notif-del-btn:hover { color: #ff4fa3; background: rgba(255,79,163,0.08); }

/* ── BOTÓN "VER TU PERFIL" en el panel de usuario ────────── */
.user-action-btn.myprofile {
  background: rgba(80,160,255,0.10);
  border-color: rgba(80,160,255,0.35);
  color: #7090ff;
}
.user-action-btn.myprofile:hover {
  background: rgba(80,160,255,0.18);
}

/* ── AVATAR REAL EN NAVBAR / DRAWER / POPUP (con imagen) ──── */
.nav-user-avatar-small,
#drawer-avatar,
.user-avatar {
  overflow: hidden;
}
.nav-user-avatar-small img,
#drawer-avatar img,
.user-avatar img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block;
}