/* Friends Panel */
.friends-panel {
  background: rgba(15, 23, 42, 0.96);
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.9);
  box-shadow: 0 10px 28px rgba(0,0,0,.9), 0 0 18px rgba(56,189,248,.45);
  padding: .5rem;
  min-width: 200px;
  max-width: 300px;
}

.friends-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #bfdbfe;
  margin-bottom: .5rem;
  padding: 0 .25rem;
}

.friends-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
}
.friends-close:hover {
  color: #e2e8f0;
}

.friends-tabs {
  display: flex;
  gap: .25rem;
  margin-bottom: .5rem;
}

.friends-tab {
  flex: 1;
  padding: .35rem .5rem;
  border: 1px solid rgba(56,189,248,0.35);
  background: rgba(15,23,42,0.6);
  color: #94a3b8;
  font-size: .72rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
}
.friends-tab.active {
  background: rgba(56,189,248,0.2);
  border-color: rgba(56,189,248,0.6);
  color: #e2f2ff;
}
.friends-tab:hover {
  border-color: rgba(56,189,248,0.5);
}

.friends-badge {
  background: #ef4444;
  color: white;
  font-size: .65rem;
  padding: .1rem .35rem;
  border-radius: 999px;
  min-width: 16px;
  text-align: center;
}

.friends-content {
  max-height: 300px;
  overflow-y: auto;
}

.friends-loading,
.friends-empty {
  text-align: center;
  padding: 1rem;
  color: #64748b;
  font-size: .8rem;
}

.friends-list {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.friend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .4rem .5rem;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(71, 85, 105, 0.4);
}
.friend-item:hover {
  background: rgba(30, 41, 59, 0.8);
}

.friend-info {
  display: flex;
  align-items: center;
  gap: .5rem;
  cursor: pointer;
  flex: 1;
  min-width: 0;
}

.friend-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(56,189,248,0.22);
  border: 1px solid rgba(56,189,248,0.55);
  color: #e2f2ff;
  font-weight: 800;
  font-size: .75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.friend-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.friend-info-text {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  min-width: 0;
}

.friend-request-direction {
  font-size: .65rem;
  color: #64748b;
}

.friend-item-sent {
  border-color: rgba(251, 191, 36, 0.3);
}

.friend-item-sent .friend-request-direction {
  color: #fbbf24;
}

.friend-item-received {
  border-color: rgba(56, 189, 248, 0.4);
}

.friend-item-received .friend-request-direction {
  color: #7dd3fc;
}

.friend-name {
  font-size: .8rem;
  color: #e5e7eb;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-actions {
  display: flex;
  gap: .25rem;
}

.friend-action {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid rgba(148,163,184,0.3);
  background: rgba(15,23,42,0.6);
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
}
.friend-action:hover {
  border-color: rgba(148,163,184,0.5);
}

.friend-action-accept {
  color: #4ade80;
  border-color: rgba(74,222,128,0.3);
}
.friend-action-accept:hover {
  background: rgba(74,222,128,0.2);
  border-color: rgba(74,222,128,0.6);
}

.friend-action-reject,
.friend-action-remove {
  color: #f87171;
  border-color: rgba(248,113,113,0.3);
}
.friend-action-reject:hover,
.friend-action-remove:hover {
  background: rgba(248,113,113,0.2);
  border-color: rgba(248,113,113,0.6);
}

.friend-action-cancel {
  color: #fbbf24;
  border-color: rgba(251,191,36,0.3);
}
.friend-action-cancel:hover {
  background: rgba(251,191,36,0.2);
  border-color: rgba(251,191,36,0.6);
}

/* Friend button in profile */
.friend-btn {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .8rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid;
  transition: all 0.2s;
}

.friend-btn-add {
  background: rgba(56,189,248,0.15);
  border-color: rgba(56,189,248,0.5);
  color: #7dd3fc;
}
.friend-btn-add:hover {
  background: rgba(56,189,248,0.25);
  border-color: rgba(56,189,248,0.7);
}

.friend-btn-pending {
  background: rgba(251,191,36,0.15);
  border-color: rgba(251,191,36,0.5);
  color: #fbbf24;
}

.friend-btn-friends {
  background: rgba(74,222,128,0.15);
  border-color: rgba(74,222,128,0.5);
  color: #4ade80;
}

.friend-btn-remove {
  background: rgba(248,113,113,0.15);
  border-color: rgba(248,113,113,0.5);
  color: #f87171;
}
.friend-btn-remove:hover {
  background: rgba(248,113,113,0.25);
  border-color: rgba(248,113,113,0.7);
}

/* Add Friend Form */
.friends-add-form {
  display: flex;
  gap: .25rem;
  margin-bottom: .4rem;
}

.friends-add-input {
  flex: 1;
  padding: .35rem .5rem;
  border-radius: 8px;
  border: 1px solid rgba(71, 85, 105, 0.5);
  background: rgba(15, 23, 42, 0.8);
  color: #e5e7eb;
  font-size: .75rem;
}

.friends-add-input::placeholder {
  color: #64748b;
}

.friends-add-input:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.6);
}

.friends-add-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
  font-size: .8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.friends-add-btn:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.25);
  border-color: rgba(56, 189, 248, 0.7);
}

.friends-add-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.friends-add-error {
  font-size: .7rem;
  color: #fca5a5;
  padding: .2rem .3rem;
  margin-bottom: .3rem;
}

.friends-add-success {
  font-size: .7rem;
  color: #4ade80;
  padding: .2rem .3rem;
  margin-bottom: .3rem;
}

/* Suggestions dropdown */
.friends-add-wrap {
  position: relative;
  margin-bottom: .4rem;
}

.friends-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 8px;
  margin-top: 4px;
  max-height: 180px;
  overflow-y: auto;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.friends-suggestion-item {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem .5rem;
  cursor: pointer;
  font-size: .75rem;
  color: #e5e7eb;
  transition: background 0.15s;
}

.friends-suggestion-item:hover {
  background: rgba(56, 189, 248, 0.15);
}

.friends-suggestion-item .friend-avatar {
  width: 24px;
  height: 24px;
  font-size: .65rem;
}

.friends-suggestions-loading {
  font-size: .7rem;
  color: #64748b;
  padding: .3rem .4rem;
  text-align: center;
}
