/**
 * Cursor Styles
 * Styles for multiplayer cursor interactions and visibility
 */

/* Remote cursor styling */
.remote-cursor {
  position: absolute;
  pointer-events: none;
  z-index: 9999;
  transition: opacity 0.3s ease;
  opacity: 0;
}

.remote-cursor.active {
  opacity: 1;
}

.remote-cursor.idle {
  opacity: 0.3;
}

.remote-cursor.leaving {
  opacity: 0;
}

.remote-cursor.clicking .cursor-icon {
  transform: scale(0.9);
}

.cursor-icon {
  display: block;
  transition: transform 0.1s ease;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.cursor-outline {
  fill: #000;
  opacity: 0.3;
}

.cursor-path {
  fill: var(--cursor-color, #72cc96);
}

/* Click ripple effect */
.cursor-click-ripple {
  pointer-events: none;
  border-radius: 50%;
  border: 2px solid var(--cursor-color, #72cc96);
  animation: ripple-animation 0.6s ease-out;
}

@keyframes ripple-animation {
  from {
    transform: scale(0);
    opacity: 1;
  }
  to {
    transform: scale(2);
    opacity: 0;
  }
}

/* Status bar */
.cursor-status {
  position: fixed;
  bottom: 16px;
  right: 16px;
  background: #fff;
  color: #2c2d33;
  border: 1px solid #949494;
  padding: 8px 14px;
  border-radius: 0;
  font-size: 12px;
  font-weight: 400;
  text-transform: uppercase;
  box-shadow: none;
  z-index: 999998;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "DotGothic16", "Press Start 2P", sans-serif;
  letter-spacing: 0.05em;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #666;
}

.cursor-status.connected .status-indicator {
  background: #72cc96;
  animation: pulse 2s ease-in-out infinite;
}

.cursor-status.disconnected .status-indicator {
  background: #e74c3c;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.user-count {
  margin-left: 4px;
  color: #666;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  .cursor-status {
    background: #111113;
    color: #e6edf3;
    border-color: #b3b3b3;
  }

  .user-count {
    color: #b3b3b3;
  }
}

/* Make navigation menu items respond to multiplayer cursors */
nav.nav-bar ul li.cursor-hover,
nav.nav-bar ul li.cursor-hover:focus-within {
  background: #72cc96;
  cursor: pointer;
}

/* Show dropdown when multiplayer cursor hovers */
nav.nav-bar ul li.cursor-hover > ul,
nav.nav-bar ul li.cursor-hover ul:focus {
  visibility: visible;
  opacity: 1;
  display: block;
}

/* Highlight dropdown menu items when multiplayer cursor hovers */
nav.nav-bar ul li ul.dropdown li.cursor-hover {
  background: #72cc96;
}
