/* Contenedor principal */
.notifications-container {
  position: relative;
  display: inline-block;
}

/* Badge contador */
.notifications-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background-color: var(--accent);
  color: var(--txt-2);
  font-size: 10px;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  padding: 0 4px;
  pointer-events: none;
}

/* Dropdown */
.notifications-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 420px;
  max-height: 600px;
  background-color: var(--panel);
  border: 1px solid var(--borders);
  border-radius: var(--radius);
  overflow: hidden;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.notifications-dropdown[data-state="closed"] {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px) scale(0.96);
  pointer-events: none;
}

.notifications-dropdown[data-state="opening"] {
  animation: notificationOpen 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.notifications-dropdown[data-state="closing"] {
  animation: notificationClose 0.2s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes notificationOpen {
  from {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px) scale(0.96);
  }
  to {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
  }
}

@keyframes notificationClose {
  from {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px) scale(0.96);
  }
}

/* Header */
.notifications-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--borders);
}

.notifications-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--txt);
  margin: 0;
}

.notifications-mark-all-read {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notifications-mark-all-read:hover {
  background-color: var(--hover);
  color: var(--txt);
}

/* Tabs */
.notifications-tabs {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--borders);
}

.notifications-tab {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.notifications-tab:hover {
  background-color: var(--hover);
  color: var(--txt);
}

.notifications-tab-active {
  background-color: var(--panel-2);
  color: var(--txt);
}

.notifications-tab-count {
  background-color: var(--accent);
  color: var(--txt-2);
  font-size: 11px;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  padding: 0 5px;
}

/* Lista de notificaciones */
.notifications-list {
  overflow-y: auto;
  flex: 1;
  max-height: 440px;
}

.notifications-list::-webkit-scrollbar {
  width: 6px;
}

.notifications-list::-webkit-scrollbar-track {
  background: transparent;
}

.notifications-list::-webkit-scrollbar-thumb {
  background: var(--borders);
  border-radius: 3px;
}

.notifications-list::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* Item de notificación */
.notification-item {
  display: flex;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--borders);
  position: relative;
}

.notification-link {
  display: flex;
  gap: 12px;
  flex: 1;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  min-width: 0;
}

.notification-item:hover {
  background-color: var(--hover);
}

.notification-item-unread {
  background-color: var(--panel-2);
}

.notification-item-unread::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background-color: var(--accent);
}

/* Avatar */
.notification-avatar {
  position: relative;
  flex-shrink: 0;
}

.notification-avatar-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.notification-avatar-system {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--panel-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 18px;
}

.notification-type-icon {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  border: 2px solid var(--panel);
}

.notification-type-comment {
  background-color: #3b82f6;
  color: white;
}

.notification-type-like {
  background-color: #ef4444;
  color: white;
}

.notification-type-mention {
  background-color: #8b5cf6;
  color: white;
}

.notification-type-follow {
  background-color: #10b981;
  color: white;
}

.notification-type-share {
  background-color: #f59e0b;
  color: white;
}

/* Contenido */
.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-message {
  font-size: 14px;
  color: var(--txt);
  line-height: 1.4;
  margin-bottom: 6px;
}

.notification-user {
  font-weight: 600;
  color: var(--txt);
}

.notification-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.notification-time {
  display: inline-block;
}

.notification-category {
  display: inline-block;
}

.notification-category::before {
  content: '•';
  margin-right: 8px;
}

/* Botón de acciones */
.notification-actions-trigger {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  flex-shrink: 0;
  height: fit-content;
  opacity: 0;
}

.notification-item:hover .notification-actions-trigger {
  opacity: 1;
}

.notification-actions-trigger:hover {
  background-color: var(--hover);
  color: var(--txt);
}

/* Estado vacío */
.notifications-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  text-align: center;
}

.notifications-empty-icon {
  font-size: 48px;
  color: var(--muted);
  margin-bottom: 16px;
}

.notifications-empty-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--txt);
  margin: 0 0 8px 0;
}

.notifications-empty-text {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

/* Footer */
.notifications-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--borders);
}

.notifications-view-all {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  padding: 10px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.notifications-view-all:hover {
  background-color: var(--hover);
}

/* Menú contextual */
.notification-context-menu {
  background-color: var(--panel);
  border: 1px solid var(--borders);
  border-radius: var(--radius);
  padding: 4px;
  z-index: 2000;
  min-width: 140px;
}

.context-menu-item {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--txt);
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.context-menu-item:hover {
  background-color: var(--hover);
}

.context-menu-item i {
  font-size: 14px;
  color: var(--muted);
}

.context-menu-item[data-action="delete"]:hover {
  color: var(--accent);
}

.context-menu-item[data-action="delete"]:hover i {
  color: var(--accent);
}

/* Responsive */
@media (max-width: 480px) {
  .notifications-dropdown {
    width: calc(100vw - 32px);
    right: -16px;
  }
}