/**
 * Online Status Widget Styles
 * Styles for the "Who's Online" feature in the header
 */

/* Online Status Widget Container */
.online-status-widget {
  position: relative;
  display: inline-block;
  grid-column: 1;
  justify-self: end;
  margin-right: 3rem;
}

/* Online Status Button */
.online-status-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--bg-tertiary, #1a1d24);
  border: 1px solid var(--border-color, #2a2f3a);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  color: var(--text-primary, #e8e9eb);
  font-family: 'Oswald', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.online-status-button:hover {
  background-color: var(--bg-hover, #252a35);
  border-color: var(--accent, #FF6B35);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(255, 107, 53, 0.2);
}

/* Green Pulsing Indicator */
.online-indicator {
  display: inline-block;
  width: 10px;
  height: 10px;
  background-color: #00ff00;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 6px rgba(0, 255, 0, 0.6);
  }
  50% {
    opacity: 0.5;
    box-shadow: 0 0 3px rgba(0, 255, 0, 0.3);
  }
}

/* Online Count Text */
.online-count {
  letter-spacing: 0.5px;
}

/* Dropdown Arrow */
.dropdown-arrow {
  font-size: 0.7rem;
  transition: transform 0.3s ease;
}

.online-status-button[aria-expanded="true"] .dropdown-arrow {
  transform: rotate(180deg);
}

/* Dropdown Panel */
.online-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 280px;
  max-width: 320px;
  background-color: var(--bg-secondary, #13151a);
  border: 1px solid var(--border-color, #2a2f3a);
  border-radius: 8px;
  box-shadow: 0 8px 24px var(--shadow-heavy, rgba(0, 0, 0, 0.5));
  z-index: 1000;
  animation: dropdownSlide 0.3s ease-out;
  overflow: hidden;
}

@keyframes dropdownSlide {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Dropdown Header */
.online-dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color, #2a2f3a);
  background-color: var(--bg-tertiary, #1a1d24);
}

.online-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary, #e8e9eb);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.online-total {
  font-size: 0.85rem;
  color: var(--accent, #FF6B35);
  font-weight: 600;
}

/* Users List */
.online-users-list {
  max-height: 300px;
  overflow-y: auto;
  padding: 0.5rem 0;
}

/* Individual User Item */
.online-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  transition: background-color 0.2s ease;
}

.online-user:hover {
  background-color: var(--bg-hover, #252a35);
}

/* User Online Indicator Dot */
.online-user-indicator {
  width: 8px;
  height: 8px;
  background-color: #00ff00;
  border-radius: 50%;
  flex-shrink: 0;
}

.online-user-indicator.active {
  background-color: #00ff00;
  box-shadow: 0 0 6px rgba(0, 255, 0, 0.6);
}

/* User Display Name */
.online-user-name {
  flex: 1;
  font-size: 0.9rem;
  color: var(--text-primary, #e8e9eb);
  font-weight: 500;
}

/* "(You)" Label */
.online-user-you {
  font-size: 0.75rem;
  color: var(--accent, #FF6B35);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Loading and Empty States */
.online-loading,
.online-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-secondary, #8a8d93);
  font-size: 0.9rem;
}

/* Custom Scrollbar */
.online-users-list::-webkit-scrollbar {
  width: 6px;
}

.online-users-list::-webkit-scrollbar-track {
  background: var(--bg-tertiary, #1a1d24);
}

.online-users-list::-webkit-scrollbar-thumb {
  background: var(--border-color, #2a2f3a);
  border-radius: 3px;
}

.online-users-list::-webkit-scrollbar-thumb:hover {
  background: var(--accent, #FF6B35);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .online-dropdown {
    min-width: 240px;
    right: -10px;
  }

  .online-status-button {
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
  }

  .online-count {
    display: none;
  }

  .online-status-widget {
    margin-right: 1rem;
  }

  .online-user {
    padding: 0.6rem 0.8rem;
  }

  .online-user-name {
    font-size: 0.85rem;
  }
}

/* Integration with existing header */
.user-display {
  display: flex;
  align-items: center;
  gap: 1rem;
  grid-column: 3;
  justify-self: start;
  margin-left: 2rem;
  /* Match the online status button styling */
  background-color: var(--bg-tertiary, #1a1d24);
  border: 1px solid var(--border-color, #2a2f3a);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  transition: all 0.3s ease;
}

/* Make sure dropdown appears above other elements */
.online-dropdown {
  z-index: 9999;
}
