/**
 * Badge Fix Styles for Imployii
 * Resolves badge display and positioning issues across the site
 */

/* Base badge styles */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.75rem;
  line-height: 1;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  color: #ffffff;
  background-color: #ff5a5f;
}

/* Notification badge positioning fix */
.notification-badge,
.notification-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  background-color: #ff5a5f;
  color: white;
  border-radius: 9px;
  font-size: 0.75rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  z-index: 100;
}

/* Message badge positioning fix */
.message-badge,
.message-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  background-color: #3498db;
  color: white;
  border-radius: 9px;
  font-size: 0.75rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  z-index: 100;
}

/* Badge visibility fix */
.notification-badge.hidden,
.notification-count.hidden,
.message-badge.hidden,
.message-count.hidden {
  display: none !important;
}

/* Position fix for icon badges */
.nav-icon {
  position: relative;
}

/* Badge container positioning */
.badge-container {
  position: relative;
  display: inline-block;
}

/* Hover effect for badged elements */
.badge-container:hover .badge,
.nav-icon:hover .notification-badge,
.nav-icon:hover .message-badge {
  transform: scale(1.1);
  transition: transform 0.2s ease;
}

/* Badge counter for dashboard sidebar */
.sidebar-badge {
  background-color: #3498db;
  color: white;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.7rem;
  margin-left: 5px;
}

/* Pulsing animation for urgent badges */
.badge-urgent {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 90, 95, 0.7);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(255, 90, 95, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 90, 95, 0);
  }
}

/* Mobile responsiveness fixes */
@media (max-width: 768px) {
  .notification-badge,
  .notification-count,
  .message-badge,
  .message-count {
    min-width: 16px;
    height: 16px;
    font-size: 0.7rem;
    top: -2px;
    right: -2px;
  }
}

/* Fix for multiple badges in close proximity */
.multi-badge-container {
  position: relative;
}

.multi-badge-container .notification-badge {
  right: 15px;
}

.multi-badge-container .message-badge {
  right: -4px;
}

/* Header nav specific fixes */
.header-container .notification-badge,
.header-container .message-badge {
  top: -2px;
  right: -2px;
}

/* Sidebar specific fixes */
.sidebar .notification-badge,
.sidebar .message-badge {
  top: 2px;
  right: 8px;
}

/* Dashboard specific fixes */
.dashboard-card .notification-badge,
.dashboard-card .message-badge {
  top: 8px;
  right: 8px;
}

/* Improved accessibility for screen readers */
.sr-only-badge-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}