/* ============================================
   IMPROVED STATUS INDICATOR DESIGNS
   Modern, elegant alternatives to corner dots
   ============================================ */

/* Option 1: Subtle Border Ring (Zoom/Discord style) */
.status-ring {
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  border: 2px solid transparent;
  transition: all 0.3s ease;
  pointer-events: none;
  z-index: 2; /* Ensure it's above the avatar */
  box-sizing: border-box;
}

.status-ring.online {
  border-color: #22c55e;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.1);
}

.status-ring.away {
  border-color: #f59e0b;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.1);
}

.status-ring.busy {
  border-color: #ef4444;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.1);
}

.status-ring.offline {
  border-color: #6b7280;
  opacity: 0.5;
}

/* Option 2: Bottom Status Bar (Slack style) */
.status-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, currentColor, transparent);
  border-radius: 0 0 50% 50%;
  transition: all 0.3s ease;
}

.status-bar.online {
  color: #22c55e;
  animation: pulse-green 2s infinite;
}

.status-bar.away {
  color: #f59e0b;
}

.status-bar.busy {
  color: #ef4444;
  animation: pulse-red 2s infinite;
}

.status-bar.offline {
  display: none;
}

/* Option 3: Integrated Badge (Microsoft Teams style) */
.status-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.status-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.status-badge.online::before {
  background: #22c55e;
}

.status-badge.away::before {
  background: #f59e0b;
}

.status-badge.busy::before {
  background: #ef4444;
}

.status-badge.offline::before {
  background: #6b7280;
  width: 6px;
  height: 6px;
}

/* Option 4: Corner Arc (WhatsApp style) */
.status-arc {
  position: absolute;
  top: 0;
  right: 0;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 0 0 0 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: -1px 1px 2px rgba(0, 0, 0, 0.1);
}

.status-arc::before {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.status-arc.online::before {
  background: #22c55e;
  animation: pulse-green 2s infinite;
}

.status-arc.away::before {
  background: #f59e0b;
}

.status-arc.busy::before {
  background: #ef4444;
}

.status-arc.offline::before {
  background: #6b7280;
}

/* Option 5: Side Indicator (Linear style) */
.status-side {
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 20px;
  border-radius: 2px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.status-side.online {
  background: linear-gradient(180deg, #22c55e, #16a34a);
}

.status-side.away {
  background: linear-gradient(180deg, #f59e0b, #d97706);
}

.status-side.busy {
  background: linear-gradient(180deg, #ef4444, #dc2626);
}

.status-side.offline {
  background: linear-gradient(180deg, #6b7280, #4b5563);
  opacity: 0.5;
}

/* Animations */
@keyframes pulse-green {
  0%, 100% { 
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); 
  }
  50% { 
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0); 
  }
}

@keyframes pulse-red {
  0%, 100% { 
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); 
  }
  50% { 
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0); 
  }
}

/* Enhanced Avatar Container for Status Integration */
.user-avatar-container.with-status {
  position: relative;
  display: inline-block;
}

/* Ensure avatar container maintains aspect ratio */
.user-avatar-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.user-avatar-container.with-status .user-avatar {
  position: relative;
  z-index: 1;
}

/* Status Text Option (For larger displays) */
.status-text {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 10px;
  white-space: nowrap;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.status-text.online {
  background: #dcfce7;
  color: #15803d;
}

.status-text.away {
  background: #fef3c7;
  color: #92400e;
}

.status-text.busy {
  background: #fee2e2;
  color: #991b1b;
}

.status-text.offline {
  background: #f3f4f6;
  color: #4b5563;
}

/* Hover Effects */
.user-avatar-container:hover .status-ring {
  transform: scale(1.1);
}

.user-avatar-container:hover .status-badge {
  transform: scale(1.15);
}

.user-avatar-container:hover .status-text {
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .status-text {
    display: none;
  }
  
  .status-side {
    right: -4px;
    width: 3px;
    height: 16px;
  }
}

/* Accessibility */
.status-indicator[aria-label] {
  position: relative;
}

.status-indicator[aria-label]:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Tooltip for Status */
.status-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 8px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  font-size: 11px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.user-avatar-container:hover .status-tooltip {
  opacity: 1;
}

.status-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.8);
}